# tanu048/finance_dashboard architecture

> Architecture diagram of the GitHub repository tanu048/finance_dashboard, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tanu048/finance_dashboard
- Repository: https://github.com/tanu048/finance_dashboard

## Overview

Finance Dashboard is a role-based web application for managing shared financial records and viewing dashboard insights. A user loads the web interface, authenticates for a JWT, then makes role-guarded API requests: authorized users can browse records and summaries, analysts and admins can view category and monthly trends, and admins can manage records and users. API handlers validate inputs, apply access dependencies, and read or mutate SQLAlchemy-backed state. The README documents recent activity and other endpoints; the graph groups those features under the records router, though their implementation was not sampled.

Main entry points: [`routers/auth.py`](https://github.com/tanu048/finance_dashboard/blob/main/routers/auth.py) (Auth endpoints), [`main.py`](https://github.com/tanu048/finance_dashboard/blob/main/main.py) (FastAPI app), [`routers/users.py`](https://github.com/tanu048/finance_dashboard/blob/main/routers/users.py) (User management), [`routers/records.py`](https://github.com/tanu048/finance_dashboard/blob/main/routers/records.py) (Record endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_app["FastAPI app<br/>[main.py]"]
  node_pages["Page templates"]
  node_frontend["Dashboard client<br/>[scripts.js]"]
end

subgraph group_identity["Identity and access"]
  node_auth["Auth endpoints<br/>[auth.py]"]
  node_users["User management<br/>[users.py]"]
  node_user_schema["User schemas<br/>[users.py]"]
  node_token_schema["Token schema<br/>[auths.py]"]
end

subgraph group_finance["Finance operations"]
  node_records["Record endpoints<br/>[records.py]"]
  node_record_schema["Record schemas<br/>[records.py]"]
end

subgraph group_persistence["Persistence"]
  node_db_access["Session setup<br/>[db.py]"]
  node_models["ORM models<br/>[models.py]"]
  node_store[("SQLite database")]
end

node_browser(("User browser"))

node_browser -->|"requests pages"| node_app
node_app -->|"renders"| node_pages
node_browser -->|"runs client"| node_frontend
node_frontend -->|"calls auth API"| node_auth
node_frontend -->|"calls finance API"| node_records
node_frontend -->|"calls user API"| node_users
node_app -->|"registers router"| node_auth
node_app -->|"registers router"| node_records
node_app -->|"registers router"| node_users
node_app -->|"creates tables"| node_db_access
node_auth -->|"validates users"| node_user_schema
node_auth -->|"shapes token"| node_token_schema
node_auth -->|"gets sessions"| node_db_access
node_auth -->|"queries users"| node_models
node_users -->|"checks admin"| node_auth
node_users -->|"validates updates"| node_user_schema
node_users -->|"gets sessions"| node_db_access
node_users -->|"manages users"| node_models
node_records -->|"checks roles"| node_auth
node_records -->|"validates records"| node_record_schema
node_records -->|"gets sessions"| node_db_access
node_records -->|"queries records"| node_models
node_db_access -->|"creates tables"| node_models
node_db_access -->|"reads and writes"| node_store

click node_app "https://github.com/tanu048/finance_dashboard/blob/main/main.py"
click node_pages "https://github.com/tanu048/finance_dashboard/tree/main/templates"
click node_frontend "https://github.com/tanu048/finance_dashboard/blob/main/static/scripts.js"
click node_auth "https://github.com/tanu048/finance_dashboard/blob/main/routers/auth.py"
click node_users "https://github.com/tanu048/finance_dashboard/blob/main/routers/users.py"
click node_user_schema "https://github.com/tanu048/finance_dashboard/blob/main/schema/users.py"
click node_token_schema "https://github.com/tanu048/finance_dashboard/blob/main/schema/auths.py"
click node_records "https://github.com/tanu048/finance_dashboard/blob/main/routers/records.py"
click node_record_schema "https://github.com/tanu048/finance_dashboard/blob/main/schema/records.py"
click node_db_access "https://github.com/tanu048/finance_dashboard/blob/main/database/db.py"
click node_models "https://github.com/tanu048/finance_dashboard/blob/main/database/models.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_pages,node_frontend,node_browser toneBlue
class node_auth,node_users,node_user_schema,node_token_schema toneAmber
class node_records,node_record_schema toneMint
class node_db_access,node_models,node_store toneRose
```

## Components

### Web interface

- [FastAPI app](https://github.com/tanu048/finance_dashboard/blob/main/main.py): `main.py`
- [Page templates](https://github.com/tanu048/finance_dashboard/tree/main/templates): `templates`
- [Dashboard client](https://github.com/tanu048/finance_dashboard/blob/main/static/scripts.js): `static/scripts.js`

### Identity and access

- [Auth endpoints](https://github.com/tanu048/finance_dashboard/blob/main/routers/auth.py): `routers/auth.py`
- [User management](https://github.com/tanu048/finance_dashboard/blob/main/routers/users.py): `routers/users.py`
- [User schemas](https://github.com/tanu048/finance_dashboard/blob/main/schema/users.py): `schema/users.py`
- [Token schema](https://github.com/tanu048/finance_dashboard/blob/main/schema/auths.py): `schema/auths.py`

### Finance operations

- [Record endpoints](https://github.com/tanu048/finance_dashboard/blob/main/routers/records.py): `routers/records.py`
- [Record schemas](https://github.com/tanu048/finance_dashboard/blob/main/schema/records.py): `schema/records.py`

### Persistence

- [Session setup](https://github.com/tanu048/finance_dashboard/blob/main/database/db.py): `database/db.py`
- [ORM models](https://github.com/tanu048/finance_dashboard/blob/main/database/models.py): `database/models.py`
- **SQLite database**

### Other components

- **User browser**

## Connections

- User browser → FastAPI app: requests pages
- FastAPI app → Page templates: renders
- User browser → Dashboard client: runs client
- Dashboard client → Auth endpoints: calls auth API
- Dashboard client → Record endpoints: calls finance API
- Dashboard client → User management: calls user API
- FastAPI app → Auth endpoints: registers router
- FastAPI app → Record endpoints: registers router
- FastAPI app → User management: registers router
- FastAPI app → Session setup: creates tables
- Auth endpoints → User schemas: validates users
- Auth endpoints → Token schema: shapes token
- Auth endpoints → Session setup: gets sessions
- Auth endpoints → ORM models: queries users
- User management → Auth endpoints: checks admin
- User management → User schemas: validates updates
- User management → Session setup: gets sessions
- User management → ORM models: manages users
- Record endpoints → Auth endpoints: checks roles
- Record endpoints → Record schemas: validates records
- Record endpoints → Session setup: gets sessions
- Record endpoints → ORM models: queries records
- Session setup → ORM models: creates tables
- Session setup → SQLite database: reads and writes
