# dava2310/expense-tracker architecture

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

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

## Overview

Saldo is a Laravel personal-finance application: users register, maintain currencies and accounts, categorize income and expenses, and review financial activity. The sampled controllers show account, currency, expense, and income handling; account and expense models provide balance and reporting behavior. The tree also shows category management, a dashboard, and profile pages, but their controller implementations and web-route wiring were not sampled, so those connections are omitted. The README describes an educational Laravel starter pack, while the application-specific source tree supplies the finance workflow.

Main entry points: [`app/Models/Account.php`](https://github.com/dava2310/expense-tracker/blob/main/app/Models/Account.php) (Account model), [`app/Models/User.php`](https://github.com/dava2310/expense-tracker/blob/main/app/Models/User.php) (User model), [`app/Http/Controllers/Userzone/IncomeController.php`](https://github.com/dava2310/expense-tracker/blob/main/app/Http/Controllers/Userzone/IncomeController.php) (Income entries), [`app/Http/Controllers/Userzone/ExpenseController.php`](https://github.com/dava2310/expense-tracker/blob/main/app/Http/Controllers/Userzone/ExpenseController.php) (Expense entries)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and identity"]
  node_registration["Registration"]
  node_login["Login"]
  node_user_model["User model<br/>[User.php]"]
  node_profile["Profile"]
end

subgraph group_setup["Financial setup"]
  node_accounts["Accounts"]
  node_account_model["Account model<br/>[Account.php]"]
  node_currencies["Currencies"]
  node_currency_model["Currency model<br/>[Currency.php]"]
  node_categories["Categories"]
  node_category_model["Category model<br/>[Category.php]"]
end

subgraph group_activity["Money activity"]
  node_income["Income entries"]
  node_income_model["Income model<br/>[Income.php]"]
  node_expenses["Expense entries"]
  node_expense_model["Expense model<br/>[Expense.php]"]
end

subgraph group_insights["Review and reporting"]
  node_period_filter["Period filtering<br/>[PeriodFilter.php]"]
  node_dashboard["Dashboard"]
end

node_user(("User"))
node_finance_store[("Application database")]

node_user -->|"registers with"| node_registration
node_registration -->|"creates user"| node_user_model
node_login -->|"authenticates"| node_user
node_registration -->|"persists account"| node_finance_store
node_accounts -->|"queries and updates"| node_account_model
node_currencies -->|"queries and updates"| node_currency_model
node_currencies -->|"checks account use"| node_account_model
node_expenses -->|"queries and creates"| node_expense_model
node_expenses -->|"deducts balance"| node_account_model
node_expenses -->|"applies date filters"| node_period_filter
node_income -->|"queries and creates"| node_income_model
node_income -->|"uses accounts"| node_account_model
node_income -->|"applies date filters"| node_period_filter
node_account_model -->|"queries activity"| node_income_model
node_account_model -->|"queries activity"| node_expense_model
node_account_model -->|"belongs to"| node_currency_model
node_expense_model -->|"belongs to"| node_category_model
node_income_model -->|"belongs to"| node_category_model
node_user_model -->|"owns accounts"| node_account_model
node_user_model -->|"owns currencies"| node_currency_model
node_user_model -->|"owns categories"| node_category_model

click node_registration "https://github.com/dava2310/expense-tracker/blob/main/app/Http/Controllers/Auth/RegisteredUserController.php"
click node_login "https://github.com/dava2310/expense-tracker/blob/main/app/Http/Controllers/Auth/AuthenticatedSessionController.php"
click node_user_model "https://github.com/dava2310/expense-tracker/blob/main/app/Models/User.php"
click node_accounts "https://github.com/dava2310/expense-tracker/blob/main/app/Http/Controllers/Userzone/AccountController.php"
click node_account_model "https://github.com/dava2310/expense-tracker/blob/main/app/Models/Account.php"
click node_currencies "https://github.com/dava2310/expense-tracker/blob/main/app/Http/Controllers/CurrencyController.php"
click node_currency_model "https://github.com/dava2310/expense-tracker/blob/main/app/Models/Currency.php"
click node_categories "https://github.com/dava2310/expense-tracker/blob/main/app/Http/Controllers/Userzone/CategoryController.php"
click node_category_model "https://github.com/dava2310/expense-tracker/blob/main/app/Models/Category.php"
click node_income "https://github.com/dava2310/expense-tracker/blob/main/app/Http/Controllers/Userzone/IncomeController.php"
click node_income_model "https://github.com/dava2310/expense-tracker/blob/main/app/Models/Income.php"
click node_expenses "https://github.com/dava2310/expense-tracker/blob/main/app/Http/Controllers/Userzone/ExpenseController.php"
click node_expense_model "https://github.com/dava2310/expense-tracker/blob/main/app/Models/Expense.php"
click node_period_filter "https://github.com/dava2310/expense-tracker/blob/main/app/Support/PeriodFilter.php"
click node_dashboard "https://github.com/dava2310/expense-tracker/blob/main/app/Http/Controllers/Userzone/DashboardController.php"
click node_profile "https://github.com/dava2310/expense-tracker/blob/main/app/Http/Controllers/Userzone/ProfileController.php"

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_registration,node_login,node_user_model,node_profile,node_user toneBlue
class node_accounts,node_account_model,node_currencies,node_currency_model,node_categories,node_category_model,node_finance_store toneAmber
class node_income,node_income_model,node_expenses,node_expense_model toneMint
class node_period_filter,node_dashboard toneRose
```

## Components

### Access and identity

- [Registration](https://github.com/dava2310/expense-tracker/blob/main/app/Http/Controllers/Auth/RegisteredUserController.php): `app/Http/Controllers/Auth/RegisteredUserController.php`
- [Login](https://github.com/dava2310/expense-tracker/blob/main/app/Http/Controllers/Auth/AuthenticatedSessionController.php): `app/Http/Controllers/Auth/AuthenticatedSessionController.php`
- [User model](https://github.com/dava2310/expense-tracker/blob/main/app/Models/User.php): `app/Models/User.php`
- [Profile](https://github.com/dava2310/expense-tracker/blob/main/app/Http/Controllers/Userzone/ProfileController.php): `app/Http/Controllers/Userzone/ProfileController.php`

### Financial setup

- [Accounts](https://github.com/dava2310/expense-tracker/blob/main/app/Http/Controllers/Userzone/AccountController.php): `app/Http/Controllers/Userzone/AccountController.php`
- [Account model](https://github.com/dava2310/expense-tracker/blob/main/app/Models/Account.php): `app/Models/Account.php`
- [Currencies](https://github.com/dava2310/expense-tracker/blob/main/app/Http/Controllers/CurrencyController.php): `app/Http/Controllers/CurrencyController.php`
- [Currency model](https://github.com/dava2310/expense-tracker/blob/main/app/Models/Currency.php): `app/Models/Currency.php`
- [Categories](https://github.com/dava2310/expense-tracker/blob/main/app/Http/Controllers/Userzone/CategoryController.php): `app/Http/Controllers/Userzone/CategoryController.php`
- [Category model](https://github.com/dava2310/expense-tracker/blob/main/app/Models/Category.php): `app/Models/Category.php`

### Money activity

- [Income entries](https://github.com/dava2310/expense-tracker/blob/main/app/Http/Controllers/Userzone/IncomeController.php): `app/Http/Controllers/Userzone/IncomeController.php`
- [Income model](https://github.com/dava2310/expense-tracker/blob/main/app/Models/Income.php): `app/Models/Income.php`
- [Expense entries](https://github.com/dava2310/expense-tracker/blob/main/app/Http/Controllers/Userzone/ExpenseController.php): `app/Http/Controllers/Userzone/ExpenseController.php`
- [Expense model](https://github.com/dava2310/expense-tracker/blob/main/app/Models/Expense.php): `app/Models/Expense.php`

### Review and reporting

- [Period filtering](https://github.com/dava2310/expense-tracker/blob/main/app/Support/PeriodFilter.php): `app/Support/PeriodFilter.php`
- [Dashboard](https://github.com/dava2310/expense-tracker/blob/main/app/Http/Controllers/Userzone/DashboardController.php): `app/Http/Controllers/Userzone/DashboardController.php`

### Other components

- **User**
- **Application database**

## Connections

- User → Registration: registers with
- Registration → User model: creates user (evidence: `app/Http/Controllers/Auth/RegisteredUserController.php`)
- Login → User: authenticates (evidence: `app/Http/Controllers/Auth/AuthenticatedSessionController.php`)
- Registration → Application database: persists account (evidence: `app/Http/Controllers/Auth/RegisteredUserController.php`)
- Accounts → Account model: queries and updates (evidence: `app/Http/Controllers/Userzone/AccountController.php`)
- Currencies → Currency model: queries and updates (evidence: `app/Http/Controllers/CurrencyController.php`)
- Currencies → Account model: checks account use (evidence: `app/Http/Controllers/CurrencyController.php`)
- Expense entries → Expense model: queries and creates (evidence: `app/Http/Controllers/Userzone/ExpenseController.php`)
- Expense entries → Account model: deducts balance (evidence: `app/Http/Controllers/Userzone/ExpenseController.php`)
- Expense entries → Period filtering: applies date filters (evidence: `app/Http/Controllers/Userzone/ExpenseController.php`)
- Income entries → Income model: queries and creates (evidence: `app/Http/Controllers/Userzone/IncomeController.php`)
- Income entries → Account model: uses accounts (evidence: `app/Http/Controllers/Userzone/IncomeController.php`)
- Income entries → Period filtering: applies date filters (evidence: `app/Http/Controllers/Userzone/IncomeController.php`)
- Account model → Income model: queries activity (evidence: `app/Models/Account.php`)
- Account model → Expense model: queries activity (evidence: `app/Models/Account.php`)
- Account model → Currency model: belongs to (evidence: `app/Models/Account.php`)
- Expense model → Category model: belongs to (evidence: `app/Models/Expense.php`)
- Income model → Category model: belongs to (evidence: `app/Models/Income.php`)
- User model → Account model: owns accounts (evidence: `app/Models/User.php`)
- User model → Currency model: owns currencies (evidence: `app/Models/User.php`)
- User model → Category model: owns categories (evidence: `app/Models/User.php`)
