# mihlalimandoyi-hub/expense-tracker architecture

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

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

## Overview

Expense Tracker is a Flask app for registering users and managing private income and expense transactions. Its main workflow authenticates a user, accepts dated transactions, then lists them with date filtering, totals, balance, and category chart data; users can also edit or delete records. The README documents the chart visualizations and styled interface, though their template implementation was not sampled. Evidence is strongest for route-to-database calls in app.py; presentation details beyond the README are not inferred.

Main entry points: [`app.py`](https://github.com/mihlalimandoyi-hub/expense-tracker/blob/main/app.py) (Flask routes), [`templates/expenses.html`](https://github.com/mihlalimandoyi-hub/expense-tracker/blob/main/templates/expenses.html) (Expense dashboard), [`database.py`](https://github.com/mihlalimandoyi-hub/expense-tracker/blob/main/database.py) (SQLite data), [`templates/register.html`](https://github.com/mihlalimandoyi-hub/expense-tracker/blob/main/templates/register.html) (Account forms)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web workflows"]
  node_flask["Flask routes<br/>[app.py]"]
  node_auth["Account auth<br/>[app.py]"]
  node_transactions["Transaction CRUD<br/>[app.py]"]
  node_reporting["Totals and charts<br/>[app.py]"]
end

subgraph group_data["Persistence"]
  node_sqlite[("SQLite data<br/>[database.py]")]
end

subgraph group_presentation["User interface"]
  node_accounts["Account forms<br/>[register.html]"]
  node_transaction_forms["Transaction forms<br/>[add_expense.html]"]
  node_edit_form["Edit form<br/>[edit_expense.html]"]
  node_expense_view["Expense dashboard<br/>[expenses.html]"]
  node_home_view["Home page<br/>[home.html]"]
  node_login_view["Login form<br/>[login.html]"]
  node_styles["Theme styling<br/>[style.css]"]
end

node_user(("Visitor"))
node_chartjs["Chart.js"]

node_user -->|"uses"| node_flask
node_flask -->|"dispatches"| node_auth
node_flask -->|"dispatches"| node_transactions
node_flask -->|"dispatches"| node_reporting
node_auth -->|"reads/writes"| node_sqlite
node_transactions -->|"reads/writes"| node_sqlite
node_reporting -->|"queries"| node_sqlite
node_flask -->|"renders"| node_accounts
node_flask -->|"renders"| node_login_view
node_flask -->|"renders"| node_home_view
node_flask -->|"renders"| node_transaction_forms
node_flask -->|"renders"| node_edit_form
node_reporting -->|"renders data"| node_expense_view
node_expense_view -.->|"visualizes with"| node_chartjs
node_expense_view -.->|"styled by"| node_styles

click node_flask "https://github.com/mihlalimandoyi-hub/expense-tracker/blob/main/app.py"
click node_auth "https://github.com/mihlalimandoyi-hub/expense-tracker/blob/main/app.py"
click node_transactions "https://github.com/mihlalimandoyi-hub/expense-tracker/blob/main/app.py"
click node_reporting "https://github.com/mihlalimandoyi-hub/expense-tracker/blob/main/app.py"
click node_sqlite "https://github.com/mihlalimandoyi-hub/expense-tracker/blob/main/database.py"
click node_accounts "https://github.com/mihlalimandoyi-hub/expense-tracker/blob/main/templates/register.html"
click node_transaction_forms "https://github.com/mihlalimandoyi-hub/expense-tracker/blob/main/templates/add_expense.html"
click node_edit_form "https://github.com/mihlalimandoyi-hub/expense-tracker/blob/main/templates/edit_expense.html"
click node_expense_view "https://github.com/mihlalimandoyi-hub/expense-tracker/blob/main/templates/expenses.html"
click node_home_view "https://github.com/mihlalimandoyi-hub/expense-tracker/blob/main/templates/home.html"
click node_login_view "https://github.com/mihlalimandoyi-hub/expense-tracker/blob/main/templates/login.html"
click node_styles "https://github.com/mihlalimandoyi-hub/expense-tracker/blob/main/static/style.css"

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_flask,node_auth,node_transactions,node_reporting toneBlue
class node_sqlite toneAmber
class node_accounts,node_transaction_forms,node_edit_form,node_expense_view,node_home_view,node_login_view,node_styles toneMint
class node_user,node_chartjs toneIndigo
```

## Components

### Web workflows

- [Flask routes](https://github.com/mihlalimandoyi-hub/expense-tracker/blob/main/app.py): `app.py`
- [Account auth](https://github.com/mihlalimandoyi-hub/expense-tracker/blob/main/app.py): `app.py`
- [Transaction CRUD](https://github.com/mihlalimandoyi-hub/expense-tracker/blob/main/app.py): `app.py`
- [Totals and charts](https://github.com/mihlalimandoyi-hub/expense-tracker/blob/main/app.py): `app.py`

### Persistence

- [SQLite data](https://github.com/mihlalimandoyi-hub/expense-tracker/blob/main/database.py): `database.py`

### User interface

- [Account forms](https://github.com/mihlalimandoyi-hub/expense-tracker/blob/main/templates/register.html): `templates/register.html`
- [Transaction forms](https://github.com/mihlalimandoyi-hub/expense-tracker/blob/main/templates/add_expense.html): `templates/add_expense.html`
- [Edit form](https://github.com/mihlalimandoyi-hub/expense-tracker/blob/main/templates/edit_expense.html): `templates/edit_expense.html`
- [Expense dashboard](https://github.com/mihlalimandoyi-hub/expense-tracker/blob/main/templates/expenses.html): `templates/expenses.html`
- [Home page](https://github.com/mihlalimandoyi-hub/expense-tracker/blob/main/templates/home.html): `templates/home.html`
- [Login form](https://github.com/mihlalimandoyi-hub/expense-tracker/blob/main/templates/login.html): `templates/login.html`
- [Theme styling](https://github.com/mihlalimandoyi-hub/expense-tracker/blob/main/static/style.css): `static/style.css`

### Other components

- **Visitor**
- **Chart.js**

## Connections

- Visitor → Flask routes: uses (evidence: `README.md`)
- Flask routes → Account auth: dispatches (evidence: `app.py`)
- Flask routes → Transaction CRUD: dispatches (evidence: `app.py`)
- Flask routes → Totals and charts: dispatches (evidence: `app.py`)
- Account auth → SQLite data: reads/writes (evidence: `app.py`)
- Transaction CRUD → SQLite data: reads/writes (evidence: `app.py`)
- Totals and charts → SQLite data: queries (evidence: `app.py`)
- Flask routes → Account forms: renders (evidence: `app.py`)
- Flask routes → Login form: renders (evidence: `app.py`)
- Flask routes → Home page: renders (evidence: `app.py`)
- Flask routes → Transaction forms: renders (evidence: `app.py`)
- Flask routes → Edit form: renders (evidence: `app.py`)
- Totals and charts → Expense dashboard: renders data (evidence: `app.py`)
- Expense dashboard → Chart.js: visualizes with (evidence: `README.md`)
- Expense dashboard → Theme styling: styled by (evidence: `README.md`)
