# jayasurya1235/wealthpath architecture

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

- Interactive diagram: https://gitdiagram.com/jayasurya1235/wealthpath
- Repository: https://github.com/jayasurya1235/wealthpath

## Overview

WealthPath is a personal-finance planning app: users enter income, expenses, savings goals, and risk preferences, then review financial-health insights, ask an AI advisor, and explore investment growth scenarios. The graph separates onboarding, dashboard, investment planning, and account access, with shared client state and calculation helpers as an internal layer. Some routes and integrations are represented only by the SOURCE INDEX; edges are limited to relationships it documents or to excerpted calls.

Main entry points: [`app/onboarding/page.tsx`](https://github.com/jayasurya1235/wealthpath/blob/main/app/onboarding/page.tsx) (Onboarding flow), [`app/dashboard/page.tsx`](https://github.com/jayasurya1235/wealthpath/blob/main/app/dashboard/page.tsx) (Dashboard), [`app/invest/page.tsx`](https://github.com/jayasurya1235/wealthpath/blob/main/app/invest/page.tsx) (Investment planner), [`lib/store.ts`](https://github.com/jayasurya1235/wealthpath/blob/main/lib/store.ts) (Financial profile store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_onboarding["Financial onboarding"]
  node_onboarding_page["Onboarding flow<br/>[page.tsx]"]
  node_step_welcome["Personal details<br/>[StepWelcome.tsx]"]
  node_step_income["Income entry<br/>[StepIncome.tsx]"]
  node_step_expenses["Expense entry<br/>[StepExpenses.tsx]"]
  node_step_goals["Goals and risk<br/>[StepGoals.tsx]"]
  node_step_progress["Step progress<br/>[StepProgress.tsx]"]
end

subgraph group_dashboard["Financial dashboard"]
  node_dashboard_page["Dashboard<br/>[page.tsx]"]
  node_health_score["Health score<br/>[HealthScore.tsx]"]
  node_expense_chart["Expense chart<br/>[ExpenseChart.tsx]"]
  node_insights["Financial insights<br/>[InsightsPanel.tsx]"]
  node_advisor_panel["AI advisor panel<br/>[AIAdvisorPanel.tsx]"]
  node_advisor_api["Advisor endpoint<br/>[route.ts]"]
  node_advisor_page["Advisor page<br/>[page.tsx]"]
end

subgraph group_investing["Investment planning"]
  node_invest_page["Investment planner<br/>[page.tsx]"]
  node_allocation["Investment allocation<br/>[AllocationCard.tsx]"]
  node_growth_chart["Growth projection<br/>[GrowthChart.tsx]"]
  node_retirement["Retirement planning<br/>[RetirementCard.tsx]"]
end

subgraph group_shared["Shared services"]
  node_store[("Financial profile store<br/>[store.ts]")]
  node_calculations["Finance calculations<br/>[utils.ts]"]
  node_finance_options["Finance options<br/>[constants.ts]"]
  node_auth_signin["Sign-in page<br/>[page.tsx]"]
  node_auth_signup["Sign-up page<br/>[page.tsx]"]
  node_auth_confirm["Auth confirmation<br/>[route.ts]"]
  node_supabase_browser["Supabase browser client<br/>[client.ts]"]
  node_supabase_server["Supabase server client<br/>[server.ts]"]
  node_ui_primitives["UI primitives"]
end

node_user(("User"))

node_user -->|"enters profile"| node_onboarding_page
node_onboarding_page -->|"renders progress"| node_step_progress
node_onboarding_page -->|"renders step"| node_step_welcome
node_onboarding_page -->|"renders step"| node_step_income
node_onboarding_page -->|"renders step"| node_step_expenses
node_onboarding_page -->|"renders step"| node_step_goals
node_onboarding_page -->|"saves profile"| node_store
node_onboarding_page -->|"routes on finish"| node_dashboard_page
node_dashboard_page -->|"reads profile"| node_store
node_dashboard_page -->|"calculates score"| node_calculations
node_dashboard_page -->|"renders score"| node_health_score
node_dashboard_page -->|"renders chart"| node_expense_chart
node_dashboard_page -->|"renders insights"| node_insights
node_dashboard_page -->|"renders advisor"| node_advisor_panel
node_advisor_panel -->|"reads profile"| node_store
node_advisor_panel -->|"sends chat"| node_advisor_api
node_advisor_page -->|"uses profile"| node_store
node_user -->|"opens plan"| node_invest_page
node_invest_page -->|"reads profile"| node_store
node_invest_page -->|"selects investments"| node_finance_options
node_invest_page -->|"projects growth"| node_calculations
node_invest_page -->|"renders allocation"| node_allocation
node_invest_page -->|"renders projection"| node_growth_chart
node_invest_page -->|"renders retirement"| node_retirement
node_user -->|"signs in"| node_auth_signin
node_user -->|"creates account"| node_auth_signup
node_auth_signin -->|"authenticates"| node_supabase_browser
node_auth_signup -->|"authenticates"| node_supabase_browser
node_auth_confirm -->|"confirms session"| node_supabase_server
node_auth_signin -->|"uses controls"| node_ui_primitives
node_auth_signup -->|"uses controls"| node_ui_primitives
node_dashboard_page -->|"uses controls"| node_ui_primitives
node_onboarding_page -->|"uses controls"| node_ui_primitives

click node_onboarding_page "https://github.com/jayasurya1235/wealthpath/blob/main/app/onboarding/page.tsx"
click node_step_welcome "https://github.com/jayasurya1235/wealthpath/blob/main/components/onboarding/StepWelcome.tsx"
click node_step_income "https://github.com/jayasurya1235/wealthpath/blob/main/components/onboarding/StepIncome.tsx"
click node_step_expenses "https://github.com/jayasurya1235/wealthpath/blob/main/components/onboarding/StepExpenses.tsx"
click node_step_goals "https://github.com/jayasurya1235/wealthpath/blob/main/components/onboarding/StepGoals.tsx"
click node_step_progress "https://github.com/jayasurya1235/wealthpath/blob/main/components/onboarding/StepProgress.tsx"
click node_dashboard_page "https://github.com/jayasurya1235/wealthpath/blob/main/app/dashboard/page.tsx"
click node_health_score "https://github.com/jayasurya1235/wealthpath/blob/main/components/dashboard/HealthScore.tsx"
click node_expense_chart "https://github.com/jayasurya1235/wealthpath/blob/main/components/dashboard/ExpenseChart.tsx"
click node_insights "https://github.com/jayasurya1235/wealthpath/blob/main/components/dashboard/InsightsPanel.tsx"
click node_advisor_panel "https://github.com/jayasurya1235/wealthpath/blob/main/components/dashboard/AIAdvisorPanel.tsx"
click node_advisor_api "https://github.com/jayasurya1235/wealthpath/blob/main/app/api/advisor/route.ts"
click node_advisor_page "https://github.com/jayasurya1235/wealthpath/blob/main/app/advisor/page.tsx"
click node_invest_page "https://github.com/jayasurya1235/wealthpath/blob/main/app/invest/page.tsx"
click node_allocation "https://github.com/jayasurya1235/wealthpath/blob/main/components/invest/AllocationCard.tsx"
click node_growth_chart "https://github.com/jayasurya1235/wealthpath/blob/main/components/invest/GrowthChart.tsx"
click node_retirement "https://github.com/jayasurya1235/wealthpath/blob/main/components/invest/RetirementCard.tsx"
click node_store "https://github.com/jayasurya1235/wealthpath/blob/main/lib/store.ts"
click node_calculations "https://github.com/jayasurya1235/wealthpath/blob/main/lib/utils.ts"
click node_finance_options "https://github.com/jayasurya1235/wealthpath/blob/main/lib/constants.ts"
click node_auth_signin "https://github.com/jayasurya1235/wealthpath/blob/main/app/(auth)/sign-in/page.tsx"
click node_auth_signup "https://github.com/jayasurya1235/wealthpath/blob/main/app/(auth)/sign-up/page.tsx"
click node_auth_confirm "https://github.com/jayasurya1235/wealthpath/blob/main/app/auth/confirm/route.ts"
click node_supabase_browser "https://github.com/jayasurya1235/wealthpath/blob/main/lib/supabase/client.ts"
click node_supabase_server "https://github.com/jayasurya1235/wealthpath/blob/main/lib/supabase/server.ts"
click node_ui_primitives "https://github.com/jayasurya1235/wealthpath/tree/main/components/ui"

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_onboarding_page,node_step_welcome,node_step_income,node_step_expenses,node_step_goals,node_step_progress,node_user toneBlue
class node_dashboard_page,node_health_score,node_expense_chart,node_insights,node_advisor_panel,node_advisor_api,node_advisor_page toneAmber
class node_invest_page,node_allocation,node_growth_chart,node_retirement toneMint
class node_store,node_calculations,node_finance_options,node_auth_signin,node_auth_signup,node_auth_confirm,node_supabase_browser,node_supabase_server,node_ui_primitives toneRose
```

## Components

### Financial onboarding

- [Onboarding flow](https://github.com/jayasurya1235/wealthpath/blob/main/app/onboarding/page.tsx): `app/onboarding/page.tsx`
- [Personal details](https://github.com/jayasurya1235/wealthpath/blob/main/components/onboarding/StepWelcome.tsx): `components/onboarding/StepWelcome.tsx`
- [Income entry](https://github.com/jayasurya1235/wealthpath/blob/main/components/onboarding/StepIncome.tsx): `components/onboarding/StepIncome.tsx`
- [Expense entry](https://github.com/jayasurya1235/wealthpath/blob/main/components/onboarding/StepExpenses.tsx): `components/onboarding/StepExpenses.tsx`
- [Goals and risk](https://github.com/jayasurya1235/wealthpath/blob/main/components/onboarding/StepGoals.tsx): `components/onboarding/StepGoals.tsx`
- [Step progress](https://github.com/jayasurya1235/wealthpath/blob/main/components/onboarding/StepProgress.tsx): `components/onboarding/StepProgress.tsx`

### Financial dashboard

- [Dashboard](https://github.com/jayasurya1235/wealthpath/blob/main/app/dashboard/page.tsx): `app/dashboard/page.tsx`
- [Health score](https://github.com/jayasurya1235/wealthpath/blob/main/components/dashboard/HealthScore.tsx): `components/dashboard/HealthScore.tsx`
- [Expense chart](https://github.com/jayasurya1235/wealthpath/blob/main/components/dashboard/ExpenseChart.tsx): `components/dashboard/ExpenseChart.tsx`
- [Financial insights](https://github.com/jayasurya1235/wealthpath/blob/main/components/dashboard/InsightsPanel.tsx): `components/dashboard/InsightsPanel.tsx`
- [AI advisor panel](https://github.com/jayasurya1235/wealthpath/blob/main/components/dashboard/AIAdvisorPanel.tsx): `components/dashboard/AIAdvisorPanel.tsx`
- [Advisor endpoint](https://github.com/jayasurya1235/wealthpath/blob/main/app/api/advisor/route.ts): `app/api/advisor/route.ts`
- [Advisor page](https://github.com/jayasurya1235/wealthpath/blob/main/app/advisor/page.tsx): `app/advisor/page.tsx`

### Investment planning

- [Investment planner](https://github.com/jayasurya1235/wealthpath/blob/main/app/invest/page.tsx): `app/invest/page.tsx`
- [Investment allocation](https://github.com/jayasurya1235/wealthpath/blob/main/components/invest/AllocationCard.tsx): `components/invest/AllocationCard.tsx`
- [Growth projection](https://github.com/jayasurya1235/wealthpath/blob/main/components/invest/GrowthChart.tsx): `components/invest/GrowthChart.tsx`
- [Retirement planning](https://github.com/jayasurya1235/wealthpath/blob/main/components/invest/RetirementCard.tsx): `components/invest/RetirementCard.tsx`

### Shared services

- [Financial profile store](https://github.com/jayasurya1235/wealthpath/blob/main/lib/store.ts): `lib/store.ts`
- [Finance calculations](https://github.com/jayasurya1235/wealthpath/blob/main/lib/utils.ts): `lib/utils.ts`
- [Finance options](https://github.com/jayasurya1235/wealthpath/blob/main/lib/constants.ts): `lib/constants.ts`
- [Sign-in page](https://github.com/jayasurya1235/wealthpath/blob/main/app/(auth)/sign-in/page.tsx): `app/(auth)/sign-in/page.tsx`
- [Sign-up page](https://github.com/jayasurya1235/wealthpath/blob/main/app/(auth)/sign-up/page.tsx): `app/(auth)/sign-up/page.tsx`
- [Auth confirmation](https://github.com/jayasurya1235/wealthpath/blob/main/app/auth/confirm/route.ts): `app/auth/confirm/route.ts`
- [Supabase browser client](https://github.com/jayasurya1235/wealthpath/blob/main/lib/supabase/client.ts): `lib/supabase/client.ts`
- [Supabase server client](https://github.com/jayasurya1235/wealthpath/blob/main/lib/supabase/server.ts): `lib/supabase/server.ts`
- [UI primitives](https://github.com/jayasurya1235/wealthpath/tree/main/components/ui): `components/ui`

### Other components

- **User**

## Connections

- User → Onboarding flow: enters profile (evidence: `app/onboarding/page.tsx`)
- Onboarding flow → Step progress: renders progress (evidence: `app/onboarding/page.tsx`)
- Onboarding flow → Personal details: renders step (evidence: `app/onboarding/page.tsx`)
- Onboarding flow → Income entry: renders step (evidence: `app/onboarding/page.tsx`)
- Onboarding flow → Expense entry: renders step (evidence: `app/onboarding/page.tsx`)
- Onboarding flow → Goals and risk: renders step (evidence: `app/onboarding/page.tsx`)
- Onboarding flow → Financial profile store: saves profile (evidence: `app/onboarding/page.tsx`)
- Onboarding flow → Dashboard: routes on finish (evidence: `app/onboarding/page.tsx`)
- Dashboard → Financial profile store: reads profile (evidence: `app/dashboard/page.tsx`)
- Dashboard → Finance calculations: calculates score (evidence: `app/dashboard/page.tsx`)
- Dashboard → Health score: renders score (evidence: `app/dashboard/page.tsx`)
- Dashboard → Expense chart: renders chart (evidence: `app/dashboard/page.tsx`)
- Dashboard → Financial insights: renders insights (evidence: `app/dashboard/page.tsx`)
- Dashboard → AI advisor panel: renders advisor (evidence: `app/dashboard/page.tsx`)
- AI advisor panel → Financial profile store: reads profile (evidence: `components/dashboard/AIAdvisorPanel.tsx`)
- AI advisor panel → Advisor endpoint: sends chat (evidence: `components/dashboard/AIAdvisorPanel.tsx`)
- Advisor page → Financial profile store: uses profile (evidence: `app/advisor/page.tsx`)
- User → Investment planner: opens plan
- Investment planner → Financial profile store: reads profile (evidence: `app/invest/page.tsx`)
- Investment planner → Finance options: selects investments (evidence: `app/invest/page.tsx`)
- Investment planner → Finance calculations: projects growth (evidence: `app/invest/page.tsx`)
- Investment planner → Investment allocation: renders allocation (evidence: `app/invest/page.tsx`)
- Investment planner → Growth projection: renders projection (evidence: `app/invest/page.tsx`)
- Investment planner → Retirement planning: renders retirement (evidence: `app/invest/page.tsx`)
- User → Sign-in page: signs in (evidence: `app/(auth)/sign-in/page.tsx`)
- User → Sign-up page: creates account (evidence: `app/(auth)/sign-up/page.tsx`)
- Sign-in page → Supabase browser client: authenticates (evidence: `app/(auth)/sign-in/page.tsx`)
- Sign-up page → Supabase browser client: authenticates (evidence: `app/(auth)/sign-up/page.tsx`)
- Auth confirmation → Supabase server client: confirms session (evidence: `app/auth/confirm/route.ts`)
- Sign-in page → UI primitives: uses controls (evidence: `app/(auth)/sign-in/page.tsx`)
- Sign-up page → UI primitives: uses controls (evidence: `app/(auth)/sign-up/page.tsx`)
- Dashboard → UI primitives: uses controls (evidence: `app/dashboard/page.tsx`)
- Onboarding flow → UI primitives: uses controls (evidence: `app/onboarding/page.tsx`)
