A backend system that simulates a banking-style ledger architecture for managing accounts and transactions.
This project focuses on secure financial record management, atomic transactions, and ledger-based balance tracking.
- User Registration
- User Login
- User Logout
- JWT-based authentication
- Cookie-based session management
- Token blacklist system for secure logout
- Create user accounts
- Multiple accounts per user
- Account status management:
- ACTIVE
- FROZEN
- CLOSED
Instead of storing balance directly, the system calculates balance using ledger entries.
Ledger entries include:
- DEBIT
- CREDIT
This follows real banking system architecture where balance is derived from transactions.
Users can transfer funds between accounts.
Features include:
- Account validation
- Balance validation
- Account status verification
- Idempotent transactions (prevents duplicate payments)
Each transaction uses an idempotency key to prevent duplicate processing.
This ensures:
- Safe retries
- Duplicate payment protection
Transactions are executed using MongoDB sessions to ensure atomicity.
Steps:
- Create transaction (PENDING)
- Create debit ledger entry
- Create credit ledger entry
- Mark transaction as COMPLETED
If any step fails β the transaction is rolled back.
Email notifications are sent for:
- User Registration
- Successful Transactions
- Failed Transactions
Implemented using Nodemailer with OAuth2 authentication.
- Node.js
- Express.js
- MongoDB
- Mongoose
- JWT Authentication
- bcryptjs
- Nodemailer
- MongoDB Transactions (Sessions)
- Password hashing using bcrypt
- JWT authentication
- Cookie-based sessions
- Token blacklist system
- Idempotent transactions
- Account status validation
This project demonstrates:
- Ledger based accounting systems
- Financial transaction integrity
- Idempotency patterns
- MongoDB transactions
- Secure authentication systems
- Backend architecture design
- Transaction history API
- Account freeze/unfreeze API
- Admin dashboard
- Rate limiting
- Frontend dashboard (React)
Tauseef Ahmad