# vaishusatpute/spx-banking-application architecture

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

- Interactive diagram: https://gitdiagram.com/vaishusatpute/spx-banking-application
- Repository: https://github.com/vaishusatpute/spx-banking-application

## Overview

SPX is a banking portal backed by feature-isolated Flask APIs, routed through an NGINX gateway to MySQL. The main customer journey is registration OTP verification, account creation, login OTP verification, then authenticated account and banking operations such as transfers and statements; separate feature APIs cover loans, cards, investments, insurance, customer services, and administration. The graph reflects documented deployment/routing and sampled API behavior. Some feature implementations and gateway routing details were not sampled, so those relationships are documented or left unverified rather than inferred from imports.

Main entry points: [`gateway/default.conf`](https://github.com/vaishusatpute/spx-banking-application/blob/main/gateway/default.conf) (NGINX gateway), [`database/schema.sql`](https://github.com/vaishusatpute/spx-banking-application/blob/main/database/schema.sql) (MySQL), [`services/spx/features/registration.py`](https://github.com/vaishusatpute/spx-banking-application/blob/main/services/spx/features/registration.py) (Registration), [`services/spx/features/auth.py`](https://github.com/vaishusatpute/spx-banking-application/blob/main/services/spx/features/auth.py) (Login and OTP)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portal["Browser portal"]
  node_portalui["SPX portal<br/>[app.js]"]
end

subgraph group_edge["API gateway"]
  node_gateway["NGINX gateway<br/>[default.conf]"]
end

subgraph group_identity["Identity features"]
  node_registration["Registration<br/>[registration.py]"]
  node_auth["Login and OTP<br/>[auth.py]"]
  node_common["Identity helpers<br/>[common.py]"]
end

subgraph group_banking["Banking features"]
  node_accounts["Accounts and profile<br/>[accounts.py]"]
  node_payments["Transfers<br/>[payments.py]"]
  node_statements["Statements<br/>[statements.py]"]
  node_loans["Loans<br/>[loans.py]"]
  node_cards["Cards<br/>[cards.py]"]
  node_investments["Investments<br/>[investments.py]"]
  node_insurance["Insurance<br/>[insurance.py]"]
  node_services["Customer services<br/>[services.py]"]
end

subgraph group_operations["Operations and data"]
  node_admin["Administration<br/>[admin.py]"]
  node_mysql[("MySQL<br/>[schema.sql]")]
end

node_customer(("Customer"))
node_smtp["SMTP mail"]

node_customer -->|"uses"| node_portalui
node_portalui -->|"calls APIs"| node_gateway
node_gateway -->|"routes"| node_registration
node_gateway -->|"routes"| node_auth
node_gateway -->|"routes"| node_accounts
node_gateway -->|"routes"| node_payments
node_gateway -->|"routes"| node_statements
node_gateway -->|"routes"| node_loans
node_gateway -->|"routes"| node_cards
node_gateway -->|"routes"| node_investments
node_gateway -->|"routes"| node_insurance
node_gateway -->|"routes"| node_services
node_gateway -->|"routes"| node_admin
node_registration -->|"uses OTP"| node_common
node_auth -->|"uses OTP"| node_common
node_registration -->|"creates accounts"| node_mysql
node_registration -->|"sends OTP"| node_smtp
node_auth -->|"reads users"| node_mysql
node_auth -->|"sends OTP"| node_smtp
node_accounts -->|"reads and updates"| node_mysql
node_payments -->|"updates balances"| node_mysql
node_statements -->|"queries transactions"| node_mysql
node_cards -->|"stores card data"| node_mysql
node_investments -->|"stores holdings"| node_mysql
node_admin -->|"queries banking data"| node_mysql
node_loans -.->|"uses banking data"| node_mysql
node_insurance -.->|"uses banking data"| node_mysql
node_services -.->|"stores requests"| node_mysql

click node_portalui "https://github.com/vaishusatpute/spx-banking-application/blob/main/gateway/public/app.js"
click node_gateway "https://github.com/vaishusatpute/spx-banking-application/blob/main/gateway/default.conf"
click node_registration "https://github.com/vaishusatpute/spx-banking-application/blob/main/services/spx/features/registration.py"
click node_auth "https://github.com/vaishusatpute/spx-banking-application/blob/main/services/spx/features/auth.py"
click node_common "https://github.com/vaishusatpute/spx-banking-application/blob/main/services/spx/common.py"
click node_accounts "https://github.com/vaishusatpute/spx-banking-application/blob/main/services/spx/features/accounts.py"
click node_payments "https://github.com/vaishusatpute/spx-banking-application/blob/main/services/spx/features/payments.py"
click node_statements "https://github.com/vaishusatpute/spx-banking-application/blob/main/services/spx/features/statements.py"
click node_loans "https://github.com/vaishusatpute/spx-banking-application/blob/main/services/spx/features/loans.py"
click node_cards "https://github.com/vaishusatpute/spx-banking-application/blob/main/services/spx/features/cards.py"
click node_investments "https://github.com/vaishusatpute/spx-banking-application/blob/main/services/spx/features/investments.py"
click node_insurance "https://github.com/vaishusatpute/spx-banking-application/blob/main/services/spx/features/insurance.py"
click node_services "https://github.com/vaishusatpute/spx-banking-application/blob/main/services/spx/features/services.py"
click node_admin "https://github.com/vaishusatpute/spx-banking-application/blob/main/services/spx/features/admin.py"
click node_mysql "https://github.com/vaishusatpute/spx-banking-application/blob/main/database/schema.sql"

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_portalui toneBlue
class node_gateway toneAmber
class node_registration,node_auth,node_common toneMint
class node_accounts,node_payments,node_statements,node_loans,node_cards,node_investments,node_insurance,node_services toneRose
class node_admin,node_mysql,node_customer,node_smtp toneIndigo
```

## Components

### Browser portal

- [SPX portal](https://github.com/vaishusatpute/spx-banking-application/blob/main/gateway/public/app.js): `gateway/public/app.js`

### API gateway

- [NGINX gateway](https://github.com/vaishusatpute/spx-banking-application/blob/main/gateway/default.conf): `gateway/default.conf`

### Identity features

- [Registration](https://github.com/vaishusatpute/spx-banking-application/blob/main/services/spx/features/registration.py): `services/spx/features/registration.py`
- [Login and OTP](https://github.com/vaishusatpute/spx-banking-application/blob/main/services/spx/features/auth.py): `services/spx/features/auth.py`
- [Identity helpers](https://github.com/vaishusatpute/spx-banking-application/blob/main/services/spx/common.py): `services/spx/common.py`

### Banking features

- [Accounts and profile](https://github.com/vaishusatpute/spx-banking-application/blob/main/services/spx/features/accounts.py): `services/spx/features/accounts.py`
- [Transfers](https://github.com/vaishusatpute/spx-banking-application/blob/main/services/spx/features/payments.py): `services/spx/features/payments.py`
- [Statements](https://github.com/vaishusatpute/spx-banking-application/blob/main/services/spx/features/statements.py): `services/spx/features/statements.py`
- [Loans](https://github.com/vaishusatpute/spx-banking-application/blob/main/services/spx/features/loans.py): `services/spx/features/loans.py`
- [Cards](https://github.com/vaishusatpute/spx-banking-application/blob/main/services/spx/features/cards.py): `services/spx/features/cards.py`
- [Investments](https://github.com/vaishusatpute/spx-banking-application/blob/main/services/spx/features/investments.py): `services/spx/features/investments.py`
- [Insurance](https://github.com/vaishusatpute/spx-banking-application/blob/main/services/spx/features/insurance.py): `services/spx/features/insurance.py`
- [Customer services](https://github.com/vaishusatpute/spx-banking-application/blob/main/services/spx/features/services.py): `services/spx/features/services.py`

### Operations and data

- [Administration](https://github.com/vaishusatpute/spx-banking-application/blob/main/services/spx/features/admin.py): `services/spx/features/admin.py`
- [MySQL](https://github.com/vaishusatpute/spx-banking-application/blob/main/database/schema.sql): `database/schema.sql`

### Other components

- **Customer**
- **SMTP mail**

## Connections

- Customer → SPX portal: uses (evidence: `README.md`)
- SPX portal → NGINX gateway: calls APIs (evidence: `README.md`)
- NGINX gateway → Registration: routes (evidence: `README.md`)
- NGINX gateway → Login and OTP: routes (evidence: `README.md`)
- NGINX gateway → Accounts and profile: routes (evidence: `README.md`)
- NGINX gateway → Transfers: routes (evidence: `README.md`)
- NGINX gateway → Statements: routes (evidence: `README.md`)
- NGINX gateway → Loans: routes (evidence: `README.md`)
- NGINX gateway → Cards: routes (evidence: `README.md`)
- NGINX gateway → Investments: routes (evidence: `README.md`)
- NGINX gateway → Insurance: routes (evidence: `README.md`)
- NGINX gateway → Customer services: routes (evidence: `README.md`)
- NGINX gateway → Administration: routes (evidence: `README.md`)
- Registration → Identity helpers: uses OTP (evidence: `services/spx/features/registration.py`)
- Login and OTP → Identity helpers: uses OTP (evidence: `services/spx/features/auth.py`)
- Registration → MySQL: creates accounts (evidence: `services/spx/features/registration.py`)
- Registration → SMTP mail: sends OTP
- Login and OTP → MySQL: reads users (evidence: `services/spx/features/auth.py`)
- Login and OTP → SMTP mail: sends OTP
- Accounts and profile → MySQL: reads and updates (evidence: `services/spx/features/accounts.py`)
- Transfers → MySQL: updates balances (evidence: `services/spx/features/payments.py`)
- Statements → MySQL: queries transactions (evidence: `services/spx/features/statements.py`)
- Cards → MySQL: stores card data (evidence: `services/spx/features/cards.py`)
- Investments → MySQL: stores holdings (evidence: `services/spx/features/investments.py`)
- Administration → MySQL: queries banking data (evidence: `services/spx/features/admin.py`)
- Loans → MySQL: uses banking data (evidence: `README.md`)
- Insurance → MySQL: uses banking data (evidence: `README.md`)
- Customer services → MySQL: stores requests (evidence: `README.md`)
