This project is a full-stack clone of the Paytm digital wallet, built with a modern, scalable, and type-safe stack. It features a complete monorepo architecture using Turborepo to manage separate applications for users, merchants, and backend services.
The primary user-app allows users to manage their wallet, send money to other users (P2P), and add funds from their bank via a simulated bank onramp. The entire system is built for reliability, using PostgreSQL and Prisma to ensure database integrity and ACID properties for all financial transactions.
| Landing Page | Dashboard Overview |
|---|---|
![]() |
! |
(To add these: create a docs folder in your project root, add your screenshots, and commit them.)
- User Authentication: Secure sign-up and sign-in using NextAuth.
- P2P (Peer-to-Peer) Transfers: Instantly send money to other users on the platform.
- Wallet Management: A personal digital wallet to hold and manage funds.
- Add Money: Simulate adding money to the wallet via a bank onramp.
- Transaction History: A complete, filterable list of all P2P and onramp transactions.
- Decoupled Architecture: Built as a monorepo with separate frontends and backend services.
- Asynchronous Webhooks: A dedicated
bank-webhookservice to process bank transfers asynchronously.
This project uses a Turborepo monorepo to manage multiple applications and shared packages.
- Monorepo: Turborepo
- Framework: Next.js (React)
- Backend: Node.js (for
bank-webhookservice) - Database: PostgreSQL
- ORM: Prisma
- Authentication: NextAuth.js
- Styling: Tailwind CSS
- Language: TypeScript
- Deployment: Docker, Vercel/Netlify
merchant-paytm/
├── apps/
│ ├── bank-webhook/ # Node.js service for bank webhooks
│ ├── merchant-app/ # Next.js app for merchants
│ └── user-app/ # Main Next.js app for users
├── packages/
│ ├── db/ # Shared Prisma schema and database client
│ └── ui/ # Shared React component library
├── .gitignore
├── package.json
└── turbo.json # Turborepo configuration
- ACID Properties: All P2P transfers are executed inside a
prisma.$transaction. This ensures that debiting the sender and crediting the receiver is an atomic operation: it either fully completes or fails entirely, preventing data inconsistency. - Separation of Concerns: By splitting the app into a
user-app,merchant-app, and abank-webhookservice, we create a more resilient and scalable system. Thebank-webhookcan process payments independently without blocking the user-facing application.
git clone https://github.com/KartikeyNamdev/Merchant-Paytm
cd merchant-paytmnpm install- Run the PostgreSQL database using Docker:
docker run --name paytm-db -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d postgres- Create a
.envfile in the root of the project (or inapps/user-app).
You must do this, or Prisma will fail.
# .env
DATABASE_URL="postgresql://postgres:mysecretpassword@localhost:5432/postgres"
# For NextAuth
NEXTAUTH_URL="http://localhost:3001"
NEXTAUTH_SECRET="somesecretstring"Push the Prisma schema to your new database.
npm db:push # Assuming you have a script `prisma db push`This will start all applications in the monorepo.
npm devYour user-app will be available at http://localhost:3001.
This project is open source and available under the MIT License.
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
Your Name
- GitHub: @KartikeyNamdev
- LinkedIn: Your Name
⭐️ If you found this project helpful, please consider giving it a star!
