# shristibajpai/arthsetu architecture

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

## Overview

Arthsetu is a personal-finance planning dashboard: users review their financial health, track expenses, manage emergency-fund and goal plans, and explore financial-learning content. The React app owns screen state and persists profile and planning data through browser storage; specialized views present calculations and editing workflows. Account linking and AI guidance are separate capabilities. Source excerpts establish the main UI, storage, and service relationships; unsampled backend and learning-data wiring is left unasserted.

Main entry points: [`src/App.tsx`](https://github.com/shristibajpai/arthsetu/blob/main/src/App.tsx) (App state and routing), [`src/utils/calculations.ts`](https://github.com/shristibajpai/arthsetu/blob/main/src/utils/calculations.ts) (Financial metrics), [`src/components/LearnView.tsx`](https://github.com/shristibajpai/arthsetu/blob/main/src/components/LearnView.tsx) (Learning library), [`src/utils/storage.ts`](https://github.com/shristibajpai/arthsetu/blob/main/src/utils/storage.ts) (Browser data access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["App shell"]
  node_app["App state and routing<br/>[App.tsx]"]
  node_sidebar["Navigation<br/>[Sidebar.tsx]"]
  node_header["Header controls<br/>[Header.tsx]"]
end

subgraph group_planning["Financial planning"]
  node_dashboard["Financial dashboard<br/>[DashboardView.tsx]"]
  node_expenses["Expense ledger<br/>[ExpensesView.tsx]"]
  node_emergency["Emergency fund"]
  node_goals["Goals and scenarios"]
  node_profile["Financial profile<br/>[ProfileView.tsx]"]
  node_modals["Planning forms<br/>[Modals.tsx]"]
  node_confirmation["Confirmation dialog"]
end

subgraph group_guidance["Guidance and learning"]
  node_ai_modal["AI assistant"]
  node_learn["Learning library<br/>[LearnView.tsx]"]
  node_academy["Academy content<br/>[academyData.ts]"]
end

subgraph group_integrations["Connected services"]
  node_connect["Account connection"]
  node_financial["Account aggregator"]
  node_ai_service["AI chat service<br/>[aiService.ts]"]
  node_api_server["Chat API server<br/>[server.ts]"]
end

subgraph group_foundation["Data and utilities"]
  node_storage["Browser data access<br/>[storage.ts]"]
  node_mock_data["Starter records<br/>[mockData.ts]"]
  node_calculations["Financial metrics<br/>[calculations.ts]"]
  node_formatters["Currency and formatting<br/>[formatters.ts]"]
end

node_user(("User"))
node_browser_store[("Browser local storage")]

node_user -->|"uses"| node_app
node_app -->|"renders"| node_sidebar
node_app -->|"renders"| node_header
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_expenses
node_app -->|"routes to"| node_emergency
node_app -->|"routes to"| node_goals
node_app -->|"routes to"| node_profile
node_app -->|"routes to"| node_learn
node_app -->|"renders"| node_ai_modal
node_app -->|"renders"| node_modals
node_app -->|"loads and saves"| node_storage
node_storage -->|"reads and writes"| node_browser_store
node_storage -->|"loads defaults"| node_mock_data
node_dashboard -->|"uses metrics"| node_calculations
node_expenses -->|"uses metrics"| node_calculations
node_emergency -->|"uses metrics"| node_calculations
node_calculations -->|"clamps values"| node_formatters
node_header -->|"uses navigation"| node_sidebar
node_connect -->|"requests account data"| node_financial
node_financial -->|"reads and writes"| node_browser_store
node_ai_modal -->|"sends chat"| node_ai_service
node_ai_service -.->|"posts chat request"| node_api_server
node_learn -->|"uses records"| node_mock_data
node_learn -.->|"may use content"| node_academy
node_modals -.->|"uses dialog"| node_confirmation

click node_app "https://github.com/shristibajpai/arthsetu/blob/main/src/App.tsx"
click node_sidebar "https://github.com/shristibajpai/arthsetu/blob/main/src/components/Sidebar.tsx"
click node_header "https://github.com/shristibajpai/arthsetu/blob/main/src/components/Header.tsx"
click node_dashboard "https://github.com/shristibajpai/arthsetu/blob/main/src/components/DashboardView.tsx"
click node_expenses "https://github.com/shristibajpai/arthsetu/blob/main/src/components/ExpensesView.tsx"
click node_emergency "https://github.com/shristibajpai/arthsetu/blob/main/src/components/EmergencyFundView.tsx"
click node_goals "https://github.com/shristibajpai/arthsetu/blob/main/src/components/GoalsWhatIfView.tsx"
click node_profile "https://github.com/shristibajpai/arthsetu/blob/main/src/components/ProfileView.tsx"
click node_connect "https://github.com/shristibajpai/arthsetu/blob/main/src/components/ConnectAccountModal.tsx"
click node_financial "https://github.com/shristibajpai/arthsetu/blob/main/src/services/financialDataService.ts"
click node_ai_modal "https://github.com/shristibajpai/arthsetu/blob/main/src/components/AIAssistantModal.tsx"
click node_ai_service "https://github.com/shristibajpai/arthsetu/blob/main/src/services/aiService.ts"
click node_learn "https://github.com/shristibajpai/arthsetu/blob/main/src/components/LearnView.tsx"
click node_academy "https://github.com/shristibajpai/arthsetu/blob/main/src/data/academyData.ts"
click node_modals "https://github.com/shristibajpai/arthsetu/blob/main/src/components/Modals.tsx"
click node_confirmation "https://github.com/shristibajpai/arthsetu/blob/main/src/components/ConfirmationModal.tsx"
click node_storage "https://github.com/shristibajpai/arthsetu/blob/main/src/utils/storage.ts"
click node_mock_data "https://github.com/shristibajpai/arthsetu/blob/main/src/data/mockData.ts"
click node_calculations "https://github.com/shristibajpai/arthsetu/blob/main/src/utils/calculations.ts"
click node_formatters "https://github.com/shristibajpai/arthsetu/blob/main/src/utils/formatters.ts"
click node_api_server "https://github.com/shristibajpai/arthsetu/blob/main/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_app,node_sidebar,node_header,node_user toneBlue
class node_dashboard,node_expenses,node_emergency,node_goals,node_profile,node_modals,node_confirmation,node_browser_store toneAmber
class node_ai_modal,node_learn,node_academy toneMint
class node_connect,node_financial,node_ai_service,node_api_server toneRose
class node_storage,node_mock_data,node_calculations,node_formatters toneIndigo
```

## Components

### App shell

- [App state and routing](https://github.com/shristibajpai/arthsetu/blob/main/src/App.tsx): `src/App.tsx`
- [Navigation](https://github.com/shristibajpai/arthsetu/blob/main/src/components/Sidebar.tsx): `src/components/Sidebar.tsx`
- [Header controls](https://github.com/shristibajpai/arthsetu/blob/main/src/components/Header.tsx): `src/components/Header.tsx`

### Financial planning

- [Financial dashboard](https://github.com/shristibajpai/arthsetu/blob/main/src/components/DashboardView.tsx): `src/components/DashboardView.tsx`
- [Expense ledger](https://github.com/shristibajpai/arthsetu/blob/main/src/components/ExpensesView.tsx): `src/components/ExpensesView.tsx`
- [Emergency fund](https://github.com/shristibajpai/arthsetu/blob/main/src/components/EmergencyFundView.tsx): `src/components/EmergencyFundView.tsx`
- [Goals and scenarios](https://github.com/shristibajpai/arthsetu/blob/main/src/components/GoalsWhatIfView.tsx): `src/components/GoalsWhatIfView.tsx`
- [Financial profile](https://github.com/shristibajpai/arthsetu/blob/main/src/components/ProfileView.tsx): `src/components/ProfileView.tsx`
- [Planning forms](https://github.com/shristibajpai/arthsetu/blob/main/src/components/Modals.tsx): `src/components/Modals.tsx`
- [Confirmation dialog](https://github.com/shristibajpai/arthsetu/blob/main/src/components/ConfirmationModal.tsx): `src/components/ConfirmationModal.tsx`

### Guidance and learning

- [AI assistant](https://github.com/shristibajpai/arthsetu/blob/main/src/components/AIAssistantModal.tsx): `src/components/AIAssistantModal.tsx`
- [Learning library](https://github.com/shristibajpai/arthsetu/blob/main/src/components/LearnView.tsx): `src/components/LearnView.tsx`
- [Academy content](https://github.com/shristibajpai/arthsetu/blob/main/src/data/academyData.ts): `src/data/academyData.ts`

### Connected services

- [Account connection](https://github.com/shristibajpai/arthsetu/blob/main/src/components/ConnectAccountModal.tsx): `src/components/ConnectAccountModal.tsx`
- [Account aggregator](https://github.com/shristibajpai/arthsetu/blob/main/src/services/financialDataService.ts): `src/services/financialDataService.ts`
- [AI chat service](https://github.com/shristibajpai/arthsetu/blob/main/src/services/aiService.ts): `src/services/aiService.ts`
- [Chat API server](https://github.com/shristibajpai/arthsetu/blob/main/server.ts): `server.ts`

### Data and utilities

- [Browser data access](https://github.com/shristibajpai/arthsetu/blob/main/src/utils/storage.ts): `src/utils/storage.ts`
- [Starter records](https://github.com/shristibajpai/arthsetu/blob/main/src/data/mockData.ts): `src/data/mockData.ts`
- [Financial metrics](https://github.com/shristibajpai/arthsetu/blob/main/src/utils/calculations.ts): `src/utils/calculations.ts`
- [Currency and formatting](https://github.com/shristibajpai/arthsetu/blob/main/src/utils/formatters.ts): `src/utils/formatters.ts`

### Other components

- **User**
- **Browser local storage**

## Connections

- User → App state and routing: uses (evidence: `src/App.tsx`)
- App state and routing → Navigation: renders (evidence: `src/App.tsx`)
- App state and routing → Header controls: renders (evidence: `src/App.tsx`)
- App state and routing → Financial dashboard: routes to (evidence: `src/App.tsx`)
- App state and routing → Expense ledger: routes to (evidence: `src/App.tsx`)
- App state and routing → Emergency fund: routes to (evidence: `src/App.tsx`)
- App state and routing → Goals and scenarios: routes to (evidence: `src/App.tsx`)
- App state and routing → Financial profile: routes to (evidence: `src/App.tsx`)
- App state and routing → Learning library: routes to (evidence: `src/App.tsx`)
- App state and routing → AI assistant: renders (evidence: `src/App.tsx`)
- App state and routing → Planning forms: renders (evidence: `src/App.tsx`)
- App state and routing → Browser data access: loads and saves (evidence: `src/App.tsx`)
- Browser data access → Browser local storage: reads and writes (evidence: `src/utils/storage.ts`)
- Browser data access → Starter records: loads defaults (evidence: `src/utils/storage.ts`)
- Financial dashboard → Financial metrics: uses metrics (evidence: `src/components/DashboardView.tsx`)
- Expense ledger → Financial metrics: uses metrics (evidence: `src/components/ExpensesView.tsx`)
- Emergency fund → Financial metrics: uses metrics (evidence: `src/components/EmergencyFundView.tsx`)
- Financial metrics → Currency and formatting: clamps values (evidence: `src/utils/calculations.ts`)
- Header controls → Navigation: uses navigation (evidence: `src/components/Header.tsx`)
- Account connection → Account aggregator: requests account data (evidence: `src/components/ConnectAccountModal.tsx`)
- Account aggregator → Browser local storage: reads and writes (evidence: `src/services/financialDataService.ts`)
- AI assistant → AI chat service: sends chat (evidence: `src/components/AIAssistantModal.tsx`)
- AI chat service → Chat API server: posts chat request
- Learning library → Starter records: uses records (evidence: `src/components/LearnView.tsx`)
- Learning library → Academy content: may use content
- Planning forms → Confirmation dialog: uses dialog
