# revaldo007/finance-customer-mg architecture

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

- Interactive diagram: https://gitdiagram.com/revaldo007/finance-customer-mg
- Repository: https://github.com/revaldo007/finance-customer-mg

## Overview

This is an admin-facing finance and customer management app. The workflow runs from login and protected navigation to customer records, finance-account creation and monitoring, repayment recording, and dashboard/reporting views. FastAPI routers own API actions; shared models, schemas, and finance logic support those stages, with SQLite as the persistent store. The README documents analytics and reporting capabilities not fully sampled; their router paths are retained. Frontend page-to-API edges are supported by the SOURCE INDEX; unsampled details are not inferred.

Main entry points: [`backend/app/main.py`](https://github.com/revaldo007/finance-customer-mg/blob/main/backend/app/main.py) (FastAPI app), [`frontend/src/App.jsx`](https://github.com/revaldo007/finance-customer-mg/blob/main/frontend/src/App.jsx) (Routes and layout), [`frontend/src/api/client.js`](https://github.com/revaldo007/finance-customer-mg/blob/main/frontend/src/api/client.js) (API client), [`backend/app/models.py`](https://github.com/revaldo007/finance-customer-mg/blob/main/backend/app/models.py) (Domain models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Admin web app"]
  node_app["Routes and layout<br/>[App.jsx]"]
  node_auth_ui["Login and session<br/>[AuthContext.jsx]"]
  node_api_client["API client<br/>[client.js]"]
  node_dashboard_ui["Dashboard analytics<br/>[Dashboard.jsx]"]
  node_customers_ui["Customer records<br/>[Customers.jsx]"]
  node_profile_ui["360 profile"]
  node_finance_ui["Finance accounts"]
  node_repayments_ui["Repayment history<br/>[Repayments.jsx]"]
  node_reports_ui["Reports<br/>[Reports.jsx]"]
end

subgraph group_api["API and access"]
  node_api_app["FastAPI app<br/>[main.py]"]
  node_auth_api["Authentication API<br/>[auth.py]"]
  node_customers_api["Customer API<br/>[customers.py]"]
  node_finance_api["Finance API<br/>[finance.py]"]
  node_repayments_api["Repayment API<br/>[repayments.py]"]
  node_dashboard_api["Dashboard API<br/>[dashboard.py]"]
  node_reports_api["Reports API<br/>[reports.py]"]
  node_auth_logic["JWT and passwords<br/>[auth.py]"]
end

subgraph group_domain["Finance operations"]
  node_finance_logic["Health and timelines<br/>[logic.py]"]
  node_schemas["API schemas<br/>[schemas.py]"]
  node_reports_data["Report aggregation<br/>[reports.py]"]
end

subgraph group_persistence["Data layer"]
  node_models["Domain models<br/>[models.py]"]
  node_database[("SQLite database<br/>[database.py]")]
end

node_admin(("Admin"))

node_admin -->|"uses"| node_app
node_app -->|"routes to"| node_auth_ui
node_app -->|"routes to"| node_dashboard_ui
node_app -->|"routes to"| node_customers_ui
node_app -->|"routes to"| node_profile_ui
node_app -->|"routes to"| node_finance_ui
node_app -->|"routes to"| node_repayments_ui
node_app -->|"routes to"| node_reports_ui
node_auth_ui -->|"calls"| node_api_client
node_auth_ui -->|"requests login"| node_auth_api
node_dashboard_ui -->|"calls"| node_api_client
node_customers_ui -->|"calls"| node_api_client
node_profile_ui -->|"calls"| node_api_client
node_finance_ui -->|"calls"| node_api_client
node_repayments_ui -->|"calls"| node_api_client
node_reports_ui -->|"calls"| node_api_client
node_api_client -->|"sends API requests"| node_api_app
node_api_app -->|"registers router"| node_auth_api
node_api_app -->|"registers router"| node_customers_api
node_api_app -->|"registers router"| node_finance_api
node_api_app -->|"registers router"| node_repayments_api
node_api_app -->|"registers router"| node_dashboard_api
node_api_app -->|"registers router"| node_reports_api
node_auth_api -->|"verifies and issues tokens"| node_auth_logic
node_auth_logic -->|"gets sessions"| node_database
node_api_app -->|"creates schema"| node_database
node_customers_api -->|"queries and writes"| node_database
node_finance_api -->|"queries and writes"| node_database
node_repayments_api -->|"queries and writes"| node_database
node_dashboard_api -->|"queries"| node_database
node_reports_api -->|"queries"| node_database
node_customers_api -->|"builds health and timeline"| node_finance_logic
node_finance_api -->|"computes monitoring data"| node_finance_logic
node_dashboard_api -->|"uses analytics logic"| node_finance_logic
node_reports_api -->|"uses finance logic"| node_finance_logic
node_customers_api -->|"queries customer records"| node_models
node_finance_api -->|"queries accounts"| node_models
node_repayments_api -->|"queries repayments"| node_models
node_finance_logic -->|"evaluates accounts"| node_models
node_auth_logic -->|"looks up admin"| node_models
node_api_app -->|"seeds admin"| node_models
node_schemas -->|"maps account status"| node_models
node_models -->|"declares ORM tables"| node_database

click node_app "https://github.com/revaldo007/finance-customer-mg/blob/main/frontend/src/App.jsx"
click node_auth_ui "https://github.com/revaldo007/finance-customer-mg/blob/main/frontend/src/context/AuthContext.jsx"
click node_api_client "https://github.com/revaldo007/finance-customer-mg/blob/main/frontend/src/api/client.js"
click node_dashboard_ui "https://github.com/revaldo007/finance-customer-mg/blob/main/frontend/src/pages/Dashboard.jsx"
click node_customers_ui "https://github.com/revaldo007/finance-customer-mg/blob/main/frontend/src/pages/Customers.jsx"
click node_profile_ui "https://github.com/revaldo007/finance-customer-mg/blob/main/frontend/src/pages/CustomerProfile.jsx"
click node_finance_ui "https://github.com/revaldo007/finance-customer-mg/blob/main/frontend/src/pages/FinanceAccounts.jsx"
click node_repayments_ui "https://github.com/revaldo007/finance-customer-mg/blob/main/frontend/src/pages/Repayments.jsx"
click node_reports_ui "https://github.com/revaldo007/finance-customer-mg/blob/main/frontend/src/pages/Reports.jsx"
click node_api_app "https://github.com/revaldo007/finance-customer-mg/blob/main/backend/app/main.py"
click node_auth_api "https://github.com/revaldo007/finance-customer-mg/blob/main/backend/app/routers/auth.py"
click node_customers_api "https://github.com/revaldo007/finance-customer-mg/blob/main/backend/app/routers/customers.py"
click node_finance_api "https://github.com/revaldo007/finance-customer-mg/blob/main/backend/app/routers/finance.py"
click node_repayments_api "https://github.com/revaldo007/finance-customer-mg/blob/main/backend/app/routers/repayments.py"
click node_dashboard_api "https://github.com/revaldo007/finance-customer-mg/blob/main/backend/app/routers/dashboard.py"
click node_reports_api "https://github.com/revaldo007/finance-customer-mg/blob/main/backend/app/routers/reports.py"
click node_auth_logic "https://github.com/revaldo007/finance-customer-mg/blob/main/backend/app/auth.py"
click node_finance_logic "https://github.com/revaldo007/finance-customer-mg/blob/main/backend/app/logic.py"
click node_schemas "https://github.com/revaldo007/finance-customer-mg/blob/main/backend/app/schemas.py"
click node_models "https://github.com/revaldo007/finance-customer-mg/blob/main/backend/app/models.py"
click node_database "https://github.com/revaldo007/finance-customer-mg/blob/main/backend/app/database.py"
click node_reports_data "https://github.com/revaldo007/finance-customer-mg/blob/main/backend/app/routers/reports.py"

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_ui,node_api_client,node_dashboard_ui,node_customers_ui,node_profile_ui,node_finance_ui,node_repayments_ui,node_reports_ui toneBlue
class node_api_app,node_auth_api,node_customers_api,node_finance_api,node_repayments_api,node_dashboard_api,node_reports_api,node_auth_logic toneAmber
class node_finance_logic,node_schemas,node_reports_data toneMint
class node_models,node_database toneRose
class node_admin toneIndigo
```

## Components

### Admin web app

- [Routes and layout](https://github.com/revaldo007/finance-customer-mg/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Login and session](https://github.com/revaldo007/finance-customer-mg/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [API client](https://github.com/revaldo007/finance-customer-mg/blob/main/frontend/src/api/client.js): `frontend/src/api/client.js`
- [Dashboard analytics](https://github.com/revaldo007/finance-customer-mg/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Customer records](https://github.com/revaldo007/finance-customer-mg/blob/main/frontend/src/pages/Customers.jsx): `frontend/src/pages/Customers.jsx`
- [360 profile](https://github.com/revaldo007/finance-customer-mg/blob/main/frontend/src/pages/CustomerProfile.jsx): `frontend/src/pages/CustomerProfile.jsx`
- [Finance accounts](https://github.com/revaldo007/finance-customer-mg/blob/main/frontend/src/pages/FinanceAccounts.jsx): `frontend/src/pages/FinanceAccounts.jsx`
- [Repayment history](https://github.com/revaldo007/finance-customer-mg/blob/main/frontend/src/pages/Repayments.jsx): `frontend/src/pages/Repayments.jsx`
- [Reports](https://github.com/revaldo007/finance-customer-mg/blob/main/frontend/src/pages/Reports.jsx): `frontend/src/pages/Reports.jsx`

### API and access

- [FastAPI app](https://github.com/revaldo007/finance-customer-mg/blob/main/backend/app/main.py): `backend/app/main.py`
- [Authentication API](https://github.com/revaldo007/finance-customer-mg/blob/main/backend/app/routers/auth.py): `backend/app/routers/auth.py`
- [Customer API](https://github.com/revaldo007/finance-customer-mg/blob/main/backend/app/routers/customers.py): `backend/app/routers/customers.py`
- [Finance API](https://github.com/revaldo007/finance-customer-mg/blob/main/backend/app/routers/finance.py): `backend/app/routers/finance.py`
- [Repayment API](https://github.com/revaldo007/finance-customer-mg/blob/main/backend/app/routers/repayments.py): `backend/app/routers/repayments.py`
- [Dashboard API](https://github.com/revaldo007/finance-customer-mg/blob/main/backend/app/routers/dashboard.py): `backend/app/routers/dashboard.py`
- [Reports API](https://github.com/revaldo007/finance-customer-mg/blob/main/backend/app/routers/reports.py): `backend/app/routers/reports.py`
- [JWT and passwords](https://github.com/revaldo007/finance-customer-mg/blob/main/backend/app/auth.py): `backend/app/auth.py`

### Finance operations

- [Health and timelines](https://github.com/revaldo007/finance-customer-mg/blob/main/backend/app/logic.py): `backend/app/logic.py`
- [API schemas](https://github.com/revaldo007/finance-customer-mg/blob/main/backend/app/schemas.py): `backend/app/schemas.py`
- [Report aggregation](https://github.com/revaldo007/finance-customer-mg/blob/main/backend/app/routers/reports.py): `backend/app/routers/reports.py`

### Data layer

- [Domain models](https://github.com/revaldo007/finance-customer-mg/blob/main/backend/app/models.py): `backend/app/models.py`
- [SQLite database](https://github.com/revaldo007/finance-customer-mg/blob/main/backend/app/database.py): `backend/app/database.py`

### Other components

- **Admin**

## Connections

- Admin → Routes and layout: uses (evidence: `README.md`)
- Routes and layout → Login and session: routes to (evidence: `frontend/src/App.jsx`)
- Routes and layout → Dashboard analytics: routes to (evidence: `frontend/src/App.jsx`)
- Routes and layout → Customer records: routes to (evidence: `frontend/src/App.jsx`)
- Routes and layout → 360 profile: routes to (evidence: `frontend/src/App.jsx`)
- Routes and layout → Finance accounts: routes to (evidence: `frontend/src/App.jsx`)
- Routes and layout → Repayment history: routes to (evidence: `frontend/src/App.jsx`)
- Routes and layout → Reports: routes to (evidence: `frontend/src/App.jsx`)
- Login and session → API client: calls (evidence: `frontend/src/context/AuthContext.jsx`)
- Login and session → Authentication API: requests login (evidence: `README.md`)
- Dashboard analytics → API client: calls (evidence: `frontend/src/pages/Dashboard.jsx`)
- Customer records → API client: calls (evidence: `frontend/src/pages/Customers.jsx`)
- 360 profile → API client: calls (evidence: `frontend/src/pages/CustomerProfile.jsx`)
- Finance accounts → API client: calls (evidence: `frontend/src/pages/FinanceAccounts.jsx`)
- Repayment history → API client: calls (evidence: `frontend/src/pages/Repayments.jsx`)
- Reports → API client: calls (evidence: `frontend/src/pages/Reports.jsx`)
- API client → FastAPI app: sends API requests (evidence: `README.md`)
- FastAPI app → Authentication API: registers router (evidence: `backend/app/main.py`)
- FastAPI app → Customer API: registers router (evidence: `backend/app/main.py`)
- FastAPI app → Finance API: registers router (evidence: `backend/app/main.py`)
- FastAPI app → Repayment API: registers router (evidence: `backend/app/main.py`)
- FastAPI app → Dashboard API: registers router (evidence: `backend/app/main.py`)
- FastAPI app → Reports API: registers router (evidence: `backend/app/main.py`)
- Authentication API → JWT and passwords: verifies and issues tokens (evidence: `backend/app/routers/auth.py`)
- JWT and passwords → SQLite database: gets sessions (evidence: `backend/app/auth.py`)
- FastAPI app → SQLite database: creates schema (evidence: `backend/app/main.py`)
- Customer API → SQLite database: queries and writes (evidence: `backend/app/routers/customers.py`)
- Finance API → SQLite database: queries and writes (evidence: `backend/app/routers/finance.py`)
- Repayment API → SQLite database: queries and writes (evidence: `backend/app/routers/repayments.py`)
- Dashboard API → SQLite database: queries (evidence: `backend/app/routers/dashboard.py`)
- Reports API → SQLite database: queries (evidence: `backend/app/routers/reports.py`)
- Customer API → Health and timelines: builds health and timeline (evidence: `backend/app/routers/customers.py`)
- Finance API → Health and timelines: computes monitoring data (evidence: `backend/app/routers/finance.py`)
- Dashboard API → Health and timelines: uses analytics logic (evidence: `backend/app/routers/dashboard.py`)
- Reports API → Health and timelines: uses finance logic (evidence: `backend/app/routers/reports.py`)
- Customer API → Domain models: queries customer records (evidence: `backend/app/routers/customers.py`)
- Finance API → Domain models: queries accounts (evidence: `backend/app/routers/finance.py`)
- Repayment API → Domain models: queries repayments (evidence: `backend/app/routers/repayments.py`)
- Health and timelines → Domain models: evaluates accounts (evidence: `backend/app/logic.py`)
- JWT and passwords → Domain models: looks up admin (evidence: `backend/app/auth.py`)
- FastAPI app → Domain models: seeds admin (evidence: `backend/app/main.py`)
- API schemas → Domain models: maps account status (evidence: `backend/app/schemas.py`)
- Domain models → SQLite database: declares ORM tables (evidence: `backend/app/models.py`)
