# alessandrossxs/expense-tracker architecture

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

- Interactive diagram: https://gitdiagram.com/alessandrossxs/expense-tracker
- Repository: https://github.com/alessandrossxs/expense-tracker

## Overview

Expense Tracker is a Qt desktop app backed by SQLite, with a reusable C++ management layer for accounts, categories, transactions, filtering, statistics, and CSV export. The user workflow enters through the window, uses a transaction dialog for transaction details, and reaches persistence through ExpenseManager; the window also presents dashboard and category views. The README describes additional backend capabilities and notes the entry point is intentionally minimal. Some UI and database implementation excerpts are partial, so the graph limits detailed internal links to relationships visible in the excerpts or README.

Main entry points: [`src/MainWindow.cpp`](https://github.com/alessandrossxs/expense-tracker/blob/main/src/MainWindow.cpp) (Dashboard and views), [`src/ExpenseManager.cpp`](https://github.com/alessandrossxs/expense-tracker/blob/main/src/ExpenseManager.cpp) (Expense manager), [`src/Database.cpp`](https://github.com/alessandrossxs/expense-tracker/blob/main/src/Database.cpp) (Accounts, categories, transactions), [`src/Transaction.cpp`](https://github.com/alessandrossxs/expense-tracker/blob/main/src/Transaction.cpp) (Transaction model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop interface"]
  node_app["Qt application entry<br/>[main.cpp]"]
  node_window["Dashboard and views<br/>[MainWindow.cpp]"]
  node_dialog["Transaction dialog"]
end

subgraph group_domain["Expense domain"]
  node_transaction["Transaction model<br/>[Transaction.cpp]"]
end

subgraph group_services["Management services"]
  node_manager["Expense manager<br/>[ExpenseManager.cpp]"]
  node_statistics["Financial statistics<br/>[Statistics.cpp]"]
  node_csv["Filtered CSV export<br/>[ExpenseManager.cpp]"]
end

subgraph group_persistence["Persistence"]
  node_database[("Accounts, categories, transactions<br/>[Database.cpp]")]
end

node_user(("User"))
node_sqlite[("SQLite database")]
node_file["CSV file"]

node_user -->|"uses"| node_window
node_app -->|"shows"| node_window
node_window -->|"opens"| node_dialog
node_window -->|"manages data"| node_manager
node_dialog -->|"creates"| node_transaction
node_window -->|"displays"| node_transaction
node_manager -->|"delegates"| node_database
node_manager -->|"calculates"| node_statistics
node_manager -->|"exports"| node_csv
node_database -->|"reads and writes"| node_transaction
node_database -->|"stores data"| node_sqlite
node_csv -->|"writes"| node_file

click node_app "https://github.com/alessandrossxs/expense-tracker/blob/main/src/main.cpp"
click node_window "https://github.com/alessandrossxs/expense-tracker/blob/main/src/MainWindow.cpp"
click node_dialog "https://github.com/alessandrossxs/expense-tracker/blob/main/src/TransactionDialog.cpp"
click node_transaction "https://github.com/alessandrossxs/expense-tracker/blob/main/src/Transaction.cpp"
click node_manager "https://github.com/alessandrossxs/expense-tracker/blob/main/src/ExpenseManager.cpp"
click node_statistics "https://github.com/alessandrossxs/expense-tracker/blob/main/src/Statistics.cpp"
click node_csv "https://github.com/alessandrossxs/expense-tracker/blob/main/src/ExpenseManager.cpp"
click node_database "https://github.com/alessandrossxs/expense-tracker/blob/main/src/Database.cpp"

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_window,node_dialog,node_user toneBlue
class node_transaction,node_sqlite toneAmber
class node_manager,node_statistics,node_csv toneMint
class node_database toneRose
class node_file toneIndigo
```

## Components

### Desktop interface

- [Qt application entry](https://github.com/alessandrossxs/expense-tracker/blob/main/src/main.cpp): `src/main.cpp`
- [Dashboard and views](https://github.com/alessandrossxs/expense-tracker/blob/main/src/MainWindow.cpp): `src/MainWindow.cpp`
- [Transaction dialog](https://github.com/alessandrossxs/expense-tracker/blob/main/src/TransactionDialog.cpp): `src/TransactionDialog.cpp`

### Expense domain

- [Transaction model](https://github.com/alessandrossxs/expense-tracker/blob/main/src/Transaction.cpp): `src/Transaction.cpp`

### Management services

- [Expense manager](https://github.com/alessandrossxs/expense-tracker/blob/main/src/ExpenseManager.cpp): `src/ExpenseManager.cpp`
- [Financial statistics](https://github.com/alessandrossxs/expense-tracker/blob/main/src/Statistics.cpp): `src/Statistics.cpp`
- [Filtered CSV export](https://github.com/alessandrossxs/expense-tracker/blob/main/src/ExpenseManager.cpp): `src/ExpenseManager.cpp`

### Persistence

- [Accounts, categories, transactions](https://github.com/alessandrossxs/expense-tracker/blob/main/src/Database.cpp): `src/Database.cpp`

### Other components

- **User**
- **SQLite database**
- **CSV file**

## Connections

- User → Dashboard and views: uses (evidence: `README.md`)
- Qt application entry → Dashboard and views: shows (evidence: `src/main.cpp`)
- Dashboard and views → Transaction dialog: opens (evidence: `src/MainWindow.cpp`)
- Dashboard and views → Expense manager: manages data (evidence: `src/MainWindow.cpp`)
- Transaction dialog → Transaction model: creates (evidence: `src/TransactionDialog.cpp`)
- Dashboard and views → Transaction model: displays (evidence: `src/MainWindow.cpp`)
- Expense manager → Accounts, categories, transactions: delegates (evidence: `src/ExpenseManager.cpp`)
- Expense manager → Financial statistics: calculates (evidence: `src/ExpenseManager.cpp`)
- Expense manager → Filtered CSV export: exports (evidence: `src/ExpenseManager.cpp`)
- Accounts, categories, transactions → Transaction model: reads and writes (evidence: `src/Database.cpp`)
- Accounts, categories, transactions → SQLite database: stores data (evidence: `README.md`)
- Filtered CSV export → CSV file: writes (evidence: `src/ExpenseManager.cpp`)
