# campusx-official/spendly architecture

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

- Interactive diagram: https://gitdiagram.com/campusx-official/spendly
- Repository: https://github.com/campusx-official/spendly

## Overview

Spendly is a Flask expense-tracking application. The principal workflow is a user signing in, recording or managing expenses, and reviewing them on a profile or analytics page. The tree also documents registration, date-filtered profiles, and expense editing and deletion. Source excerpts do not expose the Flask routes or database calls, and the README is empty, so connections from the application to its templates and storage are shown as unverified rather than asserted as inspected behavior.

Main entry points: [`app.py`](https://github.com/campusx-official/spendly/blob/main/app.py) (Flask application), [`database/db.py`](https://github.com/campusx-official/spendly/blob/main/database/db.py) (Database access), [`database/queries.py`](https://github.com/campusx-official/spendly/blob/main/database/queries.py) (Expense queries), [`templates/landing.html`](https://github.com/campusx-official/spendly/blob/main/templates/landing.html) (Landing page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_flask["Flask application<br/>[app.py]"]
  node_landing["Landing page<br/>[landing.html]"]
end

subgraph group_accounts["Accounts"]
  node_registration["Registration page<br/>[register.html]"]
  node_login["Login page<br/>[login.html]"]
  node_profile["Profile page<br/>[profile.html]"]
end

subgraph group_expenses["Expense management"]
  node_expense_entry["Expense entry<br/>[add_expense.html]"]
  node_expense_edit["Expense editing<br/>[edit_expense.html]"]
end

subgraph group_insights["Expense insights and storage"]
  node_analytics["Analytics page<br/>[analytics.html]"]
  node_db_access["Database access<br/>[db.py]"]
  node_queries["Expense queries<br/>[queries.py]"]
  node_spendly_db[("Spendly database<br/>[spendly.db]")]
end

node_user(("User"))

node_user -.->|"uses"| node_flask
node_flask -.->|"renders"| node_landing
node_flask -.->|"renders"| node_registration
node_flask -.->|"renders"| node_login
node_flask -.->|"renders"| node_profile
node_flask -.->|"renders"| node_expense_entry
node_flask -.->|"renders"| node_expense_edit
node_flask -.->|"renders"| node_analytics
node_flask -.->|"uses"| node_queries
node_queries -.->|"uses"| node_db_access
node_db_access -.->|"accesses"| node_spendly_db

click node_flask "https://github.com/campusx-official/spendly/blob/main/app.py"
click node_landing "https://github.com/campusx-official/spendly/blob/main/templates/landing.html"
click node_registration "https://github.com/campusx-official/spendly/blob/main/templates/register.html"
click node_login "https://github.com/campusx-official/spendly/blob/main/templates/login.html"
click node_profile "https://github.com/campusx-official/spendly/blob/main/templates/profile.html"
click node_expense_entry "https://github.com/campusx-official/spendly/blob/main/templates/add_expense.html"
click node_expense_edit "https://github.com/campusx-official/spendly/blob/main/templates/edit_expense.html"
click node_analytics "https://github.com/campusx-official/spendly/blob/main/templates/analytics.html"
click node_db_access "https://github.com/campusx-official/spendly/blob/main/database/db.py"
click node_queries "https://github.com/campusx-official/spendly/blob/main/database/queries.py"
click node_spendly_db "https://github.com/campusx-official/spendly/blob/main/database/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_flask,node_landing,node_user toneBlue
class node_registration,node_login,node_profile toneAmber
class node_expense_entry,node_expense_edit toneMint
class node_analytics,node_db_access,node_queries,node_spendly_db toneRose
```

## Components

### Web application

- [Flask application](https://github.com/campusx-official/spendly/blob/main/app.py): `app.py`
- [Landing page](https://github.com/campusx-official/spendly/blob/main/templates/landing.html): `templates/landing.html`

### Accounts

- [Registration page](https://github.com/campusx-official/spendly/blob/main/templates/register.html): `templates/register.html`
- [Login page](https://github.com/campusx-official/spendly/blob/main/templates/login.html): `templates/login.html`
- [Profile page](https://github.com/campusx-official/spendly/blob/main/templates/profile.html): `templates/profile.html`

### Expense management

- [Expense entry](https://github.com/campusx-official/spendly/blob/main/templates/add_expense.html): `templates/add_expense.html`
- [Expense editing](https://github.com/campusx-official/spendly/blob/main/templates/edit_expense.html): `templates/edit_expense.html`

### Expense insights and storage

- [Analytics page](https://github.com/campusx-official/spendly/blob/main/templates/analytics.html): `templates/analytics.html`
- [Database access](https://github.com/campusx-official/spendly/blob/main/database/db.py): `database/db.py`
- [Expense queries](https://github.com/campusx-official/spendly/blob/main/database/queries.py): `database/queries.py`
- [Spendly database](https://github.com/campusx-official/spendly/blob/main/database/spendly.db): `database/spendly.db`

### Other components

- **User**

## Connections

- User → Flask application: uses
- Flask application → Landing page: renders
- Flask application → Registration page: renders
- Flask application → Login page: renders
- Flask application → Profile page: renders
- Flask application → Expense entry: renders
- Flask application → Expense editing: renders
- Flask application → Analytics page: renders
- Flask application → Expense queries: uses
- Expense queries → Database access: uses
- Database access → Spendly database: accesses
