A full-stack Bank Management System built with Node.js, Express, MySQL, and React.
- Authentication & Authorization: JWT-based authentication with role-based access control
- Account Management: Create, view, and manage bank accounts
- Transactions: Deposit, withdraw, and transfer with database transaction safety
- Audit Logging: Complete audit trail for all operations
- Security: Rate limiting, helmet.js, bcrypt password hashing
- Scheduled Jobs: Automated interest calculation using node-cron
- Modern UI: Clean, responsive design with gradient cards
- Dashboard: Real-time account balance and transaction history
- Operations: Easy-to-use forms for deposits, withdrawals, and transfers
- React Router: Smooth navigation between pages
- Node.js & Express
- MySQL with Sequelize ORM
- JWT for authentication
- bcryptjs for password hashing
- express-rate-limit for API protection
- node-cron for scheduled tasks
- React 18
- React Router v6
- Axios for API calls
- Vite for fast development
- Modern CSS with gradients and shadows
mini project/
├── backend/
│ ├── src/
│ │ ├── config/ # Database configuration
│ │ ├── models/ # Sequelize models
│ │ ├── controllers/ # Request handlers
│ │ ├── routes/ # API routes
│ │ ├── middlewares/ # Auth, error handling, rate limiting
│ │ ├── utils/ # Helper functions
│ │ ├── jobs/ # Cron jobs
│ │ ├── seed/ # Database seeding
│ │ ├── app.js # Express app setup
│ │ └── server.js # Server entry point
│ ├── tests/ # Test files
│ ├── package.json
│ ├── .env.example
│ └── docker-compose.yml
│
└── frontend/
├── src/
│ ├── api/ # API client
│ ├── pages/ # React pages
│ ├── styles/ # CSS files
│ ├── App.jsx # Main app component
│ └── index.jsx # Entry point
├── package.json
├── vite.config.js
└── index.html
- Node.js (v18 or higher)
- MySQL (v8.0 or higher)
- npm or yarn
- Navigate to backend directory:
cd backend- Install dependencies:
npm install- Configure environment:
cp .env.example .envEdit .env with your database credentials:
PORT=5000
NODE_ENV=development
JWT_SECRET=your_super_secret_jwt_key
JWT_EXPIRES_IN=1d
DB_HOST=localhost
DB_PORT=3306
DB_NAME=bms
DB_USER=root
DB_PASS=your_password
BCRYPT_SALT=10- Create the database:
CREATE DATABASE bms;- Seed the database:
npm run seed- Start the server:
npm run devBackend will run on http://localhost:5000
- Navigate to frontend directory:
cd frontend- Install dependencies:
npm install- Configure environment:
cp .env.example .env- Start the development server:
npm run devFrontend will run on http://localhost:3000
POST /api/auth/register- Register new userPOST /api/auth/login- Login user
GET /api/accounts/user- Get logged-in user's accountsPOST /api/accounts- Create new accountGET /api/accounts/:id- Get account detailsGET /api/accounts/:accountId/transactions- Get account transactionsPATCH /api/accounts/:id/freeze- Freeze account (admin only)
POST /api/transactions/deposit- Deposit moneyPOST /api/transactions/withdraw- Withdraw moneyPOST /api/transactions/transfer- Transfer between accounts
After seeding the database:
-
Alice (Customer)
- Email: alice@bank.com
- Password: Alice123!
- Account Balance: ₹50,000
-
Bob (Customer)
- Email: bob@bank.com
- Password: Bob123!
- Account Balance: ₹7,500
-
Admin
- Email: admin@bank.com
- Password: Admin123!
You can run the entire stack using Docker:
cd backend
docker-compose upThis will start:
- MySQL database on port 3306
- Backend API on port 5000
- JWT-based authentication
- Password hashing with bcrypt
- Rate limiting (60 requests per minute)
- Helmet.js for HTTP headers security
- CORS configuration
- Database transaction locking for concurrent operations
- id, name, email, passwordHash, role, isActive
- id, accountNumber, userId, accountType, currency, balance, status
- id, accountId, type, amount, currency, relatedAccountId, balanceAfter, narration
- id, entity, entityId, action, dataBefore, dataAfter, performedBy
- id, accountId, principal, rate, tenureMonths, outstanding, status
cd backend
npm testBackend:
cd backend
npm startFrontend:
cd frontend
npm run build
npm run preview- Loan management system
- Admin dashboard
- Account statements (PDF generation)
- Email notifications
- Two-factor authentication
- Transaction search and filters
- Charts and analytics
- Mobile app
MIT
Tejas - Full Stack Developer