# sreemenon27/financetracker architecture

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

- Interactive diagram: https://gitdiagram.com/sreemenon27/financetracker
- Repository: https://github.com/sreemenon27/financetracker

## Overview

##### Project Type and Purpose
- This is a CLI application (“Finance Tracker”) written in Python, designed for managing personal finances by letting users add income/expense transactions, view reports, and persist data to a JSON file.
- Its primary use case is a simple, single-user terminal tool that reads/writes a local JSON store and uses modular Python code.

##### File Structure
Top-level:
- main.py (entry point invoking the CLI)
- Data/records.json (persistent store for transactions)
- Tracker/
– config.py (defines income/expense categories)
– tracker.py (core business logic encapsulated in a Tracker class)
- __init__.py files (mark Python packages)
Patterns & clues:
- Modular design separating configuration, logic, and I/O
- File-based persistence (no external database)
- CLI interaction driven by main.py → Tracker methods

##### README for Additional Insights
- Confirms use of JSON file operations, private methods for load/save, @property for balance, timestamping, input validation.
- No external services; purely local.
- Future enhancement pointers (monthly summaries, CSV/PDF exports, GUI) suggest potential extension points.

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "UI Layer"
        CLI["CLI Entry Point\n(main.py)"]:::ui
    end

    subgraph "Business Logic Layer"
        Tracker["Tracker Service\n(tracker.py)"]:::logic
    end

    subgraph "Config Layer"
        Config["Config Module\n(config.py)"]:::config
    end

    subgraph "Persistence Layer"
        DataStore["JSON Store\n(records.json)\n(fields: id, type, category, amount, timestamp)"]:::persistence
    end

    subgraph "Extension Points"
        CSV["CSV Exporter\n(future)"]:::extension
    end

    CLI -->|"calls add/view transactions"| Tracker
    Tracker -->|"uses categories"| Config
    Tracker -->|"loads/saves JSON"| DataStore
    Tracker -->|"returns report data"| CLI
    CSV -.->|"could integrate"| Tracker

    click CLI "https://github.com/sreemenon27/financetracker/blob/main/main.py"
    click Tracker "https://github.com/sreemenon27/financetracker/blob/main/Tracker/tracker.py"
    click Config "https://github.com/sreemenon27/financetracker/blob/main/Tracker/config.py"
    click DataStore "https://github.com/sreemenon27/financetracker/blob/main/Data/records.json"

    classDef ui fill:#DAE8FC,stroke:#0B78E3,color:#000
    classDef logic fill:#D5E8D4,stroke:#82B366,color:#000
    classDef config fill:#E8E8E8,stroke:#A6A6A6,color:#000
    classDef persistence fill:#FFE6CC,stroke:#D79B00,color:#000
    classDef extension fill:#F8CECC,stroke:#B85450,color:#000
```
