A production-style digital wallet and payments platform built with a modern TypeScript monorepo architecture.
Walleti simulates the core infrastructure of a real-world fintech platform including:
- Peer-to-peer transfers
- Wallet balance management
- Bank on-ramping
- Stripe payment processing
- Merchant integrations
- Async workers and webhook consumers
- Reconciliation systems
- Observability and metrics
- Notification infrastructure
The project is structured as a scalable monorepo using TurboRepo and demonstrates distributed systems, backend architecture, financial workflows, observability, and full-stack engineering concepts.
┌────────────────────┐
│ User App │
│ Next.js Frontend │
└─────────┬──────────┘
│
▼
┌──────────────────────────┐
│ API Routes │
│ Authentication Layer │
└─────────┬────────────────┘
│
┌─────────────────┼─────────────────┐
▼ ▼ ▼
┌────────────┐ ┌──────────────┐ ┌──────────────┐
│ PostgreSQL │ │ Redis Queue │ │ Wallet Core │
│ Prisma │ │ ioredis │ │ Business Logic│
└─────┬──────┘ └──────┬───────┘ └──────┬───────┘
│ │ │
▼ ▼ ▼
┌────────────────┐ ┌────────────────┐ ┌────────────────┐
│ Notification │ │ Stripe Webhook│ │ Reconciliation │
│ Worker │ │ Consumer │ │ Worker │
└────────────────┘ └────────────────┘ └────────────────┘
walleti/
│
├── apps/
│ ├── user-app/ # Main wallet application
│ ├── merchant-app/ # Merchant-facing app
│ ├── bank-webhook/ # Simulated banking webhook service
│ ├── notification-worker/ # Notification processing worker
│ ├── stripe-webhook-consumer/ # Stripe event consumer
│ └── reconciliation-worker/ # Financial reconciliation service
│
├── packages/
│ ├── db/ # Prisma schema and DB client
│ ├── wallet-core/ # Core wallet business logic
│ ├── redis/ # Redis abstraction layer
│ ├── metrics/ # Prometheus metrics package
│ ├── store/ # Shared frontend state management
│ ├── ui/ # Shared UI components
│ ├── eslint-config/ # Shared lint configuration
│ └── typescript-config/ # Shared TypeScript configs
│
├── observability/
│ ├── grafana/ # Grafana dashboards
│ └── prometheus.yml # Prometheus configuration
│
├── docker-compose.yml
├── turbo.json
└── package.json
- TypeScript
- React 18
- Next.js 14 (App Router)
- Tailwind CSS
- Recoil
- NextAuth.js
- Node.js
- Express.js
- Prisma ORM
- PostgreSQL
- Redis
- Stripe API
- Redis-based queues
- Event-driven workers
- Webhook consumers
- Reconciliation processors
- Prometheus
- Grafana
- Custom metrics via prom-client
- TurboRepo
- ESLint
- TypeScript
- esbuild
- tsx
- Docker Compose
- Credential-based authentication
- NextAuth integration
- Session management
- Password hashing with bcrypt
- Merchant and user auth flows
- User wallet balances
- Locked balance support
- Atomic transaction handling
- Balance reconciliation
- User-to-user transfers
- Transfer history tracking
- Database-backed ledger entries
-
Simulated banking integrations
-
Webhook-driven payment completion
-
On-ramp transaction states:
- Processing
- Success
- Failure
- Stripe webhook consumer
- Payment event processing
- Checkout workflow integration
- Email notifications
- SMS support with Twilio
- Firebase integration
- Async notification processing
- Merchant-facing application
- Merchant authentication
- Payment workflows
- Transaction verification
- Ledger consistency checks
- Financial data reconciliation
- Metrics endpoints
- Prometheus scraping
- Grafana dashboards
- Health check APIs
The project uses PostgreSQL with Prisma ORM.
Stores platform users.
Maintains wallet balances and locked amounts.
Tracks peer-to-peer transactions.
Tracks bank deposits and payment onboarding.
Stores merchant account information.
- One-to-many with transfers
- One-to-one with balance
- One-to-many with on-ramp transactions
The architecture is designed to support:
- Atomic operations
- Consistent balance updates
- Event-driven reconciliation
- Distributed transaction processing patterns
This project demonstrates several real-world backend engineering concepts.
Workers consume asynchronous events from queues and webhooks.
Redis is used for asynchronous workflows and decoupled systems.
Background workers validate and reconcile financial records.
Metrics and monitoring are built directly into the system.
Reusable business logic is extracted into shared packages.
TurboRepo enables scalable multi-application development.
Main customer-facing wallet application.
- Dashboard
- P2P transfers
- Transaction history
- Wallet balance views
- Stripe checkout integration
- Notifications
Merchant-focused frontend application.
Simulates bank callbacks and payment confirmations.
Processes notification jobs asynchronously.
Consumes Stripe payment events.
Ensures financial consistency across transactions.
Redis is used for:
- Async job queues
- Event processing
- Worker communication
- Rate limiting support
- Notification processing
Used for metrics collection.
- Worker activity
- Request counts
- Queue processing
- Health metrics
- Financial processing metrics
Used for metrics visualization and dashboards.
Install:
- Node.js 18+
- Docker
- npm
Create .env files where required.
Example variables:
DATABASE_URL=
NEXTAUTH_SECRET=
REDIS_URL=
STRIPE_SECRET_KEY=
TWILIO_ACCOUNT_SID=
TWILIO_AUTH_TOKEN=Some apps already include .env.example files.
git clone https://github.com/devmehtaa/walleti.git
cd walletinpm installdocker-compose up -dThis starts:
- PostgreSQL
- Redis
- Mailhog
- Prometheus
- Grafana
cd packages/db
npx prisma generatenpx prisma migrate devnpm run devnpm run workers:dev| Service | Port |
|---|---|
| User App | 3001 |
| Merchant App | 3000 |
| PostgreSQL | 5432 |
| Redis | 6379 |
| Prometheus | 9090 |
| Grafana | 3000 |
| Mailhog UI | 8025 |
| Mailhog SMTP | 1025 |
# Clone repo
git clone https://github.com/devmehtaa/walleti.git
cd walleti
# Install dependencies
npm install
# Start infrastructure
docker-compose up -d
# Configure env variables
cp apps/user-app/.env.example apps/user-app/.env
cp apps/notification-worker/.env.example apps/notification-worker/.env
cp packages/db/.env.example packages/db/.env
# Generate Prisma client
cd packages/db
npx prisma generate
npx prisma migrate dev
cd ../..
# Start development servers
npm run dev
# Start workers
npm run workers:devThis project showcases:
- Monorepo architecture
- Shared package management
- Event-driven systems
- Background job processing
- Payment infrastructure
- Webhook systems
- Distributed worker architecture
- Financial transaction systems
- Queue-based workflows
- Metrics and monitoring
- Scalable TypeScript architecture
- Shared business logic layers
- Password hashing with bcrypt
- Session-based authentication
- Environment variable management
- Separated worker responsibilities
- Database transaction safety patterns
Potential extensions for the platform:
- Kubernetes deployment
- Kafka integration
- Distributed tracing
- Multi-currency support
- Ledger-based accounting engine
- Fraud detection systems
- Real banking integrations
- Role-based access control
- Rate limiting middleware
- Audit logging
- CI/CD pipelines
- End-to-end testing
- Mobile application
This repository is a strong reference project for learning:
- Full-stack fintech systems
- Backend architecture
- Distributed systems
- Worker-based processing
- Payment infrastructure
- Observability systems
- Monorepo engineering
- Financial transaction modeling
- Queue systems with Redis
- Production-grade TypeScript architecture
Built by Dev Mehta.
GitHub: https://github.com/devmehtaa
This project is for educational and portfolio purposes.