# sahilkumar-r/spendly architecture

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

- Interactive diagram: https://gitdiagram.com/sahilkumar-r/spendly
- Repository: https://github.com/sahilkumar-r/spendly

## Overview

Spendly is a Flask expense-tracking web application. A visitor can register or log in; authenticated users reach a profile showing account details and expense summaries. The profile’s statistics, transactions, and categories are currently hardcoded, while the database schema and seed routine support expense records. Adding, editing, and deleting expenses are placeholders, not implemented flows. The source excerpts show route-to-storage and route-to-template calls; they do not show template contents or browser asset wiring, so those links are omitted or marked unverified.

Main entry points: [`app.py`](https://github.com/sahilkumar-r/spendly/blob/main/app.py) (Flask routes), [`database/db.py`](https://github.com/sahilkumar-r/spendly/blob/main/database/db.py) (SQLite store), [`templates/profile.html`](https://github.com/sahilkumar-r/spendly/blob/main/templates/profile.html) (Profile view), [`static/js/main.js`](https://github.com/sahilkumar-r/spendly/blob/main/static/js/main.js) (Category interaction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_flask_routes["Flask routes<br/>[app.py]"]
  node_landing_view["Landing view<br/>[landing.html]"]
  node_legal_views["Legal views<br/>[terms.html]"]
  node_privacy_view["Privacy view<br/>[privacy.html]"]
  node_category_interaction["Category interaction<br/>[main.js]"]
end

subgraph group_accounts["Accounts"]
  node_registration["Registration<br/>[app.py]"]
  node_login_logout["Login and logout<br/>[app.py]"]
end

subgraph group_tracking["Expense tracking"]
  node_profile["Profile summary<br/>[app.py]"]
  node_profile_view["Profile view<br/>[profile.html]"]
  node_expense_placeholders["Expense placeholders<br/>[app.py]"]
end

subgraph group_storage["Persistence"]
  node_sqlite_store[("SQLite store<br/>[db.py]")]
end

node_visitor(("Visitor"))

node_visitor -.->|"requests pages"| node_flask_routes
node_flask_routes -->|"routes registration"| node_registration
node_flask_routes -->|"routes authentication"| node_login_logout
node_flask_routes -->|"routes profile"| node_profile
node_flask_routes -->|"routes expenses"| node_expense_placeholders
node_flask_routes -->|"renders"| node_landing_view
node_flask_routes -->|"renders"| node_legal_views
node_flask_routes -->|"renders"| node_privacy_view
node_flask_routes -->|"renders"| node_profile_view
node_registration -->|"creates users"| node_sqlite_store
node_login_logout -->|"looks up users"| node_sqlite_store
node_profile -->|"loads user"| node_sqlite_store
node_category_interaction -.->|"enhances categories"| node_profile_view

click node_flask_routes "https://github.com/sahilkumar-r/spendly/blob/main/app.py"
click node_landing_view "https://github.com/sahilkumar-r/spendly/blob/main/templates/landing.html"
click node_legal_views "https://github.com/sahilkumar-r/spendly/blob/main/templates/terms.html"
click node_privacy_view "https://github.com/sahilkumar-r/spendly/blob/main/templates/privacy.html"
click node_registration "https://github.com/sahilkumar-r/spendly/blob/main/app.py"
click node_login_logout "https://github.com/sahilkumar-r/spendly/blob/main/app.py"
click node_profile "https://github.com/sahilkumar-r/spendly/blob/main/app.py"
click node_profile_view "https://github.com/sahilkumar-r/spendly/blob/main/templates/profile.html"
click node_expense_placeholders "https://github.com/sahilkumar-r/spendly/blob/main/app.py"
click node_category_interaction "https://github.com/sahilkumar-r/spendly/blob/main/static/js/main.js"
click node_sqlite_store "https://github.com/sahilkumar-r/spendly/blob/main/database/db.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_flask_routes,node_landing_view,node_legal_views,node_privacy_view,node_category_interaction toneBlue
class node_registration,node_login_logout toneAmber
class node_profile,node_profile_view,node_expense_placeholders toneMint
class node_sqlite_store toneRose
class node_visitor toneIndigo
```

## Components

### Web experience

- [Flask routes](https://github.com/sahilkumar-r/spendly/blob/main/app.py): `app.py`
- [Landing view](https://github.com/sahilkumar-r/spendly/blob/main/templates/landing.html): `templates/landing.html`
- [Legal views](https://github.com/sahilkumar-r/spendly/blob/main/templates/terms.html): `templates/terms.html`
- [Privacy view](https://github.com/sahilkumar-r/spendly/blob/main/templates/privacy.html): `templates/privacy.html`
- [Category interaction](https://github.com/sahilkumar-r/spendly/blob/main/static/js/main.js): `static/js/main.js`

### Accounts

- [Registration](https://github.com/sahilkumar-r/spendly/blob/main/app.py): `app.py`
- [Login and logout](https://github.com/sahilkumar-r/spendly/blob/main/app.py): `app.py`

### Expense tracking

- [Profile summary](https://github.com/sahilkumar-r/spendly/blob/main/app.py): `app.py`
- [Profile view](https://github.com/sahilkumar-r/spendly/blob/main/templates/profile.html): `templates/profile.html`
- [Expense placeholders](https://github.com/sahilkumar-r/spendly/blob/main/app.py): `app.py`

### Persistence

- [SQLite store](https://github.com/sahilkumar-r/spendly/blob/main/database/db.py): `database/db.py`

### Other components

- **Visitor**

## Connections

- Visitor → Flask routes: requests pages
- Flask routes → Registration: routes registration (evidence: `app.py`)
- Flask routes → Login and logout: routes authentication (evidence: `app.py`)
- Flask routes → Profile summary: routes profile (evidence: `app.py`)
- Flask routes → Expense placeholders: routes expenses (evidence: `app.py`)
- Flask routes → Landing view: renders (evidence: `app.py`)
- Flask routes → Legal views: renders (evidence: `app.py`)
- Flask routes → Privacy view: renders (evidence: `app.py`)
- Flask routes → Profile view: renders (evidence: `app.py`)
- Registration → SQLite store: creates users (evidence: `app.py`)
- Login and logout → SQLite store: looks up users (evidence: `app.py`)
- Profile summary → SQLite store: loads user (evidence: `app.py`)
- Category interaction → Profile view: enhances categories
