# lucifa9051799500-sys/spendwise architecture

> Architecture diagram of the GitHub repository lucifa9051799500-sys/spendwise, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lucifa9051799500-sys/spendwise
- Repository: https://github.com/lucifa9051799500-sys/spendwise

## Overview

Spendwise is a Flask personal-finance tracker. Users register or log in, then record income and expenses and view an income/expense balance on the dashboard; they can also clear income or log out. The sampled app.py contains the route handlers and PostgreSQL access, while the templates provide the page layer. The tree includes reports, transactions, and profile templates, but the sampled app has no routes that render them, so their wiring is uncertain.

Main entry points: [`app.py`](https://github.com/lucifa9051799500-sys/spendwise/blob/main/app.py) (Flask app), [`templates/home.html`](https://github.com/lucifa9051799500-sys/spendwise/blob/main/templates/home.html) (Home page), [`templates/register.html`](https://github.com/lucifa9051799500-sys/spendwise/blob/main/templates/register.html) (Registration page), [`templates/login.html`](https://github.com/lucifa9051799500-sys/spendwise/blob/main/templates/login.html) (Login page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_home["Home page<br/>[home.html]"]
  node_register["Registration page<br/>[register.html]"]
  node_login["Login page<br/>[login.html]"]
  node_dashboard["Dashboard page<br/>[dashboard.html]"]
  node_add_expense["Add expense page<br/>[add_expense.html]"]
  node_add_income["Add income page<br/>[add_income.html]"]
  node_reports["Reports page<br/>[reports.html]"]
  node_transactions["Transactions page<br/>[transactions.html]"]
  node_profile["Profile page<br/>[profile.html]"]
end

subgraph group_app["Application routes"]
  node_flask["Flask app<br/>[app.py]"]
end

subgraph group_data["Finance data"]
  node_postgres[("PostgreSQL<br/>[app.py]")]
end

node_user(("User"))

node_user -->|"submits requests"| node_flask
node_flask -->|"renders"| node_home
node_flask -->|"renders"| node_register
node_flask -->|"renders"| node_login
node_flask -->|"renders"| node_dashboard
node_flask -->|"renders"| node_add_expense
node_flask -->|"renders"| node_add_income
node_flask -->|"reads and writes"| node_postgres

click node_flask "https://github.com/lucifa9051799500-sys/spendwise/blob/main/app.py"
click node_home "https://github.com/lucifa9051799500-sys/spendwise/blob/main/templates/home.html"
click node_register "https://github.com/lucifa9051799500-sys/spendwise/blob/main/templates/register.html"
click node_login "https://github.com/lucifa9051799500-sys/spendwise/blob/main/templates/login.html"
click node_dashboard "https://github.com/lucifa9051799500-sys/spendwise/blob/main/templates/dashboard.html"
click node_add_expense "https://github.com/lucifa9051799500-sys/spendwise/blob/main/templates/add_expense.html"
click node_add_income "https://github.com/lucifa9051799500-sys/spendwise/blob/main/templates/add_income.html"
click node_reports "https://github.com/lucifa9051799500-sys/spendwise/blob/main/templates/reports.html"
click node_transactions "https://github.com/lucifa9051799500-sys/spendwise/blob/main/templates/transactions.html"
click node_profile "https://github.com/lucifa9051799500-sys/spendwise/blob/main/templates/profile.html"
click node_postgres "https://github.com/lucifa9051799500-sys/spendwise/blob/main/app.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_home,node_register,node_login,node_dashboard,node_add_expense,node_add_income,node_reports,node_transactions,node_profile,node_user toneBlue
class node_flask toneAmber
class node_postgres toneMint
```

## Components

### Web interface

- [Home page](https://github.com/lucifa9051799500-sys/spendwise/blob/main/templates/home.html): `templates/home.html`
- [Registration page](https://github.com/lucifa9051799500-sys/spendwise/blob/main/templates/register.html): `templates/register.html`
- [Login page](https://github.com/lucifa9051799500-sys/spendwise/blob/main/templates/login.html): `templates/login.html`
- [Dashboard page](https://github.com/lucifa9051799500-sys/spendwise/blob/main/templates/dashboard.html): `templates/dashboard.html`
- [Add expense page](https://github.com/lucifa9051799500-sys/spendwise/blob/main/templates/add_expense.html): `templates/add_expense.html`
- [Add income page](https://github.com/lucifa9051799500-sys/spendwise/blob/main/templates/add_income.html): `templates/add_income.html`
- [Reports page](https://github.com/lucifa9051799500-sys/spendwise/blob/main/templates/reports.html): `templates/reports.html`
- [Transactions page](https://github.com/lucifa9051799500-sys/spendwise/blob/main/templates/transactions.html): `templates/transactions.html`
- [Profile page](https://github.com/lucifa9051799500-sys/spendwise/blob/main/templates/profile.html): `templates/profile.html`

### Application routes

- [Flask app](https://github.com/lucifa9051799500-sys/spendwise/blob/main/app.py): `app.py`

### Finance data

- [PostgreSQL](https://github.com/lucifa9051799500-sys/spendwise/blob/main/app.py): `app.py`

### Other components

- **User**

## Connections

- User → Flask app: submits requests
- Flask app → Home page: renders
- Flask app → Registration page: renders
- Flask app → Login page: renders
- Flask app → Dashboard page: renders
- Flask app → Add expense page: renders
- Flask app → Add income page: renders
- Flask app → PostgreSQL: reads and writes
