# mhsohel/cashbox architecture

> Architecture diagram of the GitHub repository mhsohel/cashbox, 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/mhsohel/cashbox
- Repository: https://github.com/mhsohel/cashbox

## Overview

CashBox is a web-based personal finance ledger and SaaS-license manager. Users register or sign in, then manage accounts, categorized income and expenses, budgets, loans, and recurring activity; dashboard and report views turn that data into balances, pacing, and daily summaries. Superadmins administer permissions, bans, and premium service orders. The README documents Gemini budget advice and push notifications; sampled code confirms the budget-monitor/Gemini path, while detailed wiring for several unsampled modules is not established here.

Main entry points: [`routes/web.php`](https://github.com/mhsohel/cashbox/blob/main/routes/web.php) (Web Routes), [`app/Models/Transaction.php`](https://github.com/mhsohel/cashbox/blob/main/app/Models/Transaction.php) (Finance Data), [`app/Services/BudgetMonitorService.php`](https://github.com/mhsohel/cashbox/blob/main/app/Services/BudgetMonitorService.php) (Budget Monitor), [`app/Http/Controllers/BudgetController.php`](https://github.com/mhsohel/cashbox/blob/main/app/Http/Controllers/BudgetController.php) (Budgets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web Experience"]
  node_routes["Web Routes<br/>[web.php]"]
  node_authroutes["Auth Routes<br/>[auth.php]"]
  node_auth["Authentication"]
  node_ui["Vue Inertia UI"]
  node_inertia["Inertia Middleware"]
end

subgraph group_finance["Finance Operations"]
  node_accounts["Accounts"]
  node_transactions["Transactions &amp; Transfers"]
  node_categories["Categories"]
  node_budgets["Budgets"]
  node_loans["Loans &amp; Repayments<br/>[LoanController.php]"]
  node_recurring["Recurring Schedules"]
  node_store[("Finance Data<br/>[Transaction.php]")]
end

subgraph group_insights["Planning &amp; Reports"]
  node_dashboard["Dashboard"]
  node_reports["Reports"]
  node_monitor["Budget Monitor"]
end

subgraph group_admin["Administration &amp; Services"]
  node_license["License Billing"]
  node_orders["Service Orders"]
  node_superadminops["Superadmin Controls"]
  node_reminders["Reminder Notifications"]
  node_firebase["Firebase Push"]
end

node_user(("User"))
node_superadmin(("Superadmin"))
node_gemini["Gemini API"]
node_cache[("Application Cache")]

node_user -->|"requests auth"| node_authroutes
node_authroutes -->|"dispatches"| node_auth
node_auth -->|"creates user data"| node_store
node_user -->|"requests pages"| node_routes
node_routes -->|"dispatches"| node_accounts
node_routes -->|"dispatches"| node_transactions
node_routes -->|"dispatches"| node_categories
node_routes -->|"dispatches"| node_budgets
node_routes -->|"dispatches"| node_loans
node_routes -->|"dispatches"| node_recurring
node_routes -->|"dispatches"| node_dashboard
node_routes -->|"dispatches"| node_reports
node_routes -->|"dispatches"| node_license
node_routes -->|"dispatches"| node_orders
node_routes -->|"dispatches"| node_superadminops
node_accounts -->|"reads/writes"| node_store
node_transactions -->|"reads/writes"| node_store
node_categories -->|"reads/writes"| node_store
node_budgets -->|"reads/writes"| node_store
node_loans -->|"reads/writes"| node_store
node_recurring -->|"reads/writes"| node_store
node_recurring -->|"creates loans"| node_loans
node_dashboard -->|"reads finance data"| node_store
node_reports -->|"reads finance data"| node_store
node_budgets -->|"requests pacing"| node_monitor
node_monitor -->|"reads budgets/spend"| node_store
node_monitor -->|"caches advice"| node_cache
node_monitor -.->|"requests advice"| node_gemini
node_superadmin -->|"requests admin"| node_routes
node_superadminops -->|"updates users"| node_store
node_license -->|"reads/writes"| node_store
node_orders -->|"reads/writes"| node_store
node_reminders -->|"reads schedules"| node_store
node_reminders -.->|"sends notifications"| node_firebase
node_routes -->|"shares request data"| node_inertia
node_inertia -->|"provides page props"| node_ui
node_ui -->|"renders results"| node_user

click node_routes "https://github.com/mhsohel/cashbox/blob/main/routes/web.php"
click node_authroutes "https://github.com/mhsohel/cashbox/blob/main/routes/auth.php"
click node_auth "https://github.com/mhsohel/cashbox/blob/main/app/Http/Controllers/Auth/RegisteredUserController.php"
click node_ui "https://github.com/mhsohel/cashbox/tree/main/resources/js/Pages"
click node_inertia "https://github.com/mhsohel/cashbox/blob/main/app/Http/Middleware/HandleInertiaRequests.php"
click node_accounts "https://github.com/mhsohel/cashbox/blob/main/app/Http/Controllers/AccountController.php"
click node_transactions "https://github.com/mhsohel/cashbox/blob/main/app/Http/Controllers/TransactionController.php"
click node_categories "https://github.com/mhsohel/cashbox/blob/main/app/Http/Controllers/CategoryController.php"
click node_budgets "https://github.com/mhsohel/cashbox/blob/main/app/Http/Controllers/BudgetController.php"
click node_loans "https://github.com/mhsohel/cashbox/blob/main/app/Http/Controllers/LoanController.php"
click node_recurring "https://github.com/mhsohel/cashbox/blob/main/app/Http/Controllers/RecurringScheduleController.php"
click node_dashboard "https://github.com/mhsohel/cashbox/blob/main/app/Http/Controllers/DashboardController.php"
click node_reports "https://github.com/mhsohel/cashbox/blob/main/app/Http/Controllers/ReportController.php"
click node_monitor "https://github.com/mhsohel/cashbox/blob/main/app/Services/BudgetMonitorService.php"
click node_store "https://github.com/mhsohel/cashbox/blob/main/app/Models/Transaction.php"
click node_license "https://github.com/mhsohel/cashbox/blob/main/app/Http/Controllers/LicenseController.php"
click node_orders "https://github.com/mhsohel/cashbox/blob/main/app/Http/Controllers/PremiumServiceOrderController.php"
click node_superadminops "https://github.com/mhsohel/cashbox/blob/main/app/Http/Controllers/SuperadminController.php"
click node_reminders "https://github.com/mhsohel/cashbox/blob/main/app/Console/Commands/SendReminderNotifications.php"
click node_firebase "https://github.com/mhsohel/cashbox/blob/main/app/Services/FirebaseService.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_routes,node_authroutes,node_auth,node_ui,node_inertia,node_user toneBlue
class node_accounts,node_transactions,node_categories,node_budgets,node_loans,node_recurring,node_store,node_cache toneAmber
class node_dashboard,node_reports,node_monitor,node_gemini toneMint
class node_license,node_orders,node_superadminops,node_reminders,node_firebase toneRose
class node_superadmin toneIndigo
```

## Components

### Web Experience

- [Web Routes](https://github.com/mhsohel/cashbox/blob/main/routes/web.php): `routes/web.php`
- [Auth Routes](https://github.com/mhsohel/cashbox/blob/main/routes/auth.php): `routes/auth.php`
- [Authentication](https://github.com/mhsohel/cashbox/blob/main/app/Http/Controllers/Auth/RegisteredUserController.php): `app/Http/Controllers/Auth/RegisteredUserController.php`
- [Vue Inertia UI](https://github.com/mhsohel/cashbox/tree/main/resources/js/Pages): `resources/js/Pages`
- [Inertia Middleware](https://github.com/mhsohel/cashbox/blob/main/app/Http/Middleware/HandleInertiaRequests.php): `app/Http/Middleware/HandleInertiaRequests.php`

### Finance Operations

- [Accounts](https://github.com/mhsohel/cashbox/blob/main/app/Http/Controllers/AccountController.php): `app/Http/Controllers/AccountController.php`
- [Transactions & Transfers](https://github.com/mhsohel/cashbox/blob/main/app/Http/Controllers/TransactionController.php): `app/Http/Controllers/TransactionController.php`
- [Categories](https://github.com/mhsohel/cashbox/blob/main/app/Http/Controllers/CategoryController.php): `app/Http/Controllers/CategoryController.php`
- [Budgets](https://github.com/mhsohel/cashbox/blob/main/app/Http/Controllers/BudgetController.php): `app/Http/Controllers/BudgetController.php`
- [Loans & Repayments](https://github.com/mhsohel/cashbox/blob/main/app/Http/Controllers/LoanController.php): `app/Http/Controllers/LoanController.php`
- [Recurring Schedules](https://github.com/mhsohel/cashbox/blob/main/app/Http/Controllers/RecurringScheduleController.php): `app/Http/Controllers/RecurringScheduleController.php`
- [Finance Data](https://github.com/mhsohel/cashbox/blob/main/app/Models/Transaction.php): `app/Models/Transaction.php`

### Planning & Reports

- [Dashboard](https://github.com/mhsohel/cashbox/blob/main/app/Http/Controllers/DashboardController.php): `app/Http/Controllers/DashboardController.php`
- [Reports](https://github.com/mhsohel/cashbox/blob/main/app/Http/Controllers/ReportController.php): `app/Http/Controllers/ReportController.php`
- [Budget Monitor](https://github.com/mhsohel/cashbox/blob/main/app/Services/BudgetMonitorService.php): `app/Services/BudgetMonitorService.php`

### Administration & Services

- [License Billing](https://github.com/mhsohel/cashbox/blob/main/app/Http/Controllers/LicenseController.php): `app/Http/Controllers/LicenseController.php`
- [Service Orders](https://github.com/mhsohel/cashbox/blob/main/app/Http/Controllers/PremiumServiceOrderController.php): `app/Http/Controllers/PremiumServiceOrderController.php`
- [Superadmin Controls](https://github.com/mhsohel/cashbox/blob/main/app/Http/Controllers/SuperadminController.php): `app/Http/Controllers/SuperadminController.php`
- [Reminder Notifications](https://github.com/mhsohel/cashbox/blob/main/app/Console/Commands/SendReminderNotifications.php): `app/Console/Commands/SendReminderNotifications.php`
- [Firebase Push](https://github.com/mhsohel/cashbox/blob/main/app/Services/FirebaseService.php): `app/Services/FirebaseService.php`

### Other components

- **User**
- **Superadmin**
- **Gemini API**
- **Application Cache**

## Connections

- User → Auth Routes: requests auth
- Auth Routes → Authentication: dispatches
- Authentication → Finance Data: creates user data
- User → Web Routes: requests pages
- Web Routes → Accounts: dispatches
- Web Routes → Transactions & Transfers: dispatches
- Web Routes → Categories: dispatches
- Web Routes → Budgets: dispatches
- Web Routes → Loans & Repayments: dispatches
- Web Routes → Recurring Schedules: dispatches
- Web Routes → Dashboard: dispatches
- Web Routes → Reports: dispatches
- Web Routes → License Billing: dispatches
- Web Routes → Service Orders: dispatches
- Web Routes → Superadmin Controls: dispatches
- Accounts → Finance Data: reads/writes
- Transactions & Transfers → Finance Data: reads/writes
- Categories → Finance Data: reads/writes
- Budgets → Finance Data: reads/writes
- Loans & Repayments → Finance Data: reads/writes
- Recurring Schedules → Finance Data: reads/writes
- Recurring Schedules → Loans & Repayments: creates loans
- Dashboard → Finance Data: reads finance data
- Reports → Finance Data: reads finance data
- Budgets → Budget Monitor: requests pacing
- Budget Monitor → Finance Data: reads budgets/spend
- Budget Monitor → Application Cache: caches advice
- Budget Monitor → Gemini API: requests advice
- Superadmin → Web Routes: requests admin
- Superadmin Controls → Finance Data: updates users
- License Billing → Finance Data: reads/writes
- Service Orders → Finance Data: reads/writes
- Reminder Notifications → Finance Data: reads schedules
- Reminder Notifications → Firebase Push: sends notifications
- Web Routes → Inertia Middleware: shares request data
- Inertia Middleware → Vue Inertia UI: provides page props
- Vue Inertia UI → User: renders results
