# pablochacon1997/cashtrackr_laravel architecture

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

- Interactive diagram: https://gitdiagram.com/pablochacon1997/cashtrackr_laravel
- Repository: https://github.com/pablochacon1997/cashtrackr_laravel

## Overview

CashTrackr is a Laravel budgeting and expense-tracking application with an Inertia/React interface. Users register and verify an account, create budgets, then record and review expenses. Optional subscribed features add AI budget chat and receipt scanning; separate routes handle plan checkout and subscription management. The graph reflects documented routes and sampled controller/model relationships. Some UI, payment-checkout, and AI-agent internals were not sampled, so their implementation links are omitted or marked unverified.

Main entry points: [`routes/web.php`](https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/routes/web.php) (Web routes), [`app/Http/Controllers/BudgetController.php`](https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/Http/Controllers/BudgetController.php) (Budget actions), [`app/Http/Controllers/BudgetChatController.php`](https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/Http/Controllers/BudgetChatController.php) (Budget chat), [`app/Models/Budget.php`](https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/Models/Budget.php) (Budgets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Accounts"]
  node_auth["Authentication"]
  node_profile["Profile settings"]
  node_user_model["User account<br/>[User.php]"]
end

subgraph group_budgets["Budgeting"]
  node_budget_controller["Budget actions"]
  node_expense_controller["Expense actions"]
  node_budget_model["Budgets<br/>[Budget.php]"]
  node_expense_model["Expenses<br/>[Expense.php]"]
  node_categories["Expense categories"]
  node_budget_page["Budget view<br/>[Show.tsx]"]
end

subgraph group_assist["AI assistance"]
  node_chat_controller["Budget chat"]
  node_budget_agent["Budget assistant<br/>[BudgetAsistant.php]"]
  node_chat_ui["Chat interface"]
  node_scan_controller["Receipt scanning"]
  node_ticket_agent["Ticket scanner<br/>[TicketScanner.php]"]
end

subgraph group_billing["Subscriptions"]
  node_checkout["Plan checkout"]
  node_subscription["Subscription management"]
  node_plans_ui["Plans interface<br/>[Plans.tsx]"]
  node_billing_ui["Subscription interface<br/>[Manage.tsx]"]
end

node_user(("User"))
node_routes["Web routes<br/>[web.php]"]
node_storage[("Application database")]
node_ai_provider{{"AI provider"}}
node_stripe{{"Stripe"}}

node_user -->|"sends requests"| node_routes
node_routes -->|"routes auth"| node_auth
node_routes -->|"routes settings"| node_profile
node_routes -->|"routes budgets"| node_budget_controller
node_routes -->|"routes expenses"| node_expense_controller
node_routes -->|"routes chat"| node_chat_controller
node_routes -->|"routes scans"| node_scan_controller
node_routes -->|"routes checkout"| node_checkout
node_routes -->|"routes subscriptions"| node_subscription
node_auth -->|"creates account"| node_user_model
node_profile -->|"updates account"| node_user_model
node_budget_controller -->|"creates and manages"| node_budget_model
node_budget_controller -->|"loads expenses"| node_expense_model
node_budget_controller -->|"builds category data"| node_categories
node_budget_controller -->|"renders"| node_budget_page
node_expense_controller -->|"uses budget"| node_budget_model
node_expense_controller -->|"creates and manages"| node_expense_model
node_budget_model -.->|"persists budgets"| node_storage
node_expense_model -.->|"persists expenses"| node_storage
node_user_model -.->|"persists account"| node_storage
node_routes -.->|"serves chat feature"| node_chat_ui
node_chat_controller -->|"prompts"| node_budget_agent
node_chat_controller -->|"uses budget"| node_budget_model
node_chat_controller -.->|"requests AI response"| node_ai_provider
node_scan_controller -->|"prompts with image"| node_ticket_agent
node_scan_controller -->|"creates expenses"| node_expense_model
node_ticket_agent -.->|"uses provider"| node_ai_provider
node_checkout -.->|"starts checkout"| node_stripe
node_subscription -.->|"manages billing"| node_stripe
node_subscription -->|"renders management"| node_billing_ui
node_routes -->|"renders plans"| node_plans_ui

click node_routes "https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/routes/web.php"
click node_auth "https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/Http/Controllers/Auth/RegisterController.php"
click node_profile "https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/Http/Controllers/UpdateProfileController.php"
click node_user_model "https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/Models/User.php"
click node_budget_controller "https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/Http/Controllers/BudgetController.php"
click node_expense_controller "https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/Http/Controllers/ExpenseController.php"
click node_budget_model "https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/Models/Budget.php"
click node_expense_model "https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/Models/Expense.php"
click node_categories "https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/ExpenseCategory.php"
click node_budget_page "https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/resources/js/Pages/Budgets/Show.tsx"
click node_chat_controller "https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/Http/Controllers/BudgetChatController.php"
click node_budget_agent "https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/Ai/Agents/BudgetAsistant.php"
click node_chat_ui "https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/resources/js/Components/CashTrackrAgent.tsx"
click node_scan_controller "https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/Http/Controllers/TicketScanController.php"
click node_ticket_agent "https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/Ai/Agents/TicketScanner.php"
click node_checkout "https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/Http/Controllers/SubscriptionCheckoutController.php"
click node_subscription "https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/Http/Controllers/SubscriptionController.php"
click node_plans_ui "https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/resources/js/Pages/Pro/Plans.tsx"
click node_billing_ui "https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/resources/js/Pages/Subscriptions/Manage.tsx"

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_auth,node_profile,node_user_model,node_user toneBlue
class node_budget_controller,node_expense_controller,node_budget_model,node_expense_model,node_categories,node_budget_page,node_storage toneAmber
class node_chat_controller,node_budget_agent,node_chat_ui,node_scan_controller,node_ticket_agent,node_routes toneMint
class node_checkout,node_subscription,node_plans_ui,node_billing_ui toneRose
class node_ai_provider,node_stripe toneIndigo
```

## Components

### Accounts

- [Authentication](https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/Http/Controllers/Auth/RegisterController.php): `app/Http/Controllers/Auth/RegisterController.php`
- [Profile settings](https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/Http/Controllers/UpdateProfileController.php): `app/Http/Controllers/UpdateProfileController.php`
- [User account](https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/Models/User.php): `app/Models/User.php`

### Budgeting

- [Budget actions](https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/Http/Controllers/BudgetController.php): `app/Http/Controllers/BudgetController.php`
- [Expense actions](https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/Http/Controllers/ExpenseController.php): `app/Http/Controllers/ExpenseController.php`
- [Budgets](https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/Models/Budget.php): `app/Models/Budget.php`
- [Expenses](https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/Models/Expense.php): `app/Models/Expense.php`
- [Expense categories](https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/ExpenseCategory.php): `app/ExpenseCategory.php`
- [Budget view](https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/resources/js/Pages/Budgets/Show.tsx): `resources/js/Pages/Budgets/Show.tsx`

### AI assistance

- [Budget chat](https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/Http/Controllers/BudgetChatController.php): `app/Http/Controllers/BudgetChatController.php`
- [Budget assistant](https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/Ai/Agents/BudgetAsistant.php): `app/Ai/Agents/BudgetAsistant.php`
- [Chat interface](https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/resources/js/Components/CashTrackrAgent.tsx): `resources/js/Components/CashTrackrAgent.tsx`
- [Receipt scanning](https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/Http/Controllers/TicketScanController.php): `app/Http/Controllers/TicketScanController.php`
- [Ticket scanner](https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/Ai/Agents/TicketScanner.php): `app/Ai/Agents/TicketScanner.php`

### Subscriptions

- [Plan checkout](https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/Http/Controllers/SubscriptionCheckoutController.php): `app/Http/Controllers/SubscriptionCheckoutController.php`
- [Subscription management](https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/app/Http/Controllers/SubscriptionController.php): `app/Http/Controllers/SubscriptionController.php`
- [Plans interface](https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/resources/js/Pages/Pro/Plans.tsx): `resources/js/Pages/Pro/Plans.tsx`
- [Subscription interface](https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/resources/js/Pages/Subscriptions/Manage.tsx): `resources/js/Pages/Subscriptions/Manage.tsx`

### Other components

- **User**
- [Web routes](https://github.com/pablochacon1997/cashtrackr_laravel/blob/master/routes/web.php): `routes/web.php`
- **Application database**
- **AI provider**
- **Stripe**

## Connections

- User → Web routes: sends requests (evidence: `routes/web.php`)
- Web routes → Authentication: routes auth (evidence: `routes/web.php`)
- Web routes → Profile settings: routes settings (evidence: `routes/web.php`)
- Web routes → Budget actions: routes budgets (evidence: `routes/web.php`)
- Web routes → Expense actions: routes expenses (evidence: `routes/web.php`)
- Web routes → Budget chat: routes chat (evidence: `routes/web.php`)
- Web routes → Receipt scanning: routes scans (evidence: `routes/web.php`)
- Web routes → Plan checkout: routes checkout (evidence: `routes/web.php`)
- Web routes → Subscription management: routes subscriptions (evidence: `routes/web.php`)
- Authentication → User account: creates account (evidence: `app/Http/Controllers/Auth/RegisterController.php`)
- Profile settings → User account: updates account (evidence: `app/Http/Controllers/UpdateProfileController.php`)
- Budget actions → Budgets: creates and manages (evidence: `app/Http/Controllers/BudgetController.php`)
- Budget actions → Expenses: loads expenses (evidence: `app/Http/Controllers/BudgetController.php`)
- Budget actions → Expense categories: builds category data (evidence: `app/Http/Controllers/BudgetController.php`)
- Budget actions → Budget view: renders (evidence: `app/Http/Controllers/BudgetController.php`)
- Expense actions → Budgets: uses budget (evidence: `app/Http/Controllers/ExpenseController.php`)
- Expense actions → Expenses: creates and manages (evidence: `app/Http/Controllers/ExpenseController.php`)
- Budgets → Application database: persists budgets
- Expenses → Application database: persists expenses
- User account → Application database: persists account
- Web routes → Chat interface: serves chat feature
- Budget chat → Budget assistant: prompts (evidence: `app/Http/Controllers/BudgetChatController.php`)
- Budget chat → Budgets: uses budget (evidence: `app/Http/Controllers/BudgetChatController.php`)
- Budget chat → AI provider: requests AI response
- Receipt scanning → Ticket scanner: prompts with image (evidence: `app/Http/Controllers/TicketScanController.php`)
- Receipt scanning → Expenses: creates expenses (evidence: `app/Http/Controllers/TicketScanController.php`)
- Ticket scanner → AI provider: uses provider
- Plan checkout → Stripe: starts checkout
- Subscription management → Stripe: manages billing
- Subscription management → Subscription interface: renders management (evidence: `app/Http/Controllers/SubscriptionController.php`)
- Web routes → Plans interface: renders plans (evidence: `routes/web.php`)
