# bhutsipho/fintech architecture

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

- Interactive diagram: https://gitdiagram.com/bhutsipho/fintech
- Repository: https://github.com/bhutsipho/fintech

## Overview

This is a Flask personal-finance tracker. Users register or sign in, maintain financial records, review summaries and charts, and manage their profile; the README also describes contact/feedback and session timeout capabilities. The map separates web workflows, record management, analytics, and persistence. Some route implementations are unsampled, so those documented capabilities are shown without inferred call-level links; the excerpts also reveal two distinct SQLite access paths.

Main entry points: [`main.py`](https://github.com/bhutsipho/fintech/blob/main/main.py) (Flask routes), [`templates/home.html`](https://github.com/bhutsipho/fintech/blob/main/templates/home.html) (Home overview), [`support.py`](https://github.com/bhutsipho/fintech/blob/main/support.py) (Analytics helpers), [`templates/analysis.html`](https://github.com/bhutsipho/fintech/blob/main/templates/analysis.html) (Analysis page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web access"]
  node_app_routes["Flask routes<br/>[main.py]"]
  node_auth["Account access<br/>[main.py]"]
  node_profile["Profile management<br/>[profile.html]"]
  node_contact["Contact and feedback<br/>[contact.html]"]
  node_browser_ui["Interactive UI<br/>[script.js]"]
end

subgraph group_records["Financial records"]
  node_home_view["Home overview<br/>[home.html]"]
  node_expense_records["Expense records<br/>[main.py]"]
  node_stock_records["Stock records<br/>[main.py]"]
end

subgraph group_insights["Analysis and insights"]
  node_analysis_view["Analysis page<br/>[analysis.html]"]
  node_analytics["Analytics helpers<br/>[support.py]"]
end

subgraph group_persistence["Persistence"]
  node_orm_store[("SQLAlchemy store<br/>[main.py]")]
  node_query_helpers["SQLite query helpers<br/>[support.py]"]
  node_sqlite_store[("SQLite database<br/>[expense.db]")]
end

node_user(("User"))

node_user -->|"uses"| node_app_routes
node_app_routes -->|"routes account"| node_auth
node_auth -->|"queries credentials"| node_query_helpers
node_auth -->|"redirects after login"| node_home_view
node_app_routes -->|"renders overview"| node_home_view
node_app_routes -->|"renders analysis"| node_analysis_view
node_app_routes -->|"renders profile"| node_profile
node_app_routes -.->|"serves contact"| node_contact
node_home_view -.->|"displays records"| node_expense_records
node_app_routes -->|"handles stock"| node_stock_records
node_app_routes -->|"queries and saves"| node_orm_store
node_app_routes -->|"builds charts"| node_analytics
node_analytics -.->|"provides charts"| node_analysis_view
node_query_helpers -->|"reads and writes"| node_sqlite_store
node_browser_ui -.->|"updates controls"| node_home_view

click node_app_routes "https://github.com/bhutsipho/fintech/blob/main/main.py"
click node_auth "https://github.com/bhutsipho/fintech/blob/main/main.py"
click node_profile "https://github.com/bhutsipho/fintech/blob/main/templates/profile.html"
click node_contact "https://github.com/bhutsipho/fintech/blob/main/templates/contact.html"
click node_home_view "https://github.com/bhutsipho/fintech/blob/main/templates/home.html"
click node_expense_records "https://github.com/bhutsipho/fintech/blob/main/main.py"
click node_stock_records "https://github.com/bhutsipho/fintech/blob/main/main.py"
click node_analysis_view "https://github.com/bhutsipho/fintech/blob/main/templates/analysis.html"
click node_analytics "https://github.com/bhutsipho/fintech/blob/main/support.py"
click node_browser_ui "https://github.com/bhutsipho/fintech/blob/main/static/js/script.js"
click node_orm_store "https://github.com/bhutsipho/fintech/blob/main/main.py"
click node_query_helpers "https://github.com/bhutsipho/fintech/blob/main/support.py"
click node_sqlite_store "https://github.com/bhutsipho/fintech/blob/main/expense.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_app_routes,node_auth,node_profile,node_contact,node_browser_ui,node_user toneBlue
class node_home_view,node_expense_records,node_stock_records toneAmber
class node_analysis_view,node_analytics toneMint
class node_orm_store,node_query_helpers,node_sqlite_store toneRose
```

## Components

### Web access

- [Flask routes](https://github.com/bhutsipho/fintech/blob/main/main.py): `main.py`
- [Account access](https://github.com/bhutsipho/fintech/blob/main/main.py): `main.py`
- [Profile management](https://github.com/bhutsipho/fintech/blob/main/templates/profile.html): `templates/profile.html`
- [Contact and feedback](https://github.com/bhutsipho/fintech/blob/main/templates/contact.html): `templates/contact.html`
- [Interactive UI](https://github.com/bhutsipho/fintech/blob/main/static/js/script.js): `static/js/script.js`

### Financial records

- [Home overview](https://github.com/bhutsipho/fintech/blob/main/templates/home.html): `templates/home.html`
- [Expense records](https://github.com/bhutsipho/fintech/blob/main/main.py): `main.py`
- [Stock records](https://github.com/bhutsipho/fintech/blob/main/main.py): `main.py`

### Analysis and insights

- [Analysis page](https://github.com/bhutsipho/fintech/blob/main/templates/analysis.html): `templates/analysis.html`
- [Analytics helpers](https://github.com/bhutsipho/fintech/blob/main/support.py): `support.py`

### Persistence

- [SQLAlchemy store](https://github.com/bhutsipho/fintech/blob/main/main.py): `main.py`
- [SQLite query helpers](https://github.com/bhutsipho/fintech/blob/main/support.py): `support.py`
- [SQLite database](https://github.com/bhutsipho/fintech/blob/main/expense.db): `expense.db`

### Other components

- **User**

## Connections

- User → Flask routes: uses (evidence: `README.md`)
- Flask routes → Account access: routes account (evidence: `main.py`)
- Account access → SQLite query helpers: queries credentials (evidence: `main.py`)
- Account access → Home overview: redirects after login (evidence: `main.py`)
- Flask routes → Home overview: renders overview (evidence: `main.py`)
- Flask routes → Analysis page: renders analysis (evidence: `main.py`)
- Flask routes → Profile management: renders profile (evidence: `main.py`)
- Flask routes → Contact and feedback: serves contact (evidence: `README.md`)
- Home overview → Expense records: displays records (evidence: `README.md`)
- Flask routes → Stock records: handles stock (evidence: `main.py`)
- Flask routes → SQLAlchemy store: queries and saves (evidence: `main.py`)
- Flask routes → Analytics helpers: builds charts (evidence: `main.py`)
- Analytics helpers → Analysis page: provides charts (evidence: `README.md`)
- SQLite query helpers → SQLite database: reads and writes (evidence: `support.py`)
- Interactive UI → Home overview: updates controls (evidence: `README.md`)
