Fincore is a backend system that simulates core banking operations like user authentication, account management, and secure money transfers.
The focus of this project is not just CRUD APIs, but building a system that handles transactions reliably using concepts like ledger entries, idempotency, and JWT-based authentication.
- User authentication using JWT
- Support for multiple accounts per user
- Secure fund transfer between accounts
- Ledger-based transaction system (no direct balance updates)
- Idempotency handling to prevent duplicate transactions
- Token blacklisting for logout
- Account status management (
ACTIVE,FROZEN,CLOSED) - Email notifications for important actions
Instead of storing balance directly in the account, this project follows a ledger-based model.
Every transaction creates:
- a DEBIT entry (from sender)
- a CREDIT entry (to receiver)
The account balance is calculated from these entries when needed.
This approach helps in:
- maintaining transaction history
- avoiding inconsistencies
- making the system closer to real-world banking systems
- Node.js
- Express.js
- MongoDB (Mongoose)
- JWT for authentication
- bcrypt for password hashing
- Nodemailer for email service
Backend-Fincore/
│
├── src/
│ ├── config/
│ ├── controllers/
│ ├── middleware/
│ ├── models/
│ ├── routes/
│ ├── services/
│ └── app.js
│
├── server.js
├── .env
└── package.jsongit clone https://github.com/ayushcode191/FinCore.git
cd FinCorenpm installPORT=5000
MONGO_URI=your_mongodb_uri
JWT_SECRET=your_secret_key
EMAIL_USER=your_email
EMAIL_PASS=your_passwordnpm run devor
node server.js- Register → creates user with hashed password
- Login → returns JWT token
- Logout → token is blacklisted
POST /api/auth/registerPOST /api/auth/loginPOST /api/auth/logout
POST /api/accounts/createGET /api/accountsGET /api/accounts/:accountId/balance
POST /api/transactions/createPOST /api/transactions/initial-funds
{
"fromAccount": "account_id_1",
"toAccount": "account_id_2",
"amount": 500,
"idempotencyKey": "unique-key-123"
}- Passwords are stored in hashed form
- Ledger entries cannot be modified once created
- Duplicate transactions are avoided using idempotency keys
- Only authenticated users can access protected routes
This project covers several important backend concepts:
- REST API design
- authentication & authorization using JWT
- secure password hashing
- database schema design with MongoDB
- ledger-based accounting system
- idempotent transaction handling
- multi-account management
- token blacklisting for logout
The goal was to build something closer to a real-world backend rather than a simple CRUD application.
- Transaction history with pagination
- Admin features (freeze/unfreeze accounts)
- Rate limiting and security middleware
- API documentation (Swagger)
- Frontend integration
Ayush Bansal
B.Tech IT
If you found this useful, feel free to star the repo.