A production-grade, full-stack application built with NestJS, Next.js (App Router), and PostgreSQL. This system is designed for high-concurrency financial operations, featuring robust ACID-compliant transaction logic and a modern, high-tier fintech UI.
| Requirement | Implementation Detail | Status |
|---|---|---|
| Graceful Error Handling | Global exception handling in NestJS + local try/catch with feedback in UI. | ✅ |
| Proper Validations | DTO-level validation using class-validator and ValidationPipe. |
✅ |
| Clean Coding Standards | Modular architecture, Service/Controller separation, and TypeScript types. | ✅ |
| Secure Password Storage | Adaptive Bcrypt hashing (salt rounds: 10) for all user credentials. | ✅ |
| Transaction Reliability | Manual QueryRunner transactions with pessimistic_write row-locking. |
✅ |
| Database Schema | Relational schema with foreign keys and performance indices. See schema.sql. |
✅ |
| API Documentation | Fully interactive Swagger UI with live endpoint testing. | ✅ |
| Setup Instructions | Comprehensive guide for DB, Backend, and Frontend below. | ✅ |
- Dual Dashboard Interface: Production-ready V1 and an expanded analytics-heavy V2.
- Secure P2P Transfers: ACID-compliant fund movement using PostgreSQL row-locking.
- Instant Liquidity: "Add Money" system to simulate bank-to-wallet funding.
- Audit Ledger: Real-time transaction history with advanced search, sort, and status filtering.
- Collapsible Sidebar: Dynamic responsive navigation with smooth state transitions.
- Mobile Optimized: Fully responsive layout using
100dvhfor mobile browser compatibility.
- Backend: NestJS, TypeORM, PostgreSQL, Swagger, Passport/JWT.
- Frontend: Next.js 15+, Tailwind CSS 4.0, Lucide Icons, Axios.
- Reliability: Pessimistic Database Locking for race-condition prevention.
To view the app on your mobile phone:
- Ensure your phone and PC are on the same Wi-Fi.
- Find your PC's IP address (e.g.,
192.168.0.100). - Access
http://[YOUR_IP]:3000on your mobile browser. The app is configured with a built-in proxy to handle network requests seamlessly.
To host this project for free without running a local server, follow this proven stack:
- Create a free account at Neon.tech.
- Create a project and copy the Connection String (
postgres://...). - This will be your
DATABASE_URLfor the backend.
- Create a free account at Render.com.
- Create a new Web Service and connect your GitHub repo.
- Root Directory:
backend - Build Command:
npm install && npm run build - Start Command:
npm run start:prod(ornode dist/main) - Environment Variables:
DATABASE_URL: Your Neon connection string.JWT_SECRET: A long random string.PORT: 10000 (Render default).
- Create a free account at Vercel.com.
- Connect your GitHub repo.
- Root Directory:
frontend - Framework Preset: Next.js.
- Environment Variables:
BACKEND_INTERNAL_URL: Your Render service URL (e.g.,https://wallet-api.onrender.com).NEXT_PUBLIC_API_URL:/api-backend(Keep as default for proxying).
- Create a PostgreSQL database named
wallet_db. - Run the DDL found in
schema.sql(optional, as TypeORM will auto-generate if configured). - Update
backend/.env:DB_HOST=localhost DB_PORT=5432 DB_USER=postgres DB_PASSWORD=your_password DB_NAME=wallet_db JWT_SECRET=production_secret_key PORT=3001
cd backend
npm install
npm run start:devAPI Docs available at: http://localhost:3001/api/docs
cd frontend
npm install
npm run devWeb App available at: http://localhost:3000
The system prevents Double-Spending or balance mismatches by utilizing database-level transactions. When a transfer starts, the sender's and receiver's wallet rows are locked using SELECT FOR UPDATE (pessimistic_write), ensuring that no other process can modify the balance until the transaction commits or rolls back.
The system exposes a Swagger UI at /api/docs. It provides:
- Detailed DTO schemas for all requests.
- Automatic Bearer Token header management.
- Live testing for all
Auth,User,Wallet, andTransactionendpoints.