# charintornnillapat/incomeandexpence architecture

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

- Interactive diagram: https://gitdiagram.com/charintornnillapat/incomeandexpence
- Repository: https://github.com/charintornnillapat/incomeandexpence

## Overview

FinLife Tracker is a personal-finance and wellbeing PWA. The main workflow is entering or importing transactions, applying category rules, updating wallet/debt records, and reviewing financial summaries alongside diary entries. FinanceContext is the central state and mutation layer, with local persistence and optional Supabase synchronization. README capabilities are represented; unsampled view internals and some integration details are shown only where documented, so uncertain calls are omitted.

Main entry points: [`src/App.tsx`](https://github.com/charintornnillapat/incomeandexpence/blob/main/src/App.tsx) (App shell), [`src/context/FinanceContext.tsx`](https://github.com/charintornnillapat/incomeandexpence/blob/main/src/context/FinanceContext.tsx) (Finance state and mutations), [`src/components/TransactionForm.tsx`](https://github.com/charintornnillapat/incomeandexpence/blob/main/src/components/TransactionForm.tsx) (Transaction entry), [`src/views/TransactionsView.tsx`](https://github.com/charintornnillapat/incomeandexpence/blob/main/src/views/TransactionsView.tsx) (Transactions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_app["App shell<br/>[App.tsx]"]
  node_dashboard["Dashboard<br/>[DashboardView.tsx]"]
  node_auth["Account access<br/>[AuthModal.tsx]"]
end

subgraph group_finance["Financial tracking"]
  node_transactions["Transactions"]
  node_entry["Transaction entry"]
  node_csv["CSV exchange<br/>[ImportCsvModal.tsx]"]
  node_wallets["Wallet management<br/>[WalletsView.tsx]"]
  node_transfer["Wallet transfers"]
  node_debts["Debt goals<br/>[DebtsView.tsx]"]
  node_categories["Categories and rules<br/>[CategoriesView.tsx]"]
end

subgraph group_wellbeing["Wellbeing and insights"]
  node_diary["Wellbeing diary<br/>[DiaryView.tsx]"]
  node_diaryform["Diary entry form<br/>[DiaryEntryForm.tsx]"]
  node_insights["Spending insights"]
  node_api_classify["Classification API<br/>[classify.ts]"]
  node_api_insights["Insights API<br/>[insights.ts]"]
end

subgraph group_platform["State and services"]
  node_context["Finance state and mutations<br/>[FinanceContext.tsx]"]
  node_ledger["Ledger calculations<br/>[ledger.ts]"]
  node_storage[("Local storage")]
  node_supabase_client["Supabase client<br/>[supabase.ts]"]
end

node_person(("Finance user"))
node_supabase[("Supabase service")]

node_person -->|"uses"| node_app
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_transactions
node_app -->|"routes to"| node_wallets
node_app -->|"routes to"| node_debts
node_app -->|"routes to"| node_diary
node_app -->|"routes to"| node_categories
node_transactions -->|"opens"| node_entry
node_transactions -->|"imports"| node_csv
node_wallets -->|"supports"| node_transfer
node_debts -->|"records repayments"| node_entry
node_diary -->|"edits entries"| node_diaryform
node_entry -->|"submits mutations"| node_context
node_csv -->|"imports rows"| node_context
node_transfer -->|"submits transfer"| node_context
node_diaryform -->|"submits entries"| node_context
node_dashboard -->|"shows"| node_insights
node_context -->|"uses calculations"| node_ledger
node_context -->|"persists locally"| node_storage
node_context -->|"syncs through"| node_supabase_client
node_supabase_client -->|"connects to"| node_supabase
node_app -->|"opens"| node_auth
node_auth -->|"authenticates with"| node_supabase_client
node_entry -.->|"classifies descriptions"| node_api_classify
node_insights -.->|"requests insights"| node_api_insights

click node_app "https://github.com/charintornnillapat/incomeandexpence/blob/main/src/App.tsx"
click node_dashboard "https://github.com/charintornnillapat/incomeandexpence/blob/main/src/views/DashboardView.tsx"
click node_transactions "https://github.com/charintornnillapat/incomeandexpence/blob/main/src/views/TransactionsView.tsx"
click node_entry "https://github.com/charintornnillapat/incomeandexpence/blob/main/src/components/TransactionForm.tsx"
click node_csv "https://github.com/charintornnillapat/incomeandexpence/blob/main/src/components/transaction/ImportCsvModal.tsx"
click node_wallets "https://github.com/charintornnillapat/incomeandexpence/blob/main/src/views/WalletsView.tsx"
click node_transfer "https://github.com/charintornnillapat/incomeandexpence/blob/main/src/components/wallet/WalletTransferForm.tsx"
click node_debts "https://github.com/charintornnillapat/incomeandexpence/blob/main/src/views/DebtsView.tsx"
click node_categories "https://github.com/charintornnillapat/incomeandexpence/blob/main/src/views/CategoriesView.tsx"
click node_diary "https://github.com/charintornnillapat/incomeandexpence/blob/main/src/views/DiaryView.tsx"
click node_diaryform "https://github.com/charintornnillapat/incomeandexpence/blob/main/src/components/diary/DiaryEntryForm.tsx"
click node_insights "https://github.com/charintornnillapat/incomeandexpence/blob/main/src/components/dashboard/SpendingInsightsCard.tsx"
click node_api_classify "https://github.com/charintornnillapat/incomeandexpence/blob/main/api/classify.ts"
click node_api_insights "https://github.com/charintornnillapat/incomeandexpence/blob/main/api/insights.ts"
click node_context "https://github.com/charintornnillapat/incomeandexpence/blob/main/src/context/FinanceContext.tsx"
click node_ledger "https://github.com/charintornnillapat/incomeandexpence/blob/main/src/selectors/ledger.ts"
click node_supabase_client "https://github.com/charintornnillapat/incomeandexpence/blob/main/src/lib/supabase.ts"
click node_auth "https://github.com/charintornnillapat/incomeandexpence/blob/main/src/components/AuthModal.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_app,node_dashboard,node_auth,node_person toneBlue
class node_transactions,node_entry,node_csv,node_wallets,node_transfer,node_debts,node_categories,node_supabase toneAmber
class node_diary,node_diaryform,node_insights,node_api_classify,node_api_insights toneMint
class node_context,node_ledger,node_storage,node_supabase_client toneRose
```

## Components

### App experience

- [App shell](https://github.com/charintornnillapat/incomeandexpence/blob/main/src/App.tsx): `src/App.tsx`
- [Dashboard](https://github.com/charintornnillapat/incomeandexpence/blob/main/src/views/DashboardView.tsx): `src/views/DashboardView.tsx`
- [Account access](https://github.com/charintornnillapat/incomeandexpence/blob/main/src/components/AuthModal.tsx): `src/components/AuthModal.tsx`

### Financial tracking

- [Transactions](https://github.com/charintornnillapat/incomeandexpence/blob/main/src/views/TransactionsView.tsx): `src/views/TransactionsView.tsx`
- [Transaction entry](https://github.com/charintornnillapat/incomeandexpence/blob/main/src/components/TransactionForm.tsx): `src/components/TransactionForm.tsx`
- [CSV exchange](https://github.com/charintornnillapat/incomeandexpence/blob/main/src/components/transaction/ImportCsvModal.tsx): `src/components/transaction/ImportCsvModal.tsx`
- [Wallet management](https://github.com/charintornnillapat/incomeandexpence/blob/main/src/views/WalletsView.tsx): `src/views/WalletsView.tsx`
- [Wallet transfers](https://github.com/charintornnillapat/incomeandexpence/blob/main/src/components/wallet/WalletTransferForm.tsx): `src/components/wallet/WalletTransferForm.tsx`
- [Debt goals](https://github.com/charintornnillapat/incomeandexpence/blob/main/src/views/DebtsView.tsx): `src/views/DebtsView.tsx`
- [Categories and rules](https://github.com/charintornnillapat/incomeandexpence/blob/main/src/views/CategoriesView.tsx): `src/views/CategoriesView.tsx`

### Wellbeing and insights

- [Wellbeing diary](https://github.com/charintornnillapat/incomeandexpence/blob/main/src/views/DiaryView.tsx): `src/views/DiaryView.tsx`
- [Diary entry form](https://github.com/charintornnillapat/incomeandexpence/blob/main/src/components/diary/DiaryEntryForm.tsx): `src/components/diary/DiaryEntryForm.tsx`
- [Spending insights](https://github.com/charintornnillapat/incomeandexpence/blob/main/src/components/dashboard/SpendingInsightsCard.tsx): `src/components/dashboard/SpendingInsightsCard.tsx`
- [Classification API](https://github.com/charintornnillapat/incomeandexpence/blob/main/api/classify.ts): `api/classify.ts`
- [Insights API](https://github.com/charintornnillapat/incomeandexpence/blob/main/api/insights.ts): `api/insights.ts`

### State and services

- [Finance state and mutations](https://github.com/charintornnillapat/incomeandexpence/blob/main/src/context/FinanceContext.tsx): `src/context/FinanceContext.tsx`
- [Ledger calculations](https://github.com/charintornnillapat/incomeandexpence/blob/main/src/selectors/ledger.ts): `src/selectors/ledger.ts`
- **Local storage**
- [Supabase client](https://github.com/charintornnillapat/incomeandexpence/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`

### Other components

- **Finance user**
- **Supabase service**

## Connections

- Finance user → App shell: uses (evidence: `README.md`)
- App shell → Dashboard: routes to (evidence: `src/App.tsx`)
- App shell → Transactions: routes to (evidence: `src/App.tsx`)
- App shell → Wallet management: routes to (evidence: `src/App.tsx`)
- App shell → Debt goals: routes to (evidence: `src/App.tsx`)
- App shell → Wellbeing diary: routes to (evidence: `src/App.tsx`)
- App shell → Categories and rules: routes to (evidence: `src/App.tsx`)
- Transactions → Transaction entry: opens (evidence: `src/views/TransactionsView.tsx`)
- Transactions → CSV exchange: imports (evidence: `src/views/TransactionsView.tsx`)
- Wallet management → Wallet transfers: supports (evidence: `README.md`)
- Debt goals → Transaction entry: records repayments (evidence: `src/views/DebtsView.tsx`)
- Wellbeing diary → Diary entry form: edits entries (evidence: `src/components/diary/DiaryEntryForm.tsx`)
- Transaction entry → Finance state and mutations: submits mutations (evidence: `src/components/TransactionForm.tsx`)
- CSV exchange → Finance state and mutations: imports rows (evidence: `src/components/transaction/ImportCsvModal.tsx`)
- Wallet transfers → Finance state and mutations: submits transfer (evidence: `src/components/wallet/WalletTransferForm.tsx`)
- Diary entry form → Finance state and mutations: submits entries (evidence: `src/components/diary/DiaryEntryForm.tsx`)
- Dashboard → Spending insights: shows (evidence: `README.md`)
- Finance state and mutations → Ledger calculations: uses calculations (evidence: `src/context/FinanceContext.tsx`)
- Finance state and mutations → Local storage: persists locally (evidence: `README.md`)
- Finance state and mutations → Supabase client: syncs through (evidence: `src/context/FinanceContext.tsx`)
- Supabase client → Supabase service: connects to (evidence: `README.md`)
- App shell → Account access: opens (evidence: `src/App.tsx`)
- Account access → Supabase client: authenticates with (evidence: `src/components/AuthModal.tsx`)
- Transaction entry → Classification API: classifies descriptions
- Spending insights → Insights API: requests insights
