# vikramjitsinghdev/spend-wise architecture

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

- Interactive diagram: https://gitdiagram.com/vikramjitsinghdev/spend-wise
- Repository: https://github.com/vikramjitsinghdev/spend-wise

## Overview

Expense Tracker is a Flask web app for entering and reviewing personal expenses. The main workflow runs from the browser interface through JavaScript requests to Flask, which validates and processes expense data and accesses SQLite; the response updates the interface. The repository also includes a separate in-memory Flask implementation in main.py. The README documents search, history, items, and budget features; sampled excerpts show related frontend requests and backend endpoints, but do not expose every route implementation.

Main entry points: [`static/script.js`](https://github.com/vikramjitsinghdev/spend-wise/blob/main/static/script.js) (Browser interactions), [`app.py`](https://github.com/vikramjitsinghdev/spend-wise/blob/main/app.py) (Flask API), [`templates/index.html`](https://github.com/vikramjitsinghdev/spend-wise/blob/main/templates/index.html) (Expense page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_page["Expense page<br/>[index.html]"]
  node_frontend["Browser interactions<br/>[script.js]"]
end

subgraph group_backend["Expense backend"]
  node_api["Flask API<br/>[app.py]"]
  node_expense_ops["Expense operations<br/>[app.py]"]
  node_review["Search and history<br/>[app.py]"]
  node_budget["Budget management<br/>[app.py]"]
end

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

subgraph group_alternate["Alternate implementation"]
  node_memory_app["In-memory expense app<br/>[main.py]"]
end

node_user(("Expense tracker user"))

node_user -->|"uses"| node_page
node_page -->|"loads interactions"| node_frontend
node_frontend -->|"sends API requests"| node_api
node_api -->|"renders page"| node_page
node_api -->|"queries and updates"| node_sqlite
node_frontend -->|"requests search and history"| node_review
node_frontend -->|"requests budget edits"| node_budget
node_frontend -->|"requests expense changes"| node_expense_ops

click node_page "https://github.com/vikramjitsinghdev/spend-wise/blob/main/templates/index.html"
click node_frontend "https://github.com/vikramjitsinghdev/spend-wise/blob/main/static/script.js"
click node_api "https://github.com/vikramjitsinghdev/spend-wise/blob/main/app.py"
click node_expense_ops "https://github.com/vikramjitsinghdev/spend-wise/blob/main/app.py"
click node_review "https://github.com/vikramjitsinghdev/spend-wise/blob/main/app.py"
click node_budget "https://github.com/vikramjitsinghdev/spend-wise/blob/main/app.py"
click node_sqlite "https://github.com/vikramjitsinghdev/spend-wise/blob/main/app.py"
click node_memory_app "https://github.com/vikramjitsinghdev/spend-wise/blob/main/main.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_page,node_frontend,node_user toneBlue
class node_api,node_expense_ops,node_review,node_budget toneAmber
class node_sqlite toneMint
class node_memory_app toneRose
```

## Components

### Web interface

- [Expense page](https://github.com/vikramjitsinghdev/spend-wise/blob/main/templates/index.html): `templates/index.html`
- [Browser interactions](https://github.com/vikramjitsinghdev/spend-wise/blob/main/static/script.js): `static/script.js`

### Expense backend

- [Flask API](https://github.com/vikramjitsinghdev/spend-wise/blob/main/app.py): `app.py`
- [Expense operations](https://github.com/vikramjitsinghdev/spend-wise/blob/main/app.py): `app.py`
- [Search and history](https://github.com/vikramjitsinghdev/spend-wise/blob/main/app.py): `app.py`
- [Budget management](https://github.com/vikramjitsinghdev/spend-wise/blob/main/app.py): `app.py`

### Expense data

- [SQLite database](https://github.com/vikramjitsinghdev/spend-wise/blob/main/app.py): `app.py`

### Alternate implementation

- [In-memory expense app](https://github.com/vikramjitsinghdev/spend-wise/blob/main/main.py): `main.py`

### Other components

- **Expense tracker user**

## Connections

- Expense tracker user → Expense page: uses (evidence: `README.md`)
- Expense page → Browser interactions: loads interactions (evidence: `README.md`)
- Browser interactions → Flask API: sends API requests (evidence: `static/script.js`)
- Flask API → Expense page: renders page (evidence: `README.md`)
- Flask API → SQLite database: queries and updates (evidence: `app.py`)
- Browser interactions → Search and history: requests search and history (evidence: `static/script.js`)
- Browser interactions → Budget management: requests budget edits (evidence: `static/script.js`)
- Browser interactions → Expense operations: requests expense changes (evidence: `static/script.js`)
