# raesujan/expenses-tracker architecture

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

- Interactive diagram: https://gitdiagram.com/raesujan/expenses-tracker
- Repository: https://github.com/raesujan/expenses-tracker

## Overview

Expenses Tracker is a raylib desktop app for registering or logging in, then recording and reviewing personal finances. Its main workflow moves through account access to a menu, transaction entry, validation and persistence; users can also manage categories, view their balance and see a current-month summary. The README describes these screens and model classes, while the available main.cpp excerpts show the app’s screen dispatch and parts of transaction entry. Unexcerpted feature links below rely on README statements; login.cpp appears to be a separate console demo.

Main entry points: [`main.cpp`](https://github.com/raesujan/expenses-tracker/blob/main/main.cpp) (Main menu), [`user.dat`](https://github.com/raesujan/expenses-tracker/blob/main/user.dat) (Account data), [`categories.dat`](https://github.com/raesujan/expenses-tracker/blob/main/categories.dat) (Category data), [`transactions.dat`](https://github.com/raesujan/expenses-tracker/blob/main/transactions.dat) (Transaction data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop app"]
  node_app_runtime["App runtime<br/>[main.cpp]"]
  node_account_access["Account access<br/>[main.cpp]"]
  node_main_menu["Main menu<br/>[main.cpp]"]
  node_transaction_entry["Transaction entry<br/>[main.cpp]"]
  node_budget_view["Budget view<br/>[main.cpp]"]
  node_category_views["Category views<br/>[main.cpp]"]
  node_monthly_summary["Monthly summary<br/>[main.cpp]"]
end

subgraph group_domain["Finance domain"]
  node_input_validation["Input validation<br/>[main.cpp]"]
  node_user_account["User account<br/>[main.cpp]"]
  node_category_manager["Category manager<br/>[main.cpp]"]
  node_transaction_manager["Transaction manager<br/>[main.cpp]"]
end

subgraph group_storage["Local data"]
  node_user_data[("Account data<br/>[user.dat]")]
  node_category_data[("Category data<br/>[categories.dat]")]
  node_transaction_data[("Transaction data<br/>[transactions.dat]")]
end

node_user(("User"))
node_raylib["raylib"]

node_user -->|"uses"| node_app_runtime
node_app_runtime -->|"starts at"| node_account_access
node_app_runtime -->|"dispatches screens"| node_main_menu
node_user -->|"registers or logs in"| node_account_access
node_account_access -->|"authenticates"| node_user_account
node_user_account -->|"reads and writes"| node_user_data
node_main_menu -->|"opens"| node_transaction_entry
node_main_menu -->|"opens"| node_budget_view
node_main_menu -->|"opens"| node_category_views
node_main_menu -->|"opens"| node_monthly_summary
node_transaction_entry -->|"validates fields"| node_input_validation
node_transaction_entry -->|"uses categories"| node_category_manager
node_transaction_entry -->|"records transaction"| node_transaction_manager
node_category_views -->|"browses or edits"| node_category_manager
node_transaction_manager -->|"reads and writes"| node_transaction_data
node_category_manager -->|"reads and writes"| node_category_data
node_budget_view -->|"shows total"| node_transaction_manager
node_monthly_summary -->|"summarizes month"| node_transaction_manager
node_app_runtime -->|"draws window"| node_raylib

click node_app_runtime "https://github.com/raesujan/expenses-tracker/blob/main/main.cpp"
click node_account_access "https://github.com/raesujan/expenses-tracker/blob/main/main.cpp"
click node_main_menu "https://github.com/raesujan/expenses-tracker/blob/main/main.cpp"
click node_transaction_entry "https://github.com/raesujan/expenses-tracker/blob/main/main.cpp"
click node_budget_view "https://github.com/raesujan/expenses-tracker/blob/main/main.cpp"
click node_category_views "https://github.com/raesujan/expenses-tracker/blob/main/main.cpp"
click node_monthly_summary "https://github.com/raesujan/expenses-tracker/blob/main/main.cpp"
click node_input_validation "https://github.com/raesujan/expenses-tracker/blob/main/main.cpp"
click node_user_account "https://github.com/raesujan/expenses-tracker/blob/main/main.cpp"
click node_category_manager "https://github.com/raesujan/expenses-tracker/blob/main/main.cpp"
click node_transaction_manager "https://github.com/raesujan/expenses-tracker/blob/main/main.cpp"
click node_user_data "https://github.com/raesujan/expenses-tracker/blob/main/user.dat"
click node_category_data "https://github.com/raesujan/expenses-tracker/blob/main/categories.dat"
click node_transaction_data "https://github.com/raesujan/expenses-tracker/blob/main/transactions.dat"

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_runtime,node_account_access,node_main_menu,node_transaction_entry,node_budget_view,node_category_views,node_monthly_summary,node_user toneBlue
class node_input_validation,node_user_account,node_category_manager,node_transaction_manager toneAmber
class node_user_data,node_category_data,node_transaction_data toneMint
class node_raylib toneIndigo
```

## Components

### Desktop app

- [App runtime](https://github.com/raesujan/expenses-tracker/blob/main/main.cpp): `main.cpp`
- [Account access](https://github.com/raesujan/expenses-tracker/blob/main/main.cpp): `main.cpp`
- [Main menu](https://github.com/raesujan/expenses-tracker/blob/main/main.cpp): `main.cpp`
- [Transaction entry](https://github.com/raesujan/expenses-tracker/blob/main/main.cpp): `main.cpp`
- [Budget view](https://github.com/raesujan/expenses-tracker/blob/main/main.cpp): `main.cpp`
- [Category views](https://github.com/raesujan/expenses-tracker/blob/main/main.cpp): `main.cpp`
- [Monthly summary](https://github.com/raesujan/expenses-tracker/blob/main/main.cpp): `main.cpp`

### Finance domain

- [Input validation](https://github.com/raesujan/expenses-tracker/blob/main/main.cpp): `main.cpp`
- [User account](https://github.com/raesujan/expenses-tracker/blob/main/main.cpp): `main.cpp`
- [Category manager](https://github.com/raesujan/expenses-tracker/blob/main/main.cpp): `main.cpp`
- [Transaction manager](https://github.com/raesujan/expenses-tracker/blob/main/main.cpp): `main.cpp`

### Local data

- [Account data](https://github.com/raesujan/expenses-tracker/blob/main/user.dat): `user.dat`
- [Category data](https://github.com/raesujan/expenses-tracker/blob/main/categories.dat): `categories.dat`
- [Transaction data](https://github.com/raesujan/expenses-tracker/blob/main/transactions.dat): `transactions.dat`

### Other components

- **User**
- **raylib**

## Connections

- User → App runtime: uses (evidence: `readme.md`)
- App runtime → Account access: starts at (evidence: `main.cpp`)
- App runtime → Main menu: dispatches screens (evidence: `main.cpp`)
- User → Account access: registers or logs in (evidence: `readme.md`)
- Account access → User account: authenticates (evidence: `readme.md`)
- User account → Account data: reads and writes (evidence: `readme.md`)
- Main menu → Transaction entry: opens (evidence: `readme.md`)
- Main menu → Budget view: opens (evidence: `readme.md`)
- Main menu → Category views: opens (evidence: `readme.md`)
- Main menu → Monthly summary: opens (evidence: `readme.md`)
- Transaction entry → Input validation: validates fields (evidence: `readme.md`)
- Transaction entry → Category manager: uses categories (evidence: `readme.md`)
- Transaction entry → Transaction manager: records transaction (evidence: `main.cpp`)
- Category views → Category manager: browses or edits (evidence: `readme.md`)
- Transaction manager → Transaction data: reads and writes (evidence: `readme.md`)
- Category manager → Category data: reads and writes (evidence: `readme.md`)
- Budget view → Transaction manager: shows total (evidence: `readme.md`)
- Monthly summary → Transaction manager: summarizes month (evidence: `readme.md`)
- App runtime → raylib: draws window (evidence: `readme.md`)
