# jtr-0901/banking-system-fullstack architecture

> Architecture diagram of the GitHub repository jtr-0901/banking-system-fullstack, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jtr-0901/banking-system-fullstack
- Repository: https://github.com/jtr-0901/banking-system-fullstack

## Overview

Banking System is a React banking application backed by an Express REST API and PostgreSQL. Users register or sign in, complete two-factor authentication, then manage accounts, review balances and transaction history, and initiate transfers, external payments, or scheduled bills. The backend routes delegate domain operations to models, which persist banking data; account identifiers and IBANs are encrypted and hashed. A separate CLI supports database and user/account/transaction operations. Some links reflect README or source-index references rather than inspected call sites, so those are labeled accordingly.

Main entry points: [`frontend/src/App.js`](https://github.com/jtr-0901/banking-system-fullstack/blob/main/frontend/src/App.js) (Application routes), [`backend/server.js`](https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/server.js) (Express server), [`frontend/src/lib/apiClient.js`](https://github.com/jtr-0901/banking-system-fullstack/blob/main/frontend/src/lib/apiClient.js) (HTTP API client), [`backend/routes/transactions.js`](https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/routes/transactions.js) (Transaction routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_app["Application routes<br/>[App.js]"]
  node_auth_context["Session and auth state<br/>[AuthContext.js]"]
  node_auth_views["Login and registration<br/>[Login.js]"]
  node_two_factor_view["Two-factor challenge"]
  node_dashboard["Dashboard<br/>[Dashboard.js]"]
  node_accounts_view["Account management<br/>[Accounts.js]"]
  node_transactions_view["Transaction history<br/>[Transactions.js]"]
  node_transaction_form["Transaction form<br/>[TransactionForm.js]"]
  node_payments_view["External payments<br/>[Payments.js]"]
  node_bills_view["Scheduled bills<br/>[Bills.js]"]
  node_api_client["HTTP API client<br/>[apiClient.js]"]
end

subgraph group_api["API and routing"]
  node_server["Express server<br/>[server.js]"]
  node_validation["Request validation<br/>[validation.js]"]
end

subgraph group_identity["Identity and security"]
  node_auth_routes["Authentication routes<br/>[auth.js]"]
  node_auth_middleware["Token authentication<br/>[auth.js]"]
  node_user_model["User records<br/>[User.js]"]
  node_account_numbers["Account and IBAN protection<br/>[accountNumbers.js]"]
end

subgraph group_banking["Banking domain"]
  node_account_routes["Account routes<br/>[accounts.js]"]
  node_transaction_routes["Transaction routes<br/>[transactions.js]"]
  node_portal_routes["Payment portal<br/>[paymentPortal.js]"]
  node_scheduled_routes["Scheduled payment routes"]
  node_account_model["Account operations<br/>[Account.js]"]
  node_transaction_model["Transaction operations<br/>[Transaction.js]"]
  node_scheduled_model["Scheduled payment records"]
end

subgraph group_storage["Persistence and operations"]
  node_database[("PostgreSQL access<br/>[database.js]")]
  node_migrations["Schema migrations<br/>[migrations.js]"]
  node_cli["Banking CLI<br/>[cli.js]"]
end

node_customer(("Bank customer"))
node_third_party(("Payment partner"))

node_customer -->|"uses"| node_app
node_app -->|"provides auth"| node_auth_context
node_app -->|"routes to"| node_auth_views
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_accounts_view
node_app -->|"routes to"| node_transactions_view
node_app -->|"routes to"| node_transaction_form
node_app -->|"routes to"| node_payments_view
node_app -->|"routes to"| node_bills_view
node_auth_views -->|"renders challenge"| node_two_factor_view
node_auth_context -->|"calls"| node_api_client
node_dashboard -->|"requests data"| node_api_client
node_accounts_view -->|"requests data"| node_api_client
node_transactions_view -->|"requests data"| node_api_client
node_transaction_form -->|"submits transactions"| node_api_client
node_payments_view -->|"requests payments"| node_api_client
node_bills_view -->|"requests bills"| node_api_client
node_api_client -->|"calls API"| node_server
node_server -->|"mounts"| node_auth_routes
node_server -->|"mounts"| node_account_routes
node_server -->|"mounts"| node_transaction_routes
node_server -->|"mounts"| node_scheduled_routes
node_server -->|"mounts"| node_portal_routes
node_server -->|"connects"| node_database
node_server -->|"creates schema"| node_migrations
node_auth_routes -->|"uses"| node_user_model
node_auth_routes -->|"uses"| node_auth_middleware
node_auth_routes -->|"validates requests"| node_validation
node_auth_routes -->|"authenticates"| node_customer
node_account_routes -->|"guards routes"| node_auth_middleware
node_account_routes -->|"validates requests"| node_validation
node_account_routes -->|"uses"| node_account_model
node_account_routes -->|"uses"| node_transaction_model
node_transaction_routes -->|"guards routes"| node_auth_middleware
node_transaction_routes -->|"validates requests"| node_validation
node_transaction_routes -->|"uses"| node_account_model
node_transaction_routes -->|"uses"| node_transaction_model
node_third_party -->|"sends incoming payment"| node_transaction_routes
node_portal_routes -->|"uses"| node_account_model
node_portal_routes -->|"uses"| node_transaction_model
node_scheduled_routes -->|"guards routes"| node_auth_middleware
node_scheduled_routes -->|"validates requests"| node_validation
node_scheduled_routes -->|"uses"| node_account_model
node_scheduled_routes -->|"uses"| node_scheduled_model
node_account_model -->|"queries"| node_database
node_transaction_model -->|"queries"| node_database
node_user_model -->|"queries"| node_database
node_account_model -->|"protects identifiers"| node_account_numbers

click node_app "https://github.com/jtr-0901/banking-system-fullstack/blob/main/frontend/src/App.js"
click node_auth_context "https://github.com/jtr-0901/banking-system-fullstack/blob/main/frontend/src/context/AuthContext.js"
click node_auth_views "https://github.com/jtr-0901/banking-system-fullstack/blob/main/frontend/src/components/Auth/Login.js"
click node_two_factor_view "https://github.com/jtr-0901/banking-system-fullstack/blob/main/frontend/src/components/Auth/TwoFactorChallenge.js"
click node_dashboard "https://github.com/jtr-0901/banking-system-fullstack/blob/main/frontend/src/components/Dashboard/Dashboard.js"
click node_accounts_view "https://github.com/jtr-0901/banking-system-fullstack/blob/main/frontend/src/components/Accounts/Accounts.js"
click node_transactions_view "https://github.com/jtr-0901/banking-system-fullstack/blob/main/frontend/src/components/Transactions/Transactions.js"
click node_transaction_form "https://github.com/jtr-0901/banking-system-fullstack/blob/main/frontend/src/components/Transactions/TransactionForm.js"
click node_payments_view "https://github.com/jtr-0901/banking-system-fullstack/blob/main/frontend/src/components/Payments/Payments.js"
click node_bills_view "https://github.com/jtr-0901/banking-system-fullstack/blob/main/frontend/src/components/Bills/Bills.js"
click node_api_client "https://github.com/jtr-0901/banking-system-fullstack/blob/main/frontend/src/lib/apiClient.js"
click node_server "https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/server.js"
click node_auth_routes "https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/routes/auth.js"
click node_auth_middleware "https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/middleware/auth.js"
click node_validation "https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/middleware/validation.js"
click node_account_routes "https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/routes/accounts.js"
click node_transaction_routes "https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/routes/transactions.js"
click node_portal_routes "https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/routes/paymentPortal.js"
click node_scheduled_routes "https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/routes/scheduledPayments.js"
click node_account_model "https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/models/Account.js"
click node_transaction_model "https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/models/Transaction.js"
click node_scheduled_model "https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/models/ScheduledPayment.js"
click node_user_model "https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/models/User.js"
click node_account_numbers "https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/utils/accountNumbers.js"
click node_database "https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/config/database.js"
click node_migrations "https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/database/migrations.js"
click node_cli "https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/cli.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_auth_context,node_auth_views,node_two_factor_view,node_dashboard,node_accounts_view,node_transactions_view,node_transaction_form,node_payments_view,node_bills_view,node_api_client toneBlue
class node_server,node_validation toneAmber
class node_auth_routes,node_auth_middleware,node_user_model,node_account_numbers toneMint
class node_account_routes,node_transaction_routes,node_portal_routes,node_scheduled_routes,node_account_model,node_transaction_model,node_scheduled_model toneRose
class node_database,node_migrations,node_cli,node_customer,node_third_party toneIndigo
```

## Components

### React client

- [Application routes](https://github.com/jtr-0901/banking-system-fullstack/blob/main/frontend/src/App.js): `frontend/src/App.js`
- [Session and auth state](https://github.com/jtr-0901/banking-system-fullstack/blob/main/frontend/src/context/AuthContext.js): `frontend/src/context/AuthContext.js`
- [Login and registration](https://github.com/jtr-0901/banking-system-fullstack/blob/main/frontend/src/components/Auth/Login.js): `frontend/src/components/Auth/Login.js`
- [Two-factor challenge](https://github.com/jtr-0901/banking-system-fullstack/blob/main/frontend/src/components/Auth/TwoFactorChallenge.js): `frontend/src/components/Auth/TwoFactorChallenge.js`
- [Dashboard](https://github.com/jtr-0901/banking-system-fullstack/blob/main/frontend/src/components/Dashboard/Dashboard.js): `frontend/src/components/Dashboard/Dashboard.js`
- [Account management](https://github.com/jtr-0901/banking-system-fullstack/blob/main/frontend/src/components/Accounts/Accounts.js): `frontend/src/components/Accounts/Accounts.js`
- [Transaction history](https://github.com/jtr-0901/banking-system-fullstack/blob/main/frontend/src/components/Transactions/Transactions.js): `frontend/src/components/Transactions/Transactions.js`
- [Transaction form](https://github.com/jtr-0901/banking-system-fullstack/blob/main/frontend/src/components/Transactions/TransactionForm.js): `frontend/src/components/Transactions/TransactionForm.js`
- [External payments](https://github.com/jtr-0901/banking-system-fullstack/blob/main/frontend/src/components/Payments/Payments.js): `frontend/src/components/Payments/Payments.js`
- [Scheduled bills](https://github.com/jtr-0901/banking-system-fullstack/blob/main/frontend/src/components/Bills/Bills.js): `frontend/src/components/Bills/Bills.js`
- [HTTP API client](https://github.com/jtr-0901/banking-system-fullstack/blob/main/frontend/src/lib/apiClient.js): `frontend/src/lib/apiClient.js`

### API and routing

- [Express server](https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/server.js): `backend/server.js`
- [Request validation](https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/middleware/validation.js): `backend/middleware/validation.js`

### Identity and security

- [Authentication routes](https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/routes/auth.js): `backend/routes/auth.js`
- [Token authentication](https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/middleware/auth.js): `backend/middleware/auth.js`
- [User records](https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/models/User.js): `backend/models/User.js`
- [Account and IBAN protection](https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/utils/accountNumbers.js): `backend/utils/accountNumbers.js`

### Banking domain

- [Account routes](https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/routes/accounts.js): `backend/routes/accounts.js`
- [Transaction routes](https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/routes/transactions.js): `backend/routes/transactions.js`
- [Payment portal](https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/routes/paymentPortal.js): `backend/routes/paymentPortal.js`
- [Scheduled payment routes](https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/routes/scheduledPayments.js): `backend/routes/scheduledPayments.js`
- [Account operations](https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/models/Account.js): `backend/models/Account.js`
- [Transaction operations](https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/models/Transaction.js): `backend/models/Transaction.js`
- [Scheduled payment records](https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/models/ScheduledPayment.js): `backend/models/ScheduledPayment.js`

### Persistence and operations

- [PostgreSQL access](https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/config/database.js): `backend/config/database.js`
- [Schema migrations](https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/database/migrations.js): `backend/database/migrations.js`
- [Banking CLI](https://github.com/jtr-0901/banking-system-fullstack/blob/main/backend/cli.js): `backend/cli.js`

### Other components

- **Bank customer**
- **Payment partner**

## Connections

- Bank customer → Application routes: uses (evidence: `README.md`)
- Application routes → Session and auth state: provides auth (evidence: `frontend/src/App.js`)
- Application routes → Login and registration: routes to (evidence: `frontend/src/App.js`)
- Application routes → Dashboard: routes to (evidence: `frontend/src/App.js`)
- Application routes → Account management: routes to (evidence: `frontend/src/App.js`)
- Application routes → Transaction history: routes to (evidence: `frontend/src/App.js`)
- Application routes → Transaction form: routes to (evidence: `frontend/src/App.js`)
- Application routes → External payments: routes to (evidence: `frontend/src/App.js`)
- Application routes → Scheduled bills: routes to (evidence: `frontend/src/App.js`)
- Login and registration → Two-factor challenge: renders challenge (evidence: `frontend/src/components/Auth/Login.js`)
- Session and auth state → HTTP API client: calls (evidence: `frontend/src/context/AuthContext.js`)
- Dashboard → HTTP API client: requests data (evidence: `frontend/src/components/Dashboard/Dashboard.js`)
- Account management → HTTP API client: requests data (evidence: `frontend/src/components/Accounts/Accounts.js`)
- Transaction history → HTTP API client: requests data (evidence: `frontend/src/components/Transactions/Transactions.js`)
- Transaction form → HTTP API client: submits transactions (evidence: `frontend/src/components/Transactions/TransactionForm.js`)
- External payments → HTTP API client: requests payments (evidence: `frontend/src/components/Payments/Payments.js`)
- Scheduled bills → HTTP API client: requests bills (evidence: `frontend/src/components/Bills/Bills.js`)
- HTTP API client → Express server: calls API (evidence: `README.md`)
- Express server → Authentication routes: mounts (evidence: `backend/server.js`)
- Express server → Account routes: mounts (evidence: `backend/server.js`)
- Express server → Transaction routes: mounts (evidence: `backend/server.js`)
- Express server → Scheduled payment routes: mounts (evidence: `backend/server.js`)
- Express server → Payment portal: mounts (evidence: `backend/server.js`)
- Express server → PostgreSQL access: connects (evidence: `backend/server.js`)
- Express server → Schema migrations: creates schema (evidence: `backend/server.js`)
- Authentication routes → User records: uses (evidence: `backend/routes/auth.js`)
- Authentication routes → Token authentication: uses (evidence: `backend/routes/auth.js`)
- Authentication routes → Request validation: validates requests (evidence: `backend/routes/auth.js`)
- Authentication routes → Bank customer: authenticates (evidence: `README.md`)
- Account routes → Token authentication: guards routes (evidence: `backend/routes/accounts.js`)
- Account routes → Request validation: validates requests (evidence: `backend/routes/accounts.js`)
- Account routes → Account operations: uses (evidence: `backend/routes/accounts.js`)
- Account routes → Transaction operations: uses (evidence: `backend/routes/accounts.js`)
- Transaction routes → Token authentication: guards routes (evidence: `backend/routes/transactions.js`)
- Transaction routes → Request validation: validates requests (evidence: `backend/routes/transactions.js`)
- Transaction routes → Account operations: uses (evidence: `backend/routes/transactions.js`)
- Transaction routes → Transaction operations: uses (evidence: `backend/routes/transactions.js`)
- Payment partner → Transaction routes: sends incoming payment (evidence: `README.md`)
- Payment portal → Account operations: uses (evidence: `backend/routes/paymentPortal.js`)
- Payment portal → Transaction operations: uses (evidence: `backend/routes/paymentPortal.js`)
- Scheduled payment routes → Token authentication: guards routes (evidence: `backend/routes/scheduledPayments.js`)
- Scheduled payment routes → Request validation: validates requests (evidence: `backend/routes/scheduledPayments.js`)
- Scheduled payment routes → Account operations: uses (evidence: `backend/routes/scheduledPayments.js`)
- Scheduled payment routes → Scheduled payment records: uses (evidence: `backend/routes/scheduledPayments.js`)
- Account operations → PostgreSQL access: queries (evidence: `backend/models/Account.js`)
- Transaction operations → PostgreSQL access: queries (evidence: `backend/models/Transaction.js`)
- User records → PostgreSQL access: queries (evidence: `backend/models/User.js`)
- Account operations → Account and IBAN protection: protects identifiers (evidence: `backend/models/Account.js`)
