# rohitkf/aureal_finance_ai architecture

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

## Overview

Aureal Finance AI is a personal-finance web app centered on calculating Safe to Spend from account balances, expected income, commitments, and a protected minimum. The user signs in, enters accounts and transactions (including recurring items), then reviews the resulting position across the dashboard and planning screens. The README documents budgeting, forecasting, goals, debts, reports, search, and data export; these are represented as product branches. Source excerpts were limited, so some page-to-engine wiring is documented rather than directly sampled; uncertain calls are omitted.

Main entry points: [`src/components/AppShell.tsx`](https://github.com/rohitkf/aureal_finance_ai/blob/main/src/components/AppShell.tsx) (App shell), [`src/lib/store.tsx`](https://github.com/rohitkf/aureal_finance_ai/blob/main/src/lib/store.tsx) (App data store), [`src/App.tsx`](https://github.com/rohitkf/aureal_finance_ai/blob/main/src/App.tsx) (App routing), [`src/lib/finance.ts`](https://github.com/rohitkf/aureal_finance_ai/blob/main/src/lib/finance.ts) (Finance calculations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["App and access"]
  node_app["App routing<br/>[App.tsx]"]
  node_auth["Auth provider<br/>[auth.tsx]"]
  node_authpages["Sign-in flows"]
  node_shell["App shell<br/>[AppShell.tsx]"]
end

subgraph group_money["Money management"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_accounts["Accounts<br/>[Accounts.tsx]"]
  node_accountdetail["Account detail<br/>[AccountDetail.tsx]"]
  node_transactions["Transactions<br/>[Transactions.tsx]"]
  node_entry["Transaction entry"]
  node_recurring["Recurring payments<br/>[Recurring.tsx]"]
end

subgraph group_insight["Planning and insight"]
  node_budget["Budget<br/>[Budget.tsx]"]
  node_forecast["Forecast<br/>[Forecast.tsx]"]
  node_goals["Goals<br/>[Goals.tsx]"]
  node_debts["Debts<br/>[Debts.tsx]"]
  node_reports["Reports<br/>[Reports.tsx]"]
  node_settings["Settings and export<br/>[Settings.tsx]"]
  node_search["Global search<br/>[CommandPalette.tsx]"]
end

subgraph group_data["Data and finance engine"]
  node_store["App data store<br/>[store.tsx]"]
  node_engine["Finance calculations<br/>[finance.ts]"]
  node_recurrenceengine["Recurrence expansion<br/>[recurrence.ts]"]
  node_supabase["Supabase service<br/>[supabase.ts]"]
  node_database[("Supabase database")]
end

node_person(("User"))

node_person -->|"opens app"| node_app
node_app -->|"checks session"| node_auth
node_app -->|"routes auth"| node_authpages
node_authpages -->|"authenticates"| node_auth
node_auth -->|"auth requests"| node_supabase
node_app -->|"renders protected routes"| node_shell
node_shell -->|"shows home"| node_dashboard
node_shell -->|"routes to"| node_accounts
node_shell -->|"routes to"| node_accountdetail
node_shell -->|"routes to"| node_transactions
node_shell -->|"routes to"| node_budget
node_shell -->|"routes to"| node_forecast
node_shell -->|"routes to"| node_recurring
node_shell -->|"routes to"| node_goals
node_shell -->|"routes to"| node_debts
node_shell -->|"routes to"| node_reports
node_shell -->|"routes to"| node_settings
node_shell -->|"provides search"| node_search
node_transactions -->|"opens entry"| node_entry
node_entry -->|"dispatches changes"| node_store
node_store -->|"loads and saves"| node_supabase
node_supabase -->|"reads and writes"| node_database
node_dashboard -->|"reads state"| node_store
node_accounts -->|"reads state"| node_store
node_accountdetail -->|"reads state"| node_store
node_transactions -->|"reads state"| node_store
node_recurring -->|"reads state"| node_store
node_budget -->|"reads state"| node_store
node_forecast -->|"reads state"| node_store
node_goals -->|"reads state"| node_store
node_debts -->|"reads state"| node_store
node_reports -->|"reads state"| node_store
node_settings -->|"manages data"| node_store
node_dashboard -->|"calculates position"| node_engine
node_budget -->|"calculates progress"| node_engine
node_forecast -->|"builds projections"| node_engine
node_recurring -->|"expands schedules"| node_recurrenceengine
node_engine -->|"expands forecast rules"| node_recurrenceengine

click node_app "https://github.com/rohitkf/aureal_finance_ai/blob/main/src/App.tsx"
click node_auth "https://github.com/rohitkf/aureal_finance_ai/blob/main/src/lib/auth.tsx"
click node_authpages "https://github.com/rohitkf/aureal_finance_ai/tree/main/src/pages/auth"
click node_shell "https://github.com/rohitkf/aureal_finance_ai/blob/main/src/components/AppShell.tsx"
click node_dashboard "https://github.com/rohitkf/aureal_finance_ai/blob/main/src/pages/Dashboard.tsx"
click node_accounts "https://github.com/rohitkf/aureal_finance_ai/blob/main/src/pages/Accounts.tsx"
click node_accountdetail "https://github.com/rohitkf/aureal_finance_ai/blob/main/src/pages/AccountDetail.tsx"
click node_transactions "https://github.com/rohitkf/aureal_finance_ai/blob/main/src/pages/Transactions.tsx"
click node_entry "https://github.com/rohitkf/aureal_finance_ai/blob/main/src/components/AddTransactionSheet.tsx"
click node_recurring "https://github.com/rohitkf/aureal_finance_ai/blob/main/src/pages/Recurring.tsx"
click node_budget "https://github.com/rohitkf/aureal_finance_ai/blob/main/src/pages/Budget.tsx"
click node_forecast "https://github.com/rohitkf/aureal_finance_ai/blob/main/src/pages/Forecast.tsx"
click node_goals "https://github.com/rohitkf/aureal_finance_ai/blob/main/src/pages/Goals.tsx"
click node_debts "https://github.com/rohitkf/aureal_finance_ai/blob/main/src/pages/Debts.tsx"
click node_reports "https://github.com/rohitkf/aureal_finance_ai/blob/main/src/pages/Reports.tsx"
click node_settings "https://github.com/rohitkf/aureal_finance_ai/blob/main/src/pages/Settings.tsx"
click node_search "https://github.com/rohitkf/aureal_finance_ai/blob/main/src/components/CommandPalette.tsx"
click node_store "https://github.com/rohitkf/aureal_finance_ai/blob/main/src/lib/store.tsx"
click node_engine "https://github.com/rohitkf/aureal_finance_ai/blob/main/src/lib/finance.ts"
click node_recurrenceengine "https://github.com/rohitkf/aureal_finance_ai/blob/main/src/lib/recurrence.ts"
click node_supabase "https://github.com/rohitkf/aureal_finance_ai/blob/main/src/lib/supabase.ts"

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_auth,node_authpages,node_shell,node_person toneBlue
class node_dashboard,node_accounts,node_accountdetail,node_transactions,node_entry,node_recurring toneAmber
class node_budget,node_forecast,node_goals,node_debts,node_reports,node_settings,node_search toneMint
class node_store,node_engine,node_recurrenceengine,node_supabase,node_database toneRose
```

## Components

### App and access

- [App routing](https://github.com/rohitkf/aureal_finance_ai/blob/main/src/App.tsx): `src/App.tsx`
- [Auth provider](https://github.com/rohitkf/aureal_finance_ai/blob/main/src/lib/auth.tsx): `src/lib/auth.tsx`
- [Sign-in flows](https://github.com/rohitkf/aureal_finance_ai/tree/main/src/pages/auth): `src/pages/auth`
- [App shell](https://github.com/rohitkf/aureal_finance_ai/blob/main/src/components/AppShell.tsx): `src/components/AppShell.tsx`

### Money management

- [Dashboard](https://github.com/rohitkf/aureal_finance_ai/blob/main/src/pages/Dashboard.tsx): `src/pages/Dashboard.tsx`
- [Accounts](https://github.com/rohitkf/aureal_finance_ai/blob/main/src/pages/Accounts.tsx): `src/pages/Accounts.tsx`
- [Account detail](https://github.com/rohitkf/aureal_finance_ai/blob/main/src/pages/AccountDetail.tsx): `src/pages/AccountDetail.tsx`
- [Transactions](https://github.com/rohitkf/aureal_finance_ai/blob/main/src/pages/Transactions.tsx): `src/pages/Transactions.tsx`
- [Transaction entry](https://github.com/rohitkf/aureal_finance_ai/blob/main/src/components/AddTransactionSheet.tsx): `src/components/AddTransactionSheet.tsx`
- [Recurring payments](https://github.com/rohitkf/aureal_finance_ai/blob/main/src/pages/Recurring.tsx): `src/pages/Recurring.tsx`

### Planning and insight

- [Budget](https://github.com/rohitkf/aureal_finance_ai/blob/main/src/pages/Budget.tsx): `src/pages/Budget.tsx`
- [Forecast](https://github.com/rohitkf/aureal_finance_ai/blob/main/src/pages/Forecast.tsx): `src/pages/Forecast.tsx`
- [Goals](https://github.com/rohitkf/aureal_finance_ai/blob/main/src/pages/Goals.tsx): `src/pages/Goals.tsx`
- [Debts](https://github.com/rohitkf/aureal_finance_ai/blob/main/src/pages/Debts.tsx): `src/pages/Debts.tsx`
- [Reports](https://github.com/rohitkf/aureal_finance_ai/blob/main/src/pages/Reports.tsx): `src/pages/Reports.tsx`
- [Settings and export](https://github.com/rohitkf/aureal_finance_ai/blob/main/src/pages/Settings.tsx): `src/pages/Settings.tsx`
- [Global search](https://github.com/rohitkf/aureal_finance_ai/blob/main/src/components/CommandPalette.tsx): `src/components/CommandPalette.tsx`

### Data and finance engine

- [App data store](https://github.com/rohitkf/aureal_finance_ai/blob/main/src/lib/store.tsx): `src/lib/store.tsx`
- [Finance calculations](https://github.com/rohitkf/aureal_finance_ai/blob/main/src/lib/finance.ts): `src/lib/finance.ts`
- [Recurrence expansion](https://github.com/rohitkf/aureal_finance_ai/blob/main/src/lib/recurrence.ts): `src/lib/recurrence.ts`
- [Supabase service](https://github.com/rohitkf/aureal_finance_ai/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- **Supabase database**

### Other components

- **User**

## Connections

- User → App routing: opens app
- App routing → Auth provider: checks session
- App routing → Sign-in flows: routes auth
- Sign-in flows → Auth provider: authenticates
- Auth provider → Supabase service: auth requests
- App routing → App shell: renders protected routes
- App shell → Dashboard: shows home
- App shell → Accounts: routes to
- App shell → Account detail: routes to
- App shell → Transactions: routes to
- App shell → Budget: routes to
- App shell → Forecast: routes to
- App shell → Recurring payments: routes to
- App shell → Goals: routes to
- App shell → Debts: routes to
- App shell → Reports: routes to
- App shell → Settings and export: routes to
- App shell → Global search: provides search
- Transactions → Transaction entry: opens entry
- Transaction entry → App data store: dispatches changes
- App data store → Supabase service: loads and saves
- Supabase service → Supabase database: reads and writes
- Dashboard → App data store: reads state
- Accounts → App data store: reads state
- Account detail → App data store: reads state
- Transactions → App data store: reads state
- Recurring payments → App data store: reads state
- Budget → App data store: reads state
- Forecast → App data store: reads state
- Goals → App data store: reads state
- Debts → App data store: reads state
- Reports → App data store: reads state
- Settings and export → App data store: manages data
- Dashboard → Finance calculations: calculates position
- Budget → Finance calculations: calculates progress
- Forecast → Finance calculations: builds projections
- Recurring payments → Recurrence expansion: expands schedules
- Finance calculations → Recurrence expansion: expands forecast rules
