# alvix11/expense-tracker-cli architecture

> Architecture diagram of the GitHub repository alvix11/expense-tracker-cli, 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/alvix11/expense-tracker-cli
- Repository: https://github.com/alvix11/expense-tracker-cli

## Overview

Expense Tracker is a command-line application for creating, editing, deleting, listing, and summarizing expenses. The main workflow parses a command, dispatches it to the expense manager, and reads or updates JSON-backed records; add and update also obtain the current date and validate input. Listing and summaries display results in the terminal. The README documents monthly and general summaries, both implemented in the manager. The tree names the JSON file as expense.json, while the source configures its path as a relative filename; storage wiring is shown at that level.

Main entry points: [`expense_manager.py`](https://github.com/alvix11/expense-tracker-cli/blob/main/expense_manager.py) (Expense manager), [`expense_tracker.py`](https://github.com/alvix11/expense-tracker-cli/blob/main/expense_tracker.py) (CLI entry point), [`helpers.py`](https://github.com/alvix11/expense-tracker-cli/blob/main/helpers.py) (Expense file access), [`utils.py`](https://github.com/alvix11/expense-tracker-cli/blob/main/utils.py) (JSON operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Command line"]
  node_app["CLI entry point<br/>[expense_tracker.py]"]
  node_parser["Command parser<br/>[settings.py]"]
end

subgraph group_domain["Expense management"]
  node_manager["Expense manager<br/>[expense_manager.py]"]
end

subgraph group_support["Persistence and support"]
  node_validation["Input validation<br/>[helpers.py]"]
  node_expense_io["Expense file access<br/>[helpers.py]"]
  node_date["Date handling<br/>[utils.py]"]
  node_json_ops["JSON operations<br/>[utils.py]"]
end

node_user(("CLI user"))
node_store[("Expense JSON")]
node_terminal["Terminal output"]

node_user -->|"runs commands"| node_app
node_app -->|"parses arguments"| node_parser
node_app -->|"dispatches command"| node_manager
node_manager -->|"validates input"| node_validation
node_manager -->|"gets date"| node_date
node_manager -->|"loads and saves"| node_expense_io
node_expense_io -->|"reads and writes"| node_json_ops
node_json_ops -->|"accesses JSON"| node_store
node_manager -->|"prints results"| node_terminal
node_terminal -->|"displays output"| node_user

click node_app "https://github.com/alvix11/expense-tracker-cli/blob/main/expense_tracker.py"
click node_parser "https://github.com/alvix11/expense-tracker-cli/blob/main/settings.py"
click node_manager "https://github.com/alvix11/expense-tracker-cli/blob/main/expense_manager.py"
click node_validation "https://github.com/alvix11/expense-tracker-cli/blob/main/helpers.py"
click node_expense_io "https://github.com/alvix11/expense-tracker-cli/blob/main/helpers.py"
click node_date "https://github.com/alvix11/expense-tracker-cli/blob/main/utils.py"
click node_json_ops "https://github.com/alvix11/expense-tracker-cli/blob/main/utils.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_app,node_parser,node_user toneBlue
class node_manager,node_store toneAmber
class node_validation,node_expense_io,node_date,node_json_ops toneMint
class node_terminal toneIndigo
```

## Components

### Command line

- [CLI entry point](https://github.com/alvix11/expense-tracker-cli/blob/main/expense_tracker.py): `expense_tracker.py`
- [Command parser](https://github.com/alvix11/expense-tracker-cli/blob/main/settings.py): `settings.py`

### Expense management

- [Expense manager](https://github.com/alvix11/expense-tracker-cli/blob/main/expense_manager.py): `expense_manager.py`

### Persistence and support

- [Input validation](https://github.com/alvix11/expense-tracker-cli/blob/main/helpers.py): `helpers.py`
- [Expense file access](https://github.com/alvix11/expense-tracker-cli/blob/main/helpers.py): `helpers.py`
- [Date handling](https://github.com/alvix11/expense-tracker-cli/blob/main/utils.py): `utils.py`
- [JSON operations](https://github.com/alvix11/expense-tracker-cli/blob/main/utils.py): `utils.py`

### Other components

- **CLI user**
- **Expense JSON**
- **Terminal output**

## Connections

- CLI user → CLI entry point: runs commands
- CLI entry point → Command parser: parses arguments
- CLI entry point → Expense manager: dispatches command
- Expense manager → Input validation: validates input
- Expense manager → Date handling: gets date
- Expense manager → Expense file access: loads and saves
- Expense file access → JSON operations: reads and writes
- JSON operations → Expense JSON: accesses JSON
- Expense manager → Terminal output: prints results
- Terminal output → CLI user: displays output
