# rotichbrimin/expense_tracker architecture

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

- Interactive diagram: https://gitdiagram.com/rotichbrimin/expense_tracker
- Repository: https://github.com/rotichbrimin/expense_tracker

## Overview

This is a command-line expense tracker. The user selects actions from a repeating menu; the app loads expenses from CSV, operates on the in-memory list, and saves changes. Its main capabilities are expense management, search, totals and budget checks, summaries, and sorting. The excerpts show the main dispatch and key module calls; the graph does not infer links for unsampled implementation details.

Main entry points: [`main.py`](https://github.com/rotichbrimin/expense_tracker/blob/main/main.py) (Main menu), [`expenses.py`](https://github.com/rotichbrimin/expense_tracker/blob/main/expenses.py) (Expense operations), [`analytics.py`](https://github.com/rotichbrimin/expense_tracker/blob/main/analytics.py) (Totals and budgets), [`storage.py`](https://github.com/rotichbrimin/expense_tracker/blob/main/storage.py) (Expenses CSV)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI orchestration"]
  node_menu["Main menu<br/>[main.py]"]
end

subgraph group_management["Expense management"]
  node_expense_ops["Expense operations<br/>[expenses.py]"]
  node_csv_store[("Expenses CSV<br/>[storage.py]")]
end

subgraph group_insights["Search and insights"]
  node_search["Expense search<br/>[search.py]"]
  node_analytics["Totals and budgets<br/>[analytics.py]"]
  node_summary["Category summary<br/>[analytics.py]"]
  node_sorting["Expense sorting<br/>[analytics.py]"]
end

node_user(("User"))

node_user -->|"chooses actions"| node_menu
node_menu -->|"loads expenses"| node_csv_store
node_menu -->|"manages expenses"| node_expense_ops
node_menu -->|"searches expenses"| node_search
node_menu -->|"checks totals"| node_analytics
node_menu -->|"views summary"| node_summary
node_menu -->|"sorts expenses"| node_sorting
node_menu -->|"saves expenses"| node_csv_store
node_expense_ops -->|"saves changes"| node_csv_store
node_search -->|"renders matches"| node_expense_ops
node_analytics -->|"checks monthly budget"| node_expense_ops
node_analytics -->|"renders filtered entries"| node_expense_ops
node_summary -->|"prints breakdown"| node_menu

click node_menu "https://github.com/rotichbrimin/expense_tracker/blob/main/main.py"
click node_expense_ops "https://github.com/rotichbrimin/expense_tracker/blob/main/expenses.py"
click node_search "https://github.com/rotichbrimin/expense_tracker/blob/main/search.py"
click node_analytics "https://github.com/rotichbrimin/expense_tracker/blob/main/analytics.py"
click node_summary "https://github.com/rotichbrimin/expense_tracker/blob/main/analytics.py"
click node_sorting "https://github.com/rotichbrimin/expense_tracker/blob/main/analytics.py"
click node_csv_store "https://github.com/rotichbrimin/expense_tracker/blob/main/storage.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_menu,node_user toneBlue
class node_expense_ops,node_csv_store toneAmber
class node_search,node_analytics,node_summary,node_sorting toneMint
```

## Components

### CLI orchestration

- [Main menu](https://github.com/rotichbrimin/expense_tracker/blob/main/main.py): `main.py`

### Expense management

- [Expense operations](https://github.com/rotichbrimin/expense_tracker/blob/main/expenses.py): `expenses.py`
- [Expenses CSV](https://github.com/rotichbrimin/expense_tracker/blob/main/storage.py): `storage.py`

### Search and insights

- [Expense search](https://github.com/rotichbrimin/expense_tracker/blob/main/search.py): `search.py`
- [Totals and budgets](https://github.com/rotichbrimin/expense_tracker/blob/main/analytics.py): `analytics.py`
- [Category summary](https://github.com/rotichbrimin/expense_tracker/blob/main/analytics.py): `analytics.py`
- [Expense sorting](https://github.com/rotichbrimin/expense_tracker/blob/main/analytics.py): `analytics.py`

### Other components

- **User**

## Connections

- User → Main menu: chooses actions (evidence: `main.py`)
- Main menu → Expenses CSV: loads expenses (evidence: `main.py`)
- Main menu → Expense operations: manages expenses (evidence: `main.py`)
- Main menu → Expense search: searches expenses (evidence: `main.py`)
- Main menu → Totals and budgets: checks totals (evidence: `main.py`)
- Main menu → Category summary: views summary (evidence: `main.py`)
- Main menu → Expense sorting: sorts expenses (evidence: `main.py`)
- Main menu → Expenses CSV: saves expenses (evidence: `main.py`)
- Expense operations → Expenses CSV: saves changes (evidence: `expenses.py`)
- Expense search → Expense operations: renders matches (evidence: `search.py`)
- Totals and budgets → Expense operations: checks monthly budget (evidence: `analytics.py`)
- Totals and budgets → Expense operations: renders filtered entries (evidence: `analytics.py`)
- Category summary → Main menu: prints breakdown (evidence: `main.py`)
