# isaac-priyadarshan/finance-diary architecture

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

- Interactive diagram: https://gitdiagram.com/isaac-priyadarshan/finance-diary
- Repository: https://github.com/isaac-priyadarshan/finance-diary

## Overview

Clear Budget Flow is a two-person personal-finance app for tracking spending, accounts, obligations, and investments. The principal workflow is profile selection, navigation to a finance screen, then reading or changing typed financial data through server functions backed by Supabase. Separate branches cover budgeting and transactions, personal ledgers and accounts, asset pricing, planning, and category customization. The graph follows documented capabilities and sampled references; unsampled screen-to-data wiring is not inferred.

Main entry points: [`src/lib/queries.ts`](https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/lib/queries.ts) (Query definitions), [`src/lib/db.server.ts`](https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/lib/db.server.ts) (Server database access), [`src/lib/market.functions.ts`](https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/lib/market.functions.ts) (Instrument lookup), [`src/routes/index.tsx`](https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/routes/index.tsx) (App entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App experience"]
  node_index["App entry<br/>[index.tsx]"]
  node_identity["Profile identity"]
  node_remembered["Remembered choices<br/>[useRemembered.ts]"]
  node_shell["Navigation shell<br/>[AppShell.tsx]"]
  node_screens["Finance screens"]
end

subgraph group_money["Money tracking"]
  node_transactions["Transactions and budgets"]
  node_budget["Budget tracking"]
  node_wallets["Wallets and accounts"]
  node_people["Borrowed and lent"]
  node_category["Category studio"]
  node_categoryui["Category manager"]
end

subgraph group_planning["Planning and assets"]
  node_assets["Asset tracking"]
  node_market["Instrument lookup"]
  node_marketproviders["Market providers"]
  node_planningfunctions["Planning data"]
  node_planningview["Planning views<br/>[PlanningViews.tsx]"]
end

subgraph group_data["Data and services"]
  node_queries["Query definitions<br/>[queries.ts]"]
  node_db["Server database access<br/>[db.server.ts]"]
  node_supabase[("Supabase database")]
  node_syncroute["Price sync endpoint<br/>[sync-prices.ts]"]
  node_pricesync["Price synchronization"]
end

node_person(("Two-person user"))
node_yahoo["Yahoo Finance"]
node_mfapi["mfapi.in"]
node_coingecko["CoinGecko"]

node_person -->|"opens app"| node_index
node_index -->|"checks profile"| node_identity
node_index -->|"renders"| node_shell
node_index -.->|"selects screen"| node_screens
node_identity -->|"provides profile"| node_remembered
node_shell -->|"routes screens"| node_screens
node_person -->|"tracks finances"| node_screens
node_queries -->|"queries"| node_transactions
node_queries -->|"queries"| node_budget
node_queries -->|"queries"| node_wallets
node_queries -->|"queries"| node_people
node_queries -->|"queries"| node_assets
node_queries -.->|"queries"| node_planningfunctions
node_categoryui -->|"loads categories"| node_category
node_categoryui -->|"reads profile"| node_identity
node_planningview -->|"loads planning"| node_planningfunctions
node_planningview -.->|"shows projections"| node_person
node_market -->|"uses providers"| node_marketproviders
node_market -.->|"fetches quotes"| node_yahoo
node_market -.->|"fetches quotes"| node_mfapi
node_market -.->|"fetches quotes"| node_coingecko
node_syncroute -->|"dispatches sync"| node_pricesync
node_pricesync -.->|"updates prices"| node_assets
node_transactions -.->|"reads and writes"| node_db
node_budget -.->|"reads and writes"| node_db
node_wallets -.->|"reads and writes"| node_db
node_people -->|"reads and writes"| node_db
node_planningfunctions -->|"reads and writes"| node_db
node_db -.->|"accesses data"| node_supabase

click node_index "https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/routes/index.tsx"
click node_identity "https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/components/app/IdentityProvider.tsx"
click node_remembered "https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/hooks/useRemembered.ts"
click node_shell "https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/components/app/AppShell.tsx"
click node_screens "https://github.com/isaac-priyadarshan/finance-diary/tree/main/src/components/screens"
click node_transactions "https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/lib/transactions.functions.ts"
click node_budget "https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/lib/budgets.functions.ts"
click node_wallets "https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/lib/accounts.functions.ts"
click node_people "https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/lib/person-entries.functions.ts"
click node_assets "https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/lib/assets.functions.ts"
click node_market "https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/lib/market.functions.ts"
click node_marketproviders "https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/lib/market-providers.server.ts"
click node_planningfunctions "https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/lib/planning.functions.ts"
click node_planningview "https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/components/planning/PlanningViews.tsx"
click node_category "https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/lib/category-studio.functions.ts"
click node_categoryui "https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/components/settings/CategoryManager.tsx"
click node_queries "https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/lib/queries.ts"
click node_db "https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/lib/db.server.ts"
click node_syncroute "https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/routes/api/public/hooks/sync-prices.ts"
click node_pricesync "https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/lib/price-sync.server.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_index,node_identity,node_remembered,node_shell,node_screens,node_person toneBlue
class node_transactions,node_budget,node_wallets,node_people,node_category,node_categoryui toneAmber
class node_assets,node_market,node_marketproviders,node_planningfunctions,node_planningview,node_mfapi toneMint
class node_queries,node_db,node_supabase,node_syncroute,node_pricesync toneRose
class node_yahoo,node_coingecko toneIndigo
```

## Components

### App experience

- [App entry](https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/routes/index.tsx): `src/routes/index.tsx`
- [Profile identity](https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/components/app/IdentityProvider.tsx): `src/components/app/IdentityProvider.tsx`
- [Remembered choices](https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/hooks/useRemembered.ts): `src/hooks/useRemembered.ts`
- [Navigation shell](https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/components/app/AppShell.tsx): `src/components/app/AppShell.tsx`
- [Finance screens](https://github.com/isaac-priyadarshan/finance-diary/tree/main/src/components/screens): `src/components/screens`

### Money tracking

- [Transactions and budgets](https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/lib/transactions.functions.ts): `src/lib/transactions.functions.ts`
- [Budget tracking](https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/lib/budgets.functions.ts): `src/lib/budgets.functions.ts`
- [Wallets and accounts](https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/lib/accounts.functions.ts): `src/lib/accounts.functions.ts`
- [Borrowed and lent](https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/lib/person-entries.functions.ts): `src/lib/person-entries.functions.ts`
- [Category studio](https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/lib/category-studio.functions.ts): `src/lib/category-studio.functions.ts`
- [Category manager](https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/components/settings/CategoryManager.tsx): `src/components/settings/CategoryManager.tsx`

### Planning and assets

- [Asset tracking](https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/lib/assets.functions.ts): `src/lib/assets.functions.ts`
- [Instrument lookup](https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/lib/market.functions.ts): `src/lib/market.functions.ts`
- [Market providers](https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/lib/market-providers.server.ts): `src/lib/market-providers.server.ts`
- [Planning data](https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/lib/planning.functions.ts): `src/lib/planning.functions.ts`
- [Planning views](https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/components/planning/PlanningViews.tsx): `src/components/planning/PlanningViews.tsx`

### Data and services

- [Query definitions](https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/lib/queries.ts): `src/lib/queries.ts`
- [Server database access](https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/lib/db.server.ts): `src/lib/db.server.ts`
- **Supabase database**
- [Price sync endpoint](https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/routes/api/public/hooks/sync-prices.ts): `src/routes/api/public/hooks/sync-prices.ts`
- [Price synchronization](https://github.com/isaac-priyadarshan/finance-diary/blob/main/src/lib/price-sync.server.ts): `src/lib/price-sync.server.ts`

### Other components

- **Two-person user**
- **Yahoo Finance**
- **mfapi.in**
- **CoinGecko**

## Connections

- Two-person user → App entry: opens app
- App entry → Profile identity: checks profile (evidence: `src/routes/index.tsx`)
- App entry → Navigation shell: renders (evidence: `src/routes/index.tsx`)
- App entry → Finance screens: selects screen
- Profile identity → Remembered choices: provides profile (evidence: `src/hooks/useRemembered.ts`)
- Navigation shell → Finance screens: routes screens (evidence: `src/components/app/AppShell.tsx`)
- Two-person user → Finance screens: tracks finances
- Query definitions → Transactions and budgets: queries (evidence: `src/lib/queries.ts`)
- Query definitions → Budget tracking: queries (evidence: `src/lib/queries.ts`)
- Query definitions → Wallets and accounts: queries (evidence: `src/lib/queries.ts`)
- Query definitions → Borrowed and lent: queries (evidence: `src/lib/queries.ts`)
- Query definitions → Asset tracking: queries (evidence: `src/lib/queries.ts`)
- Query definitions → Planning data: queries
- Category manager → Category studio: loads categories (evidence: `src/components/settings/CategoryManager.tsx`)
- Category manager → Profile identity: reads profile (evidence: `src/components/settings/CategoryManager.tsx`)
- Planning views → Planning data: loads planning (evidence: `src/components/planning/PlanningViews.tsx`)
- Planning views → Two-person user: shows projections
- Instrument lookup → Market providers: uses providers (evidence: `src/lib/market.functions.ts`)
- Instrument lookup → Yahoo Finance: fetches quotes
- Instrument lookup → mfapi.in: fetches quotes
- Instrument lookup → CoinGecko: fetches quotes
- Price sync endpoint → Price synchronization: dispatches sync (evidence: `src/routes/api/public/hooks/sync-prices.ts`)
- Price synchronization → Asset tracking: updates prices
- Transactions and budgets → Server database access: reads and writes
- Budget tracking → Server database access: reads and writes
- Wallets and accounts → Server database access: reads and writes
- Borrowed and lent → Server database access: reads and writes (evidence: `src/lib/person-entries.functions.ts`)
- Planning data → Server database access: reads and writes (evidence: `src/lib/planning.functions.ts`)
- Server database access → Supabase database: accesses data
