NairaNest is a comprehensive, full-stack banking platform designed to simulate modern financial operations. It features a secure, high-performance REST API backed by ACID-compliant transactions and a responsive React frontend with distinct dashboards for Users and Administrators.
- ACID-Compliant Transactions: Uses MongoDB Sessions (
startSession) to ensure transfers are atomic. If a debit succeeds but the credit fails, the entire operation rolls back, guaranteeing data integrity. - Role-Based Access Control (RBAC): Distinct Middleware protection for
Uservs.Adminroutes. - Rate Limiting: Custom brute-force protection that locks accounts for 5 minutes after 5 failed login attempts.
- JWT Authentication: Secure stateless authentication with automatic session expiration.
- Real-time Banking: Deposit, Withdraw, and Transfer funds instantly.
- Visual Analytics: Chart.js integration to visualize income/expense trends.
- Beneficiary Management: Save and manage frequent payees for one-click transfers.
- Transaction History: Filterable and searchable history (by date, type, or status).
- Profile Management: Update details and change passwords securely.
- System Overview: Real-time counters for total users and transaction volume.
- User Management: View all registered users and their account statuses.
- Audit Logs: Full visibility into all system transactions for compliance.
Frontend (Client)
- Framework: React (Vite)
- State Management: Redux Toolkit
- UI Component Library: Material UI (MUI)
- HTTP Client: Axios
- Visualization: Chart.js
Backend (Server)
- Runtime: Node.js & Express
- Database: MongoDB (Mongoose ODM)
- Email Services: Nodemailer (SMTP)
- Security: BCrypt (Hashing), JWT (Tokens), Custom Rate Limiter
โโโ bank-app/ # Frontend (React + Vite)
โ โโโ src/
โ โ โโโ Components/ # UI Components (Dashboards, Modals)
โ โ โโโ Redux/ # Global State Slices
โ โ โโโ ...
โโโ node/ # Backend (Express API)
โ โโโ Controllers/ # Business Logic (Transactions, Auth)
โ โโโ Models/ # Mongoose Schemas
โ โโโ Routes/ # API Endpoints
โ โโโ Middleware/ # Auth & Admin Verification
โ โโโ index.js # Server Entry Point
- Node.js (v16+)
- MongoDB (Local or Atlas Connection String)
Clone the repo: git clone https://github.com/SlinkyCollins/Bank-App.git
Navigate to the server directory and install dependencies:
cd node
npm install
Create a .env file in the node/ directory:
PORT=5000
URL=mongodb+srv://<your-mongo-url>
SECRET=your_jwt_secret_key
USER_EMAIL=your_email_for_alerts@gmail.com
USER_PASS=your_email_app_password
Start the server:
npm start
# Server runs on http://localhost:5000
Navigate to the client directory and install dependencies:
cd bank-app
npm install
Create a .env file in the bank-app/ directory:
VITE_API_BASE_URL=http://localhost:5000
Start the React development server:
npm run dev
# App runs on http://localhost:5173
| Method | Endpoint | Description | Access |
|---|---|---|---|
| Auth | |||
POST |
/api/auth/register |
Register a new user | Public |
POST |
/api/auth/login |
Login & receive JWT | Public |
| Transactions | |||
POST |
/api/transactions/deposit |
Add funds to account | User |
POST |
/api/transactions/transfer |
Transfer to another user | User |
GET |
/api/transactions/getTransactions |
Fetch user history | User |
| Admin | |||
GET |
/api/admin/users |
List all system users | Admin |
GET |
/api/admin/transactions |
View all platform transactions | Admin |
- Backend: Use Postman for API testing.
- Frontend: Manual testing in browser; add Jest/Cypress for unit/E2E tests later.
- Frontend: Build with
npm run build, deploy to Vercel/Netlify. - Backend: Deploy to Render/Heroku, connect to MongoDB Atlas.
- Fork the repo.
- Create a feature branch.
- Commit changes.
- Push and create PR.
- The Main Dashboard: Showing the Balance card and Chart.
- The Transfer Modal: Showing the input fields.
- The Admin Overview: Showing the User/Transaction counters.
Built by Collins as a Capstone Project for level 3 in SQI.