# abhimetre/bank-management-system architecture

> Architecture diagram of the GitHub repository abhimetre/bank-management-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abhimetre/bank-management-system
- Repository: https://github.com/abhimetre/bank-management-system

## Overview

This is a banking management application with a React frontend and an Express/Mongoose backend. Users register or log in, then manage accounts, transactions, cards, and loans; administrators review activity and approve cards or loans. The backend routes requests through authentication and domain controllers to data models, while transaction reporting can generate downloadable PDFs. The excerpts and source index establish the listed imports and routing, but do not show frontend-to-backend HTTP calls; that connection is therefore omitted.

Main entry points: [`Frontend/src/App.jsx`](https://github.com/abhimetre/bank-management-system/blob/main/Frontend/src/App.jsx) (Page router), [`Backend/server.js`](https://github.com/abhimetre/bank-management-system/blob/main/Backend/server.js) (HTTP server), [`Backend/middleware/authMiddleware.js`](https://github.com/abhimetre/bank-management-system/blob/main/Backend/middleware/authMiddleware.js) (Access control), [`Backend/controllers/adminController.js`](https://github.com/abhimetre/bank-management-system/blob/main/Backend/controllers/adminController.js) (Admin operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["Page router<br/>[App.jsx]"]
  node_login["Login and register<br/>[Login.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_accounts_ui["Accounts UI<br/>[Accounts.jsx]"]
  node_transactions_ui["Transactions UI<br/>[Transactions.jsx]"]
  node_cards_ui["Cards UI<br/>[Cards.jsx]"]
  node_loans_ui["Loans UI<br/>[Loans.jsx]"]
  node_admin_ui["Admin panel<br/>[AdminPanel.jsx]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_backend["API and access"]
  node_server["HTTP server<br/>[server.js]"]
  node_auth_routes["User routes<br/>[userRoutes.js]"]
  node_auth["Authentication<br/>[userController.js]"]
  node_guard["Access control<br/>[authMiddleware.js]"]
end

subgraph group_banking["Banking operations"]
  node_account_routes["Account routes<br/>[accountRoutes.js]"]
  node_account_ops["Account operations"]
  node_transaction_routes["Transaction routes"]
  node_transaction_ops["Transactions and reports"]
  node_pdf["PDF generation<br/>[pdfGenerator.js]"]
  node_card_routes["Card routes<br/>[cardRoutes.js]"]
  node_card_ops["Card operations<br/>[cardController.js]"]
  node_loan_routes["Loan routes<br/>[loanRoutes.js]"]
  node_loan_ops["Loan operations<br/>[loanController.js]"]
  node_admin_routes["Admin routes<br/>[adminRoutes.js]"]
  node_admin_ops["Admin operations<br/>[adminController.js]"]
end

subgraph group_data["Domain data"]
  node_user_model["User model<br/>[User.js]"]
  node_account_model["Account model<br/>[Account.js]"]
  node_transaction_model["Transaction model<br/>[Transaction.js]"]
  node_card_model["Card model<br/>[Card.js]"]
  node_loan_model["Loan model<br/>[Loan.js]"]
end

node_user(("Banking user"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_accounts_ui
node_app -->|"routes to"| node_transactions_ui
node_app -->|"routes to"| node_cards_ui
node_app -->|"routes to"| node_loans_ui
node_app -->|"routes to"| node_admin_ui
node_login -->|"requests through"| node_api_client
node_dashboard -->|"requests through"| node_api_client
node_accounts_ui -->|"requests through"| node_api_client
node_transactions_ui -->|"requests through"| node_api_client
node_cards_ui -->|"requests through"| node_api_client
node_loans_ui -->|"requests through"| node_api_client
node_admin_ui -->|"requests through"| node_api_client
node_server -->|"mounts"| node_auth_routes
node_server -->|"mounts"| node_account_routes
node_server -->|"mounts"| node_transaction_routes
node_server -->|"mounts"| node_card_routes
node_server -->|"mounts"| node_loan_routes
node_server -->|"mounts"| node_admin_routes
node_auth_routes -->|"dispatches"| node_auth
node_account_routes -->|"dispatches"| node_account_ops
node_transaction_routes -->|"dispatches"| node_transaction_ops
node_card_routes -->|"dispatches"| node_card_ops
node_loan_routes -->|"dispatches"| node_loan_ops
node_admin_routes -->|"dispatches"| node_admin_ops
node_auth_routes -->|"protects"| node_guard
node_account_routes -->|"protects"| node_guard
node_transaction_routes -->|"protects"| node_guard
node_card_routes -->|"protects"| node_guard
node_loan_routes -->|"protects"| node_guard
node_admin_routes -->|"protects"| node_guard
node_guard -->|"loads user"| node_user_model
node_auth -->|"uses"| node_user_model
node_account_ops -->|"uses"| node_account_model
node_transaction_ops -->|"reads and updates"| node_account_model
node_transaction_ops -->|"records and reads"| node_transaction_model
node_transaction_ops -->|"generates report"| node_pdf
node_card_ops -->|"uses"| node_card_model
node_card_ops -->|"checks ownership"| node_account_model
node_loan_ops -->|"uses"| node_loan_model
node_admin_ops -->|"queries"| node_user_model
node_admin_ops -->|"queries"| node_account_model
node_admin_ops -->|"aggregates"| node_transaction_model
node_admin_ops -->|"approves"| node_card_model
node_admin_ops -->|"approves"| node_loan_model

click node_app "https://github.com/abhimetre/bank-management-system/blob/main/Frontend/src/App.jsx"
click node_login "https://github.com/abhimetre/bank-management-system/blob/main/Frontend/src/pages/Login.jsx"
click node_dashboard "https://github.com/abhimetre/bank-management-system/blob/main/Frontend/src/pages/Dashboard.jsx"
click node_accounts_ui "https://github.com/abhimetre/bank-management-system/blob/main/Frontend/src/pages/Accounts.jsx"
click node_transactions_ui "https://github.com/abhimetre/bank-management-system/blob/main/Frontend/src/pages/Transactions.jsx"
click node_cards_ui "https://github.com/abhimetre/bank-management-system/blob/main/Frontend/src/pages/Cards.jsx"
click node_loans_ui "https://github.com/abhimetre/bank-management-system/blob/main/Frontend/src/pages/Loans.jsx"
click node_admin_ui "https://github.com/abhimetre/bank-management-system/blob/main/Frontend/src/pages/AdminPanel.jsx"
click node_api_client "https://github.com/abhimetre/bank-management-system/blob/main/Frontend/src/services/api.js"
click node_server "https://github.com/abhimetre/bank-management-system/blob/main/Backend/server.js"
click node_auth_routes "https://github.com/abhimetre/bank-management-system/blob/main/Backend/routes/userRoutes.js"
click node_auth "https://github.com/abhimetre/bank-management-system/blob/main/Backend/controllers/userController.js"
click node_guard "https://github.com/abhimetre/bank-management-system/blob/main/Backend/middleware/authMiddleware.js"
click node_account_routes "https://github.com/abhimetre/bank-management-system/blob/main/Backend/routes/accountRoutes.js"
click node_account_ops "https://github.com/abhimetre/bank-management-system/blob/main/Backend/controllers/accountController.js"
click node_transaction_routes "https://github.com/abhimetre/bank-management-system/blob/main/Backend/routes/transactionRoutes.js"
click node_transaction_ops "https://github.com/abhimetre/bank-management-system/blob/main/Backend/controllers/transactionController.js"
click node_pdf "https://github.com/abhimetre/bank-management-system/blob/main/Backend/utils/pdfGenerator.js"
click node_card_routes "https://github.com/abhimetre/bank-management-system/blob/main/Backend/routes/cardRoutes.js"
click node_card_ops "https://github.com/abhimetre/bank-management-system/blob/main/Backend/controllers/cardController.js"
click node_loan_routes "https://github.com/abhimetre/bank-management-system/blob/main/Backend/routes/loanRoutes.js"
click node_loan_ops "https://github.com/abhimetre/bank-management-system/blob/main/Backend/controllers/loanController.js"
click node_admin_routes "https://github.com/abhimetre/bank-management-system/blob/main/Backend/routes/adminRoutes.js"
click node_admin_ops "https://github.com/abhimetre/bank-management-system/blob/main/Backend/controllers/adminController.js"
click node_user_model "https://github.com/abhimetre/bank-management-system/blob/main/Backend/models/User.js"
click node_account_model "https://github.com/abhimetre/bank-management-system/blob/main/Backend/models/Account.js"
click node_transaction_model "https://github.com/abhimetre/bank-management-system/blob/main/Backend/models/Transaction.js"
click node_card_model "https://github.com/abhimetre/bank-management-system/blob/main/Backend/models/Card.js"
click node_loan_model "https://github.com/abhimetre/bank-management-system/blob/main/Backend/models/Loan.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_login,node_dashboard,node_accounts_ui,node_transactions_ui,node_cards_ui,node_loans_ui,node_admin_ui,node_api_client,node_user toneBlue
class node_server,node_auth_routes,node_auth,node_guard toneAmber
class node_account_routes,node_account_ops,node_transaction_routes,node_transaction_ops,node_pdf,node_card_routes,node_card_ops,node_loan_routes,node_loan_ops,node_admin_routes,node_admin_ops toneMint
class node_user_model,node_account_model,node_transaction_model,node_card_model,node_loan_model toneRose
```

## Components

### Web application

- [Page router](https://github.com/abhimetre/bank-management-system/blob/main/Frontend/src/App.jsx): `Frontend/src/App.jsx`
- [Login and register](https://github.com/abhimetre/bank-management-system/blob/main/Frontend/src/pages/Login.jsx): `Frontend/src/pages/Login.jsx`
- [Dashboard](https://github.com/abhimetre/bank-management-system/blob/main/Frontend/src/pages/Dashboard.jsx): `Frontend/src/pages/Dashboard.jsx`
- [Accounts UI](https://github.com/abhimetre/bank-management-system/blob/main/Frontend/src/pages/Accounts.jsx): `Frontend/src/pages/Accounts.jsx`
- [Transactions UI](https://github.com/abhimetre/bank-management-system/blob/main/Frontend/src/pages/Transactions.jsx): `Frontend/src/pages/Transactions.jsx`
- [Cards UI](https://github.com/abhimetre/bank-management-system/blob/main/Frontend/src/pages/Cards.jsx): `Frontend/src/pages/Cards.jsx`
- [Loans UI](https://github.com/abhimetre/bank-management-system/blob/main/Frontend/src/pages/Loans.jsx): `Frontend/src/pages/Loans.jsx`
- [Admin panel](https://github.com/abhimetre/bank-management-system/blob/main/Frontend/src/pages/AdminPanel.jsx): `Frontend/src/pages/AdminPanel.jsx`
- [API client](https://github.com/abhimetre/bank-management-system/blob/main/Frontend/src/services/api.js): `Frontend/src/services/api.js`

### API and access

- [HTTP server](https://github.com/abhimetre/bank-management-system/blob/main/Backend/server.js): `Backend/server.js`
- [User routes](https://github.com/abhimetre/bank-management-system/blob/main/Backend/routes/userRoutes.js): `Backend/routes/userRoutes.js`
- [Authentication](https://github.com/abhimetre/bank-management-system/blob/main/Backend/controllers/userController.js): `Backend/controllers/userController.js`
- [Access control](https://github.com/abhimetre/bank-management-system/blob/main/Backend/middleware/authMiddleware.js): `Backend/middleware/authMiddleware.js`

### Banking operations

- [Account routes](https://github.com/abhimetre/bank-management-system/blob/main/Backend/routes/accountRoutes.js): `Backend/routes/accountRoutes.js`
- [Account operations](https://github.com/abhimetre/bank-management-system/blob/main/Backend/controllers/accountController.js): `Backend/controllers/accountController.js`
- [Transaction routes](https://github.com/abhimetre/bank-management-system/blob/main/Backend/routes/transactionRoutes.js): `Backend/routes/transactionRoutes.js`
- [Transactions and reports](https://github.com/abhimetre/bank-management-system/blob/main/Backend/controllers/transactionController.js): `Backend/controllers/transactionController.js`
- [PDF generation](https://github.com/abhimetre/bank-management-system/blob/main/Backend/utils/pdfGenerator.js): `Backend/utils/pdfGenerator.js`
- [Card routes](https://github.com/abhimetre/bank-management-system/blob/main/Backend/routes/cardRoutes.js): `Backend/routes/cardRoutes.js`
- [Card operations](https://github.com/abhimetre/bank-management-system/blob/main/Backend/controllers/cardController.js): `Backend/controllers/cardController.js`
- [Loan routes](https://github.com/abhimetre/bank-management-system/blob/main/Backend/routes/loanRoutes.js): `Backend/routes/loanRoutes.js`
- [Loan operations](https://github.com/abhimetre/bank-management-system/blob/main/Backend/controllers/loanController.js): `Backend/controllers/loanController.js`
- [Admin routes](https://github.com/abhimetre/bank-management-system/blob/main/Backend/routes/adminRoutes.js): `Backend/routes/adminRoutes.js`
- [Admin operations](https://github.com/abhimetre/bank-management-system/blob/main/Backend/controllers/adminController.js): `Backend/controllers/adminController.js`

### Domain data

- [User model](https://github.com/abhimetre/bank-management-system/blob/main/Backend/models/User.js): `Backend/models/User.js`
- [Account model](https://github.com/abhimetre/bank-management-system/blob/main/Backend/models/Account.js): `Backend/models/Account.js`
- [Transaction model](https://github.com/abhimetre/bank-management-system/blob/main/Backend/models/Transaction.js): `Backend/models/Transaction.js`
- [Card model](https://github.com/abhimetre/bank-management-system/blob/main/Backend/models/Card.js): `Backend/models/Card.js`
- [Loan model](https://github.com/abhimetre/bank-management-system/blob/main/Backend/models/Loan.js): `Backend/models/Loan.js`

### Other components

- **Banking user**

## Connections

- Banking user → Page router: uses (evidence: `Frontend/src/App.jsx`)
- Page router → Login and register: routes to (evidence: `Frontend/src/App.jsx`)
- Page router → Dashboard: routes to (evidence: `Frontend/src/App.jsx`)
- Page router → Accounts UI: routes to (evidence: `Frontend/src/App.jsx`)
- Page router → Transactions UI: routes to (evidence: `Frontend/src/App.jsx`)
- Page router → Cards UI: routes to (evidence: `Frontend/src/App.jsx`)
- Page router → Loans UI: routes to (evidence: `Frontend/src/App.jsx`)
- Page router → Admin panel: routes to (evidence: `Frontend/src/App.jsx`)
- Login and register → API client: requests through (evidence: `Frontend/src/pages/Login.jsx`)
- Dashboard → API client: requests through (evidence: `Frontend/src/pages/Dashboard.jsx`)
- Accounts UI → API client: requests through (evidence: `Frontend/src/pages/Accounts.jsx`)
- Transactions UI → API client: requests through (evidence: `Frontend/src/pages/Transactions.jsx`)
- Cards UI → API client: requests through (evidence: `Frontend/src/pages/Cards.jsx`)
- Loans UI → API client: requests through (evidence: `Frontend/src/pages/Loans.jsx`)
- Admin panel → API client: requests through (evidence: `Frontend/src/pages/AdminPanel.jsx`)
- HTTP server → User routes: mounts (evidence: `Backend/server.js`)
- HTTP server → Account routes: mounts (evidence: `Backend/server.js`)
- HTTP server → Transaction routes: mounts (evidence: `Backend/server.js`)
- HTTP server → Card routes: mounts (evidence: `Backend/server.js`)
- HTTP server → Loan routes: mounts (evidence: `Backend/server.js`)
- HTTP server → Admin routes: mounts (evidence: `Backend/server.js`)
- User routes → Authentication: dispatches (evidence: `Backend/routes/userRoutes.js`)
- Account routes → Account operations: dispatches (evidence: `Backend/routes/accountRoutes.js`)
- Transaction routes → Transactions and reports: dispatches (evidence: `Backend/routes/transactionRoutes.js`)
- Card routes → Card operations: dispatches (evidence: `Backend/routes/cardRoutes.js`)
- Loan routes → Loan operations: dispatches (evidence: `Backend/routes/loanRoutes.js`)
- Admin routes → Admin operations: dispatches (evidence: `Backend/routes/adminRoutes.js`)
- User routes → Access control: protects (evidence: `Backend/routes/userRoutes.js`)
- Account routes → Access control: protects (evidence: `Backend/routes/accountRoutes.js`)
- Transaction routes → Access control: protects (evidence: `Backend/routes/transactionRoutes.js`)
- Card routes → Access control: protects (evidence: `Backend/routes/cardRoutes.js`)
- Loan routes → Access control: protects (evidence: `Backend/routes/loanRoutes.js`)
- Admin routes → Access control: protects (evidence: `Backend/routes/adminRoutes.js`)
- Access control → User model: loads user (evidence: `Backend/middleware/authMiddleware.js`)
- Authentication → User model: uses (evidence: `Backend/controllers/userController.js`)
- Account operations → Account model: uses (evidence: `Backend/controllers/accountController.js`)
- Transactions and reports → Account model: reads and updates (evidence: `Backend/controllers/transactionController.js`)
- Transactions and reports → Transaction model: records and reads (evidence: `Backend/controllers/transactionController.js`)
- Transactions and reports → PDF generation: generates report (evidence: `Backend/controllers/transactionController.js`)
- Card operations → Card model: uses (evidence: `Backend/controllers/cardController.js`)
- Card operations → Account model: checks ownership (evidence: `Backend/controllers/cardController.js`)
- Loan operations → Loan model: uses (evidence: `Backend/controllers/loanController.js`)
- Admin operations → User model: queries (evidence: `Backend/controllers/adminController.js`)
- Admin operations → Account model: queries (evidence: `Backend/controllers/adminController.js`)
- Admin operations → Transaction model: aggregates (evidence: `Backend/controllers/adminController.js`)
- Admin operations → Card model: approves (evidence: `Backend/controllers/adminController.js`)
- Admin operations → Loan model: approves (evidence: `Backend/controllers/adminController.js`)
