# shivshankarshilvant/personal_expense_tracker architecture

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

- Interactive diagram: https://gitdiagram.com/shivshankarshilvant/personal_expense_tracker
- Repository: https://github.com/shivshankarshilvant/personal_expense_tracker

## Overview

##### Project type and purpose
- This is a small full-stack monolithic web application (“personal_expense_tracker”) built with Python and Flask.
- It provides CRUD operations on expenses, renders HTML front-end pages (Jinja2 templates), stores data in a local SQLite database, and includes an analytics script.

##### File structure
Top level:
- app.py        – main Flask application (routes/controllers)
- models.py     – data model definitions (ORM classes)
- analysis.py   – analytics module (data‐processing scripts)
- expenses.db   – SQLite database
- requirements.txt – dependency list
- README.md     – project title/description
Directories:
- templates/    – Jinja2 HTML views (index, add/edit forms, analytics, error page, base layout)
- static/       – CSS styles (styles.css)

##### README for additional insights
- Only a project title is provided, so rely mainly on the code structure to infer the architecture.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Client Layer"
        Browser["Browser"]:::client
    end

    subgraph "Presentation Layer"
        Controllers["Flask Controllers (app.py)"]:::appComponents
        TemplatesIndex["index.html"]:::template
        TemplatesAdd["add_expense.html"]:::template
        TemplatesEdit["edit_expense.html"]:::template
        TemplatesAnalytics["analytics.html"]:::template
        TemplatesBase["base.html"]:::template
        Templates404["404.html"]:::template
        StaticCSS["styles.css"]:::static
    end

    subgraph "Business Logic & Data Layer"
        Models["Data Models (models.py)"]:::appComponents
        Analytics["Analytics Module (analysis.py)"]:::appComponents
    end

    subgraph "Project Metadata"
        README["README.md"]:::static
        Requirements["requirements.txt"]:::static
    end

    Database["SQLite Database (expenses.db)"]:::db

    Browser -->|"HTTP Request"| Controllers
    Controllers -->|"Render"| TemplatesIndex
    Controllers -->|"Render"| TemplatesAdd
    Controllers -->|"Render"| TemplatesEdit
    Controllers -->|"Render"| TemplatesAnalytics
    Controllers -->|"Serve CSS"| StaticCSS
    Controllers -->|"CRUD Operations"| Models
    Models -->|"Read/Write"| Database
    Analytics -->|"Query"| Database
    Controllers -->|"Invoke Analytics"| Analytics
    Analytics -->|"Return Data"| Controllers
    Controllers -->|"HTTP Response"| Browser

    click Controllers "https://github.com/shivshankarshilvant/personal_expense_tracker/blob/main/app.py"
    click Models "https://github.com/shivshankarshilvant/personal_expense_tracker/blob/main/models.py"
    click Analytics "https://github.com/shivshankarshilvant/personal_expense_tracker/blob/main/analysis.py"
    click Database "https://github.com/shivshankarshilvant/personal_expense_tracker/blob/main/expenses.db"
    click TemplatesIndex "https://github.com/shivshankarshilvant/personal_expense_tracker/blob/main/templates/index.html"
    click TemplatesAdd "https://github.com/shivshankarshilvant/personal_expense_tracker/blob/main/templates/add_expense.html"
    click TemplatesEdit "https://github.com/shivshankarshilvant/personal_expense_tracker/blob/main/templates/edit_expense.html"
    click TemplatesAnalytics "https://github.com/shivshankarshilvant/personal_expense_tracker/blob/main/templates/analytics.html"
    click TemplatesBase "https://github.com/shivshankarshilvant/personal_expense_tracker/blob/main/templates/base.html"
    click Templates404 "https://github.com/shivshankarshilvant/personal_expense_tracker/blob/main/templates/404.html"
    click StaticCSS "https://github.com/shivshankarshilvant/personal_expense_tracker/blob/main/static/styles.css"
    click README "https://github.com/shivshankarshilvant/personal_expense_tracker/blob/main/README.md"
    click Requirements "https://github.com/shivshankarshilvant/personal_expense_tracker/blob/main/requirements.txt"

    classDef client fill:#FFD700,stroke:#333,stroke-width:1px
    classDef appComponents fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef db fill:#90EE90,stroke:#333,stroke-width:1px
    classDef template fill:#FFFFE0,stroke:#333,stroke-width:1px
    classDef static fill:#D3D3D3,stroke:#333,stroke-width:1px
```
