# trngclone-lab9262/fin.ais.tracking-moni architecture

> Architecture diagram of the GitHub repository trngclone-lab9262/fin.ais.tracking-moni, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/trngclone-lab9262/fin.ais.tracking-moni
- Repository: https://github.com/trngclone-lab9262/fin.ais.tracking-moni

## Overview

This is a family-finance web app with a central app shell and shared household state, plus dedicated gold-vault, SkyOne mortgage, and interior-studio workspaces. The principal workflow is household sign-in, choosing a workspace, editing or reviewing financial/design data, and persisting state locally or through cloud sync. The graph follows relationships visible in excerpts or SOURCE INDEX references; unsampled subsystem internals and integrations are kept unconnected where their wiring is not evidenced.

Main entry points: [`context/FinanceContext.tsx`](https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/context/FinanceContext.tsx) (Finance context), [`app/page.tsx`](https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/app/page.tsx) (App router), [`lib/storage.ts`](https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/lib/storage.ts) (Local state storage), [`components/transactions/TransactionFormModal.tsx`](https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/components/transactions/TransactionFormModal.tsx) (Transaction entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["App shell"]
  node_app["App router<br/>[page.tsx]"]
  node_auth["Cloud auth<br/>[CloudAuthForm.tsx]"]
  node_confirm["Confirmation dialog<br/>[ConfirmDialog.tsx]"]
end

subgraph group_finance["Household finance"]
  node_finance_views["Finance workspaces<br/>[OverviewView.tsx]"]
  node_transactions["Transaction entry"]
  node_categories["Category manager"]
  node_analytics["Finance calculations<br/>[financeEngine.ts]"]
  node_alerts["Browser notifications"]
  node_reports["Monthly reports<br/>[monthlyReport.ts]"]
end

subgraph group_wealth["Gold and mortgage"]
  node_gold_ui["Gold vault workspace<br/>[GoldVaultView.tsx]"]
  node_gold_engine["Gold portfolio engine<br/>[goldEngine.ts]"]
  node_mortgage_ui["SkyOne loan workspace<br/>[SkyOneLoanView.tsx]"]
  node_mortgage_engine["Mortgage engine<br/>[mortgageEngine.ts]"]
end

subgraph group_interior["Interior studio"]
  node_interior_ui["Interior workspace"]
  node_floorplan["Floorplan model"]
  node_cad["CAD geometry"]
  node_boq["BOQ and audit"]
  node_scene["3D scene renderer"]
end

subgraph group_platform["State and security"]
  node_finance_context["Finance context<br/>[FinanceContext.tsx]"]
  node_storage[("Local state storage<br/>[storage.ts]")]
  node_auth_security["Auth security<br/>[authSecurity.ts]"]
  node_types["Domain data model<br/>[finance.ts]"]
  node_haptics["Haptic feedback<br/>[useHaptic.ts]"]
end

node_user(("Household user"))
node_cloud[("Cloud service")]

node_user -->|"opens"| node_app
node_app -->|"gates access"| node_auth
node_app -->|"reads state"| node_finance_context
node_app -.->|"renders"| node_finance_views
node_app -.->|"routes to"| node_gold_ui
node_app -->|"routes to"| node_mortgage_ui
node_app -.->|"routes to"| node_interior_ui
node_transactions -->|"updates"| node_finance_context
node_transactions -.->|"uses"| node_alerts
node_categories -->|"updates"| node_finance_context
node_categories -->|"uses"| node_confirm
node_finance_context -->|"loads and saves"| node_storage
node_finance_context -->|"uses calculations"| node_analytics
node_finance_context -->|"uses calculations"| node_gold_engine
node_finance_context -->|"uses calculations"| node_mortgage_engine
node_finance_context -->|"checks security"| node_auth_security
node_finance_context -.->|"syncs state"| node_cloud
node_analytics -->|"recalculates balances"| node_storage
node_gold_ui -.->|"reads and updates"| node_finance_context
node_mortgage_ui -.->|"reads and updates"| node_finance_context
node_interior_ui -.->|"reads and updates"| node_finance_context
node_boq -->|"simulates liquidation"| node_gold_engine
node_boq -->|"checks geometry"| node_cad
node_scene -->|"resolves collisions"| node_cad
node_scene -.->|"renders scenario"| node_floorplan
node_finance_context -->|"uses domain types"| node_types
node_storage -->|"stores domain data"| node_types
node_auth_security -->|"reads security state"| node_storage
node_confirm -->|"triggers feedback"| node_haptics

click node_app "https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/app/page.tsx"
click node_auth "https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/components/auth/CloudAuthForm.tsx"
click node_finance_context "https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/context/FinanceContext.tsx"
click node_finance_views "https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/components/views/OverviewView.tsx"
click node_transactions "https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/components/transactions/TransactionFormModal.tsx"
click node_categories "https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/components/categories/CategoryManagerSection.tsx"
click node_analytics "https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/lib/financeEngine.ts"
click node_alerts "https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/lib/browserNotifications.ts"
click node_reports "https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/lib/monthlyReport.ts"
click node_gold_ui "https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/components/views/GoldVaultView.tsx"
click node_gold_engine "https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/lib/goldEngine.ts"
click node_mortgage_ui "https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/components/views/SkyOneLoanView.tsx"
click node_mortgage_engine "https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/lib/mortgageEngine.ts"
click node_interior_ui "https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/components/views/InteriorStudioView.tsx"
click node_floorplan "https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/lib/interiorFloorplan.ts"
click node_cad "https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/lib/interiorCadEngine.ts"
click node_boq "https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/lib/interiorBoqEngine.ts"
click node_scene "https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/lib/three/interiorSceneController.ts"
click node_storage "https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/lib/storage.ts"
click node_auth_security "https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/lib/authSecurity.ts"
click node_types "https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/types/finance.ts"
click node_confirm "https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/components/common/ConfirmDialog.tsx"
click node_haptics "https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/src/hooks/useHaptic.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_confirm,node_user toneBlue
class node_finance_views,node_transactions,node_categories,node_analytics,node_alerts,node_reports,node_cloud toneAmber
class node_gold_ui,node_gold_engine,node_mortgage_ui,node_mortgage_engine toneMint
class node_interior_ui,node_floorplan,node_cad,node_boq,node_scene toneRose
class node_finance_context,node_storage,node_auth_security,node_types,node_haptics toneIndigo
```

## Components

### App shell

- [App router](https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/app/page.tsx): `app/page.tsx`
- [Cloud auth](https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/components/auth/CloudAuthForm.tsx): `components/auth/CloudAuthForm.tsx`
- [Confirmation dialog](https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/components/common/ConfirmDialog.tsx): `components/common/ConfirmDialog.tsx`

### Household finance

- [Finance workspaces](https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/components/views/OverviewView.tsx): `components/views/OverviewView.tsx`
- [Transaction entry](https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/components/transactions/TransactionFormModal.tsx): `components/transactions/TransactionFormModal.tsx`
- [Category manager](https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/components/categories/CategoryManagerSection.tsx): `components/categories/CategoryManagerSection.tsx`
- [Finance calculations](https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/lib/financeEngine.ts): `lib/financeEngine.ts`
- [Browser notifications](https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/lib/browserNotifications.ts): `lib/browserNotifications.ts`
- [Monthly reports](https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/lib/monthlyReport.ts): `lib/monthlyReport.ts`

### Gold and mortgage

- [Gold vault workspace](https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/components/views/GoldVaultView.tsx): `components/views/GoldVaultView.tsx`
- [Gold portfolio engine](https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/lib/goldEngine.ts): `lib/goldEngine.ts`
- [SkyOne loan workspace](https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/components/views/SkyOneLoanView.tsx): `components/views/SkyOneLoanView.tsx`
- [Mortgage engine](https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/lib/mortgageEngine.ts): `lib/mortgageEngine.ts`

### Interior studio

- [Interior workspace](https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/components/views/InteriorStudioView.tsx): `components/views/InteriorStudioView.tsx`
- [Floorplan model](https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/lib/interiorFloorplan.ts): `lib/interiorFloorplan.ts`
- [CAD geometry](https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/lib/interiorCadEngine.ts): `lib/interiorCadEngine.ts`
- [BOQ and audit](https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/lib/interiorBoqEngine.ts): `lib/interiorBoqEngine.ts`
- [3D scene renderer](https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/lib/three/interiorSceneController.ts): `lib/three/interiorSceneController.ts`

### State and security

- [Finance context](https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/context/FinanceContext.tsx): `context/FinanceContext.tsx`
- [Local state storage](https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/lib/storage.ts): `lib/storage.ts`
- [Auth security](https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/lib/authSecurity.ts): `lib/authSecurity.ts`
- [Domain data model](https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/types/finance.ts): `types/finance.ts`
- [Haptic feedback](https://github.com/trngclone-lab9262/fin.ais.tracking-moni/blob/main/src/hooks/useHaptic.ts): `src/hooks/useHaptic.ts`

### Other components

- **Household user**
- **Cloud service**

## Connections

- Household user → App router: opens (evidence: `app/page.tsx`)
- App router → Cloud auth: gates access (evidence: `app/page.tsx`)
- App router → Finance context: reads state (evidence: `app/page.tsx`)
- App router → Finance workspaces: renders (evidence: `app/page.tsx`)
- App router → Gold vault workspace: routes to (evidence: `app/page.tsx`)
- App router → SkyOne loan workspace: routes to (evidence: `app/page.tsx`)
- App router → Interior workspace: routes to (evidence: `app/page.tsx`)
- Transaction entry → Finance context: updates (evidence: `components/transactions/TransactionFormModal.tsx`)
- Transaction entry → Browser notifications: uses
- Category manager → Finance context: updates (evidence: `components/categories/CategoryManagerSection.tsx`)
- Category manager → Confirmation dialog: uses (evidence: `components/categories/CategoryManagerSection.tsx`)
- Finance context → Local state storage: loads and saves (evidence: `context/FinanceContext.tsx`)
- Finance context → Finance calculations: uses calculations (evidence: `context/FinanceContext.tsx`)
- Finance context → Gold portfolio engine: uses calculations (evidence: `context/FinanceContext.tsx`)
- Finance context → Mortgage engine: uses calculations (evidence: `context/FinanceContext.tsx`)
- Finance context → Auth security: checks security (evidence: `context/FinanceContext.tsx`)
- Finance context → Cloud service: syncs state
- Finance calculations → Local state storage: recalculates balances (evidence: `lib/financeEngine.ts`)
- Gold vault workspace → Finance context: reads and updates
- SkyOne loan workspace → Finance context: reads and updates
- Interior workspace → Finance context: reads and updates
- BOQ and audit → Gold portfolio engine: simulates liquidation (evidence: `lib/interiorBoqEngine.ts`)
- BOQ and audit → CAD geometry: checks geometry (evidence: `lib/interiorBoqEngine.ts`)
- 3D scene renderer → CAD geometry: resolves collisions (evidence: `lib/three/interiorSceneController.ts`)
- 3D scene renderer → Floorplan model: renders scenario (evidence: `lib/three/interiorSceneController.ts`)
- Finance context → Domain data model: uses domain types (evidence: `context/FinanceContext.tsx`)
- Local state storage → Domain data model: stores domain data (evidence: `lib/storage.ts`)
- Auth security → Local state storage: reads security state (evidence: `lib/authSecurity.ts`)
- Confirmation dialog → Haptic feedback: triggers feedback (evidence: `components/common/ConfirmDialog.tsx`)
