# finpass/frontend architecture

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

- Interactive diagram: https://gitdiagram.com/finpass/frontend
- Repository: https://github.com/finpass/frontend

## Overview

Finpass is a financial-planning frontend. Visitors encounter a public product overview, then authenticate and complete a consent-led financial profile; authenticated users can explore dashboard views, portfolio information, recommendations, news, settings, and AI advisory. The graph emphasizes these user-facing stages and the shared API runtime. Dashboard page-to-view links and sampled auth/onboarding calls are visible in the supplied evidence; several dashboard internals and integrations are not, so their connections are omitted rather than inferred.

Main entry points: [`src/features/auth/state/auth-context.tsx`](https://github.com/finpass/frontend/blob/main/src/features/auth/state/auth-context.tsx) (Auth session), [`src/lib/http.ts`](https://github.com/finpass/frontend/blob/main/src/lib/http.ts) (HTTP client), [`src/features/profile/components/onboarding-flow.tsx`](https://github.com/finpass/frontend/blob/main/src/features/profile/components/onboarding-flow.tsx) (Profile wizard), [`src/features/dashboard/components/home-route.tsx`](https://github.com/finpass/frontend/blob/main/src/features/dashboard/components/home-route.tsx) (Dashboard home)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public experience"]
  node_landing["Product overview<br/>[page.tsx]"]
  node_landing_sections["Product sections"]
end

subgraph group_identity["Authentication"]
  node_auth_provider["Auth session<br/>[auth-context.tsx]"]
  node_auth_modal["Sign-in flows<br/>[auth-modal.tsx]"]
  node_auth_api["Auth API<br/>[auth-api.ts]"]
end

subgraph group_profile["Financial profile"]
  node_onboarding_route["Onboarding route<br/>[page.tsx]"]
  node_profile_flow["Profile wizard"]
  node_profile_state["Profile state<br/>[use-profile.ts]"]
end

subgraph group_dashboard["Planning dashboard"]
  node_dashboard_home["Dashboard home<br/>[home-route.tsx]"]
  node_financial_view["Financial overview<br/>[financial-view.tsx]"]
  node_portfolio_view["Portfolio<br/>[portfolio-view.tsx]"]
  node_advisory_view["AI advisory<br/>[advisory-view.tsx]"]
  node_advisory_api["Advisory API<br/>[advisory-api.ts]"]
  node_compare_view["Comparison<br/>[compare-view.tsx]"]
  node_discover_view["Discovery<br/>[discover-view.tsx]"]
  node_news_view["Financial news<br/>[news-view.tsx]"]
  node_settings_view["Settings<br/>[settings-view.tsx]"]
end

subgraph group_runtime["Shared runtime"]
  node_http["HTTP client<br/>[http.ts]"]
  node_api_errors["API errors<br/>[api-error.ts]"]
end

node_visitor(("Visitor"))
node_backend{{"Backend API"}}

node_visitor -->|"visits"| node_landing
node_landing -->|"renders"| node_landing_sections
node_landing_sections -->|"opens auth"| node_auth_provider
node_auth_provider -->|"refreshes session"| node_auth_api
node_auth_provider -->|"renders"| node_auth_modal
node_auth_modal -->|"returns session"| node_auth_provider
node_auth_api -->|"calls"| node_http
node_onboarding_route -->|"renders"| node_profile_flow
node_profile_flow -->|"uses profile"| node_profile_state
node_profile_flow -->|"checks session"| node_auth_provider
node_dashboard_home -->|"renders"| node_financial_view
node_dashboard_home -->|"renders"| node_portfolio_view
node_advisory_view -->|"requests turns"| node_advisory_api
node_visitor -.-> node_backend
node_http -->|"sends requests"| node_backend
node_http -->|"normalizes errors"| node_api_errors
node_api_errors -->|"provides conversion"| node_http

click node_landing "https://github.com/finpass/frontend/blob/main/src/app/page.tsx"
click node_landing_sections "https://github.com/finpass/frontend/tree/main/src/components/sections"
click node_auth_provider "https://github.com/finpass/frontend/blob/main/src/features/auth/state/auth-context.tsx"
click node_auth_modal "https://github.com/finpass/frontend/blob/main/src/features/auth/components/auth-modal.tsx"
click node_auth_api "https://github.com/finpass/frontend/blob/main/src/features/auth/api/auth-api.ts"
click node_onboarding_route "https://github.com/finpass/frontend/blob/main/src/app/onboarding/page.tsx"
click node_profile_flow "https://github.com/finpass/frontend/blob/main/src/features/profile/components/onboarding-flow.tsx"
click node_profile_state "https://github.com/finpass/frontend/blob/main/src/features/profile/state/use-profile.ts"
click node_dashboard_home "https://github.com/finpass/frontend/blob/main/src/features/dashboard/components/home-route.tsx"
click node_financial_view "https://github.com/finpass/frontend/blob/main/src/features/dashboard/components/financial-view.tsx"
click node_portfolio_view "https://github.com/finpass/frontend/blob/main/src/features/dashboard/components/portfolio-view.tsx"
click node_advisory_view "https://github.com/finpass/frontend/blob/main/src/features/dashboard/components/advisory-view.tsx"
click node_advisory_api "https://github.com/finpass/frontend/blob/main/src/features/dashboard/api/advisory-api.ts"
click node_compare_view "https://github.com/finpass/frontend/blob/main/src/features/dashboard/components/compare-view.tsx"
click node_discover_view "https://github.com/finpass/frontend/blob/main/src/features/dashboard/components/discover-view.tsx"
click node_news_view "https://github.com/finpass/frontend/blob/main/src/features/dashboard/components/news-view.tsx"
click node_settings_view "https://github.com/finpass/frontend/blob/main/src/features/dashboard/components/settings-view.tsx"
click node_http "https://github.com/finpass/frontend/blob/main/src/lib/http.ts"
click node_api_errors "https://github.com/finpass/frontend/blob/main/src/lib/api-error.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_landing,node_landing_sections toneBlue
class node_auth_provider,node_auth_modal,node_auth_api toneAmber
class node_onboarding_route,node_profile_flow,node_profile_state,node_backend toneMint
class node_dashboard_home,node_financial_view,node_portfolio_view,node_advisory_view,node_advisory_api,node_compare_view,node_discover_view,node_news_view,node_settings_view toneRose
class node_http,node_api_errors,node_visitor toneIndigo
```

## Components

### Public experience

- [Product overview](https://github.com/finpass/frontend/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Product sections](https://github.com/finpass/frontend/tree/main/src/components/sections): `src/components/sections`

### Authentication

- [Auth session](https://github.com/finpass/frontend/blob/main/src/features/auth/state/auth-context.tsx): `src/features/auth/state/auth-context.tsx`
- [Sign-in flows](https://github.com/finpass/frontend/blob/main/src/features/auth/components/auth-modal.tsx): `src/features/auth/components/auth-modal.tsx`
- [Auth API](https://github.com/finpass/frontend/blob/main/src/features/auth/api/auth-api.ts): `src/features/auth/api/auth-api.ts`

### Financial profile

- [Onboarding route](https://github.com/finpass/frontend/blob/main/src/app/onboarding/page.tsx): `src/app/onboarding/page.tsx`
- [Profile wizard](https://github.com/finpass/frontend/blob/main/src/features/profile/components/onboarding-flow.tsx): `src/features/profile/components/onboarding-flow.tsx`
- [Profile state](https://github.com/finpass/frontend/blob/main/src/features/profile/state/use-profile.ts): `src/features/profile/state/use-profile.ts`

### Planning dashboard

- [Dashboard home](https://github.com/finpass/frontend/blob/main/src/features/dashboard/components/home-route.tsx): `src/features/dashboard/components/home-route.tsx`
- [Financial overview](https://github.com/finpass/frontend/blob/main/src/features/dashboard/components/financial-view.tsx): `src/features/dashboard/components/financial-view.tsx`
- [Portfolio](https://github.com/finpass/frontend/blob/main/src/features/dashboard/components/portfolio-view.tsx): `src/features/dashboard/components/portfolio-view.tsx`
- [AI advisory](https://github.com/finpass/frontend/blob/main/src/features/dashboard/components/advisory-view.tsx): `src/features/dashboard/components/advisory-view.tsx`
- [Advisory API](https://github.com/finpass/frontend/blob/main/src/features/dashboard/api/advisory-api.ts): `src/features/dashboard/api/advisory-api.ts`
- [Comparison](https://github.com/finpass/frontend/blob/main/src/features/dashboard/components/compare-view.tsx): `src/features/dashboard/components/compare-view.tsx`
- [Discovery](https://github.com/finpass/frontend/blob/main/src/features/dashboard/components/discover-view.tsx): `src/features/dashboard/components/discover-view.tsx`
- [Financial news](https://github.com/finpass/frontend/blob/main/src/features/dashboard/components/news-view.tsx): `src/features/dashboard/components/news-view.tsx`
- [Settings](https://github.com/finpass/frontend/blob/main/src/features/dashboard/components/settings-view.tsx): `src/features/dashboard/components/settings-view.tsx`

### Shared runtime

- [HTTP client](https://github.com/finpass/frontend/blob/main/src/lib/http.ts): `src/lib/http.ts`
- [API errors](https://github.com/finpass/frontend/blob/main/src/lib/api-error.ts): `src/lib/api-error.ts`

### Other components

- **Visitor**
- **Backend API**

## Connections

- Visitor → Product overview: visits (evidence: `src/app/page.tsx`)
- Product overview → Product sections: renders (evidence: `src/app/page.tsx`)
- Product sections → Auth session: opens auth (evidence: `src/components/sections/navbar.tsx`)
- Auth session → Auth API: refreshes session (evidence: `src/features/auth/state/auth-context.tsx`)
- Auth session → Sign-in flows: renders (evidence: `src/features/auth/state/auth-context.tsx`)
- Sign-in flows → Auth session: returns session (evidence: `src/features/auth/components/auth-modal.tsx`)
- Auth API → HTTP client: calls (evidence: `src/features/auth/api/auth-api.ts`)
- Onboarding route → Profile wizard: renders (evidence: `src/app/onboarding/page.tsx`)
- Profile wizard → Profile state: uses profile (evidence: `src/features/profile/components/onboarding-flow.tsx`)
- Profile wizard → Auth session: checks session (evidence: `src/features/profile/components/onboarding-flow.tsx`)
- Dashboard home → Financial overview: renders (evidence: `src/features/dashboard/components/home-route.tsx`)
- Dashboard home → Portfolio: renders (evidence: `src/features/dashboard/components/home-route.tsx`)
- AI advisory → Advisory API: requests turns (evidence: `src/features/dashboard/components/advisory-view.tsx`)
- Visitor → Backend API
- HTTP client → Backend API: sends requests (evidence: `src/lib/http.ts`)
- HTTP client → API errors: normalizes errors (evidence: `src/lib/http.ts`)
- API errors → HTTP client: provides conversion (evidence: `src/lib/api-error.ts`)
