# ravishankar141/expense-tracker architecture

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

- Interactive diagram: https://gitdiagram.com/ravishankar141/expense-tracker
- Repository: https://github.com/ravishankar141/expense-tracker

## Overview

Spendly is an in-development Flask expense tracker. Users can register or log in, then view a profile dashboard with spending totals, recent transactions, and category breakdowns; expense add/edit/delete routes are placeholders. The graph separates request handling, dashboard queries, and SQLite persistence, while retaining documented expense management and categorization as planned capabilities. Evidence is limited to the README and sampled source; unsampled templates and styles are not mapped as runtime components.

Main entry points: [`database/db.py`](https://github.com/ravishankar141/expense-tracker/blob/main/database/db.py) (Database helpers), [`app.py`](https://github.com/ravishankar141/expense-tracker/blob/main/app.py) (Flask routes), [`database/queries.py`](https://github.com/ravishankar141/expense-tracker/blob/main/database/queries.py) (Dashboard queries), [`spendly.db`](https://github.com/ravishankar141/expense-tracker/blob/main/spendly.db) (SQLite database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_routes["Flask routes<br/>[app.py]"]
  node_account["Registration and login<br/>[app.py]"]
  node_profile["Profile dashboard<br/>[app.py]"]
  node_expense_actions["Expense actions<br/>[app.py]"]
end

subgraph group_spending["Spending insights"]
  node_dashboard_queries["Dashboard queries<br/>[queries.py]"]
  node_spending_summary["Summary statistics<br/>[queries.py]"]
  node_recent_transactions["Recent transactions<br/>[queries.py]"]
  node_category_breakdown["Category breakdown<br/>[queries.py]"]
end

subgraph group_storage["Persistence"]
  node_db_helpers["Database helpers<br/>[db.py]"]
  node_sqlite[("SQLite database<br/>[spendly.db]")]
end

node_user(("User"))

node_user -->|"requests pages"| node_routes
node_routes -->|"dispatches auth"| node_account
node_routes -->|"dispatches profile"| node_profile
node_routes -->|"dispatches actions"| node_expense_actions
node_account -->|"creates and looks up users"| node_db_helpers
node_profile -->|"fetches dashboard data"| node_dashboard_queries
node_dashboard_queries -->|"computes"| node_spending_summary
node_dashboard_queries -->|"fetches"| node_recent_transactions
node_dashboard_queries -->|"aggregates"| node_category_breakdown
node_spending_summary -->|"gets connection"| node_db_helpers
node_recent_transactions -->|"gets connection"| node_db_helpers
node_category_breakdown -->|"gets connection"| node_db_helpers
node_db_helpers -->|"reads and writes"| node_sqlite

click node_routes "https://github.com/ravishankar141/expense-tracker/blob/main/app.py"
click node_account "https://github.com/ravishankar141/expense-tracker/blob/main/app.py"
click node_profile "https://github.com/ravishankar141/expense-tracker/blob/main/app.py"
click node_expense_actions "https://github.com/ravishankar141/expense-tracker/blob/main/app.py"
click node_dashboard_queries "https://github.com/ravishankar141/expense-tracker/blob/main/database/queries.py"
click node_spending_summary "https://github.com/ravishankar141/expense-tracker/blob/main/database/queries.py"
click node_recent_transactions "https://github.com/ravishankar141/expense-tracker/blob/main/database/queries.py"
click node_category_breakdown "https://github.com/ravishankar141/expense-tracker/blob/main/database/queries.py"
click node_db_helpers "https://github.com/ravishankar141/expense-tracker/blob/main/database/db.py"
click node_sqlite "https://github.com/ravishankar141/expense-tracker/blob/main/spendly.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_routes,node_account,node_profile,node_expense_actions,node_user toneBlue
class node_dashboard_queries,node_spending_summary,node_recent_transactions,node_category_breakdown toneAmber
class node_db_helpers,node_sqlite toneMint
```

## Components

### Web application

- [Flask routes](https://github.com/ravishankar141/expense-tracker/blob/main/app.py): `app.py`
- [Registration and login](https://github.com/ravishankar141/expense-tracker/blob/main/app.py): `app.py`
- [Profile dashboard](https://github.com/ravishankar141/expense-tracker/blob/main/app.py): `app.py`
- [Expense actions](https://github.com/ravishankar141/expense-tracker/blob/main/app.py): `app.py`

### Spending insights

- [Dashboard queries](https://github.com/ravishankar141/expense-tracker/blob/main/database/queries.py): `database/queries.py`
- [Summary statistics](https://github.com/ravishankar141/expense-tracker/blob/main/database/queries.py): `database/queries.py`
- [Recent transactions](https://github.com/ravishankar141/expense-tracker/blob/main/database/queries.py): `database/queries.py`
- [Category breakdown](https://github.com/ravishankar141/expense-tracker/blob/main/database/queries.py): `database/queries.py`

### Persistence

- [Database helpers](https://github.com/ravishankar141/expense-tracker/blob/main/database/db.py): `database/db.py`
- [SQLite database](https://github.com/ravishankar141/expense-tracker/blob/main/spendly.db): `spendly.db`

### Other components

- **User**

## Connections

- User → Flask routes: requests pages (evidence: `app.py`)
- Flask routes → Registration and login: dispatches auth (evidence: `app.py`)
- Flask routes → Profile dashboard: dispatches profile (evidence: `app.py`)
- Flask routes → Expense actions: dispatches actions (evidence: `app.py`)
- Registration and login → Database helpers: creates and looks up users (evidence: `app.py`)
- Profile dashboard → Dashboard queries: fetches dashboard data (evidence: `app.py`)
- Dashboard queries → Summary statistics: computes (evidence: `database/queries.py`)
- Dashboard queries → Recent transactions: fetches (evidence: `database/queries.py`)
- Dashboard queries → Category breakdown: aggregates (evidence: `database/queries.py`)
- Summary statistics → Database helpers: gets connection (evidence: `database/queries.py`)
- Recent transactions → Database helpers: gets connection (evidence: `database/queries.py`)
- Category breakdown → Database helpers: gets connection (evidence: `database/queries.py`)
- Database helpers → SQLite database: reads and writes (evidence: `database/db.py`)
