Wenmo is a Paytm-like wallet application that allows users to onramp money through a mock bank account. Users can send money, view their transaction history, and manage their balance within the app. Project utilizes a microservices architecture powered by Turborepo and integrates various modern technologies.
- Features
- Tech Stack
- Getting Started
- Project Structure
- Routes
- Database
- Security
- Webhooks
- Contributing
- License
- Authentication: Secure login using credentials, Google, and GitHub.
- Send Money: Transfer money to other users via phone numbers.
- Onramp Money: Add money to your account from a mock bank server.
- Transaction History: View and manage your transaction history (Work In Progress).
- Dashboard: View account balance, recent transactions, and onramp options.
- Database Locking: Ensures transaction integrity and prevents faulty transactions.
- Frontend/Backend: Next.js
- Auxiliary Backend: Express.js
- Monorepo Management: Turborepo
- Database: PostgreSQL
- ORM: Prisma
- Styling: Tailwind CSS
- Node.js (v14+)
- PostgreSQL
- npm (for package management)
-
Clone the repository:
git clone https://github.com/jignesh119/Wenmo.git cd Wenmo -
Install dependencies:
npm install
-
Set up the environment variables: Create specific
.envfiles for theuser-app,merchant-app, anddbpackage:-
apps/user-app/.env:NEXTAUTH_URL=http://localhost:3000 NEXTAUTH_SECRET=your_secret_key -
apps/merchant-app/.env:GOOGLE_CLIENT_ID=google_client_id GOOGLE_CLIENT_SECRET=google_client_secret NEXTAUTH_SECRET=your secret NEXTAUTH_URL=http://localhost:3001 -
packages/db/.env:DATABASE_URL=postgresql://user:password@localhost:5432/wenmo
-
-
Run the migrations:
npx prisma migrate dev
-
Start the development server:
npm run dev
-
Access the application: Open your browser and go to
http://localhost:3000.
wenmo/
├── apps/
│ ├── user-app/ # Next.js app for user-facing features
│ ├── merchant-app/ # Next.js app for merchant-facing features
│ └── bank-webhook/ # Express app for handling bank webhooks
├── packages/
│ ├── db/ # Prisma setup for PostgreSQL
│ ├── store/ # Shared state management
│ └── ui/ # Shared UI components
└── docker/ # Docker configurations
/api/auth/sign: Sign-in page (auto-redirect for non-logged-in users)./api/auth/callback: OAuth callback handler.
/dashboard: User dashboard displaying account balance and recent transactions.
/transfer: View balance, select providers, and view onramping transactions./p2p: Send money to other users by entering their phone numbers.
/transactions: View all transactions made by the user (Work In Progress).
- PostgreSQL: Used for storing user data, merchant data, transaction history, and authentication information.
- Prisma ORM: Provides type-safe database access and migrations.
Database locking is implemented to prevent double-spending and ensure the consistency of transactions.
- JWT Authentication: Secure session handling with JWT.
- OAuth Integration: Supports Google and GitHub for easy login.
- Database Locking: Prevents race conditions and ensures transaction integrity.
- Bank Webhooks: The
bank-webhookapp handles user onramping requests and triggers webhooks to update user balances. Webhook endpoints ensure that the user balance is incremented only after a successful transaction.