# 36vanquyet/spendmate_app architecture

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

- Interactive diagram: https://gitdiagram.com/36vanquyet/spendmate_app
- Repository: https://github.com/36vanquyet/spendmate_app

## Overview

SpendMate is a personal and shared expense-management MVP. A user works through the responsive web interface to authenticate, manage transactions and groups, set budgets and reminders, and view statistics or export reports. The backend is a FastAPI application whose routes and domain capabilities are concentrated in one module, with SQLAlchemy models and SQLite persistence, JWT/password helpers, and Pydantic request schemas. The README documents the frontend and backend as separate processes; the frontend-to-API connection is implied, but its implementation was not sampled.

Main entry points: [`backend/app/main.py`](https://github.com/36vanquyet/spendmate_app/blob/main/backend/app/main.py) (FastAPI routes), [`frontend/index.html`](https://github.com/36vanquyet/spendmate_app/blob/main/frontend/index.html) (Responsive interface), [`frontend/assets/app.js`](https://github.com/36vanquyet/spendmate_app/blob/main/frontend/assets/app.js) (Browser behavior), [`backend/app/database.py`](https://github.com/36vanquyet/spendmate_app/blob/main/backend/app/database.py) (SQLAlchemy models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_web["Responsive interface<br/>[index.html]"]
  node_js["Browser behavior<br/>[app.js]"]
end

subgraph group_api["API capabilities"]
  node_api_entry["FastAPI routes<br/>[main.py]"]
  node_accounts["Accounts and profiles<br/>[main.py]"]
  node_transactions["Transactions<br/>[main.py]"]
  node_groups_comments["Groups and comments<br/>[main.py]"]
  node_budgets_reminders["Budgets and reminders<br/>[main.py]"]
  node_insights_reports["Statistics and exports<br/>[main.py]"]
end

subgraph group_shared["Backend foundations"]
  node_auth_helpers["JWT and passwords<br/>[auth.py]"]
  node_request_schemas["Request schemas<br/>[schemas.py]"]
end

subgraph group_persistence["Persistence"]
  node_db_layer["SQLAlchemy models<br/>[database.py]"]
  node_sqlite[("SQLite database<br/>[spendmate.db]")]
end

node_user(("User"))

node_user -->|"uses"| node_web
node_web -.->|"loads"| node_js
node_js -.->|"calls API"| node_api_entry
node_api_entry -->|"routes"| node_accounts
node_api_entry -->|"routes"| node_transactions
node_api_entry -->|"routes"| node_groups_comments
node_api_entry -->|"routes"| node_budgets_reminders
node_api_entry -->|"routes"| node_insights_reports
node_api_entry -->|"calls"| node_auth_helpers
node_api_entry -->|"uses"| node_request_schemas
node_api_entry -->|"queries"| node_db_layer
node_db_layer -->|"connects"| node_sqlite

click node_web "https://github.com/36vanquyet/spendmate_app/blob/main/frontend/index.html"
click node_js "https://github.com/36vanquyet/spendmate_app/blob/main/frontend/assets/app.js"
click node_api_entry "https://github.com/36vanquyet/spendmate_app/blob/main/backend/app/main.py"
click node_accounts "https://github.com/36vanquyet/spendmate_app/blob/main/backend/app/main.py"
click node_transactions "https://github.com/36vanquyet/spendmate_app/blob/main/backend/app/main.py"
click node_groups_comments "https://github.com/36vanquyet/spendmate_app/blob/main/backend/app/main.py"
click node_budgets_reminders "https://github.com/36vanquyet/spendmate_app/blob/main/backend/app/main.py"
click node_insights_reports "https://github.com/36vanquyet/spendmate_app/blob/main/backend/app/main.py"
click node_auth_helpers "https://github.com/36vanquyet/spendmate_app/blob/main/backend/app/auth.py"
click node_request_schemas "https://github.com/36vanquyet/spendmate_app/blob/main/backend/app/schemas.py"
click node_db_layer "https://github.com/36vanquyet/spendmate_app/blob/main/backend/app/database.py"
click node_sqlite "https://github.com/36vanquyet/spendmate_app/blob/main/spendmate.db"

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_web,node_js,node_user toneBlue
class node_api_entry,node_accounts,node_transactions,node_groups_comments,node_budgets_reminders,node_insights_reports toneAmber
class node_auth_helpers,node_request_schemas toneMint
class node_db_layer,node_sqlite toneRose
```

## Components

### Web client

- [Responsive interface](https://github.com/36vanquyet/spendmate_app/blob/main/frontend/index.html): `frontend/index.html`
- [Browser behavior](https://github.com/36vanquyet/spendmate_app/blob/main/frontend/assets/app.js): `frontend/assets/app.js`

### API capabilities

- [FastAPI routes](https://github.com/36vanquyet/spendmate_app/blob/main/backend/app/main.py): `backend/app/main.py`
- [Accounts and profiles](https://github.com/36vanquyet/spendmate_app/blob/main/backend/app/main.py): `backend/app/main.py`
- [Transactions](https://github.com/36vanquyet/spendmate_app/blob/main/backend/app/main.py): `backend/app/main.py`
- [Groups and comments](https://github.com/36vanquyet/spendmate_app/blob/main/backend/app/main.py): `backend/app/main.py`
- [Budgets and reminders](https://github.com/36vanquyet/spendmate_app/blob/main/backend/app/main.py): `backend/app/main.py`
- [Statistics and exports](https://github.com/36vanquyet/spendmate_app/blob/main/backend/app/main.py): `backend/app/main.py`

### Backend foundations

- [JWT and passwords](https://github.com/36vanquyet/spendmate_app/blob/main/backend/app/auth.py): `backend/app/auth.py`
- [Request schemas](https://github.com/36vanquyet/spendmate_app/blob/main/backend/app/schemas.py): `backend/app/schemas.py`

### Persistence

- [SQLAlchemy models](https://github.com/36vanquyet/spendmate_app/blob/main/backend/app/database.py): `backend/app/database.py`
- [SQLite database](https://github.com/36vanquyet/spendmate_app/blob/main/spendmate.db): `spendmate.db`

### Other components

- **User**

## Connections

- User → Responsive interface: uses (evidence: `README.md`)
- Responsive interface → Browser behavior: loads
- Browser behavior → FastAPI routes: calls API
- FastAPI routes → Accounts and profiles: routes (evidence: `backend/app/main.py`)
- FastAPI routes → Transactions: routes (evidence: `backend/app/main.py`)
- FastAPI routes → Groups and comments: routes (evidence: `backend/app/main.py`)
- FastAPI routes → Budgets and reminders: routes (evidence: `backend/app/main.py`)
- FastAPI routes → Statistics and exports: routes (evidence: `backend/app/main.py`)
- FastAPI routes → JWT and passwords: calls (evidence: `backend/app/main.py`)
- FastAPI routes → Request schemas: uses (evidence: `backend/app/main.py`)
- FastAPI routes → SQLAlchemy models: queries (evidence: `backend/app/main.py`)
- SQLAlchemy models → SQLite database: connects (evidence: `backend/app/database.py`)
