# shantanu700/lead_flow_frontend architecture

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

- Interactive diagram: https://gitdiagram.com/shantanu700/lead_flow_frontend
- Repository: https://github.com/shantanu700/lead_flow_frontend

## Overview

LeadFlow is a Next.js CRM frontend backed by a separate API. The main workflow is sign in, load the dashboard, manage leads and follow-ups, then review reports or export them. The graph includes the documented search, overdue notifications, and responsive/theme capabilities. Edges are limited to relationships shown in excerpts, the source index, or the README; several view implementations were not sampled, so uncertain internal calls are omitted.

Main entry points: [`app/dashboard/page.tsx`](https://github.com/shantanu700/lead_flow_frontend/blob/main/app/dashboard/page.tsx) (Dashboard Frame), [`src/client/sdk.gen.ts`](https://github.com/shantanu700/lead_flow_frontend/blob/main/src/client/sdk.gen.ts) (Generated API Operations), [`app/dashboard/use-dashboard.ts`](https://github.com/shantanu700/lead_flow_frontend/blob/main/app/dashboard/use-dashboard.ts) (Dashboard State), [`app/auth/page.tsx`](https://github.com/shantanu700/lead_flow_frontend/blob/main/app/auth/page.tsx) (Sign In / Register)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and Session"]
  node_auth["Sign In / Register<br/>[page.tsx]"]
  node_home["Product Home<br/>[home.tsx]"]
end

subgraph group_crm["Lead Management"]
  node_dashboard["Dashboard Frame<br/>[page.tsx]"]
  node_state["Dashboard State<br/>[use-dashboard.ts]"]
  node_context["Shared Dashboard Context<br/>[context.tsx]"]
  node_leadviews["Lead and Overview Views<br/>[leads.tsx]"]
  node_leadtable["Lead Table<br/>[lead-table.tsx]"]
  node_leadedit["Lead Add / Edit<br/>[lead-dialog.tsx]"]
  node_leadsheet["Lead Timeline Drawer<br/>[lead-sheet.tsx]"]
  node_followups["Follow-up Views<br/>[follow-ups.tsx]"]
  node_rail["Navigation Rail<br/>[rail.tsx]"]
end

subgraph group_insights["Search and Insights"]
  node_search["Search Palette"]
  node_reports["Reports View<br/>[reports.tsx]"]
  node_csv["CSV Export<br/>[report-csv.ts]"]
end

subgraph group_platform["Frontend and API"]
  node_api["API Configuration<br/>[api.ts]"]
  node_sdk["Generated API Operations<br/>[sdk.gen.ts]"]
  node_design["Theme and Motion<br/>[theme-provider.tsx]"]
end

node_rep(("Sales Rep"))
node_backend["LeadFlow Backend API"]

node_rep -->|"signs in"| node_auth
node_rep -->|"visits"| node_home
node_home -.->|"opens app"| node_dashboard
node_auth -->|"calls auth"| node_sdk
node_dashboard -->|"loads state"| node_state
node_dashboard -->|"provides state"| node_context
node_dashboard -->|"renders views"| node_leadviews
node_dashboard -->|"renders view"| node_followups
node_dashboard -->|"renders view"| node_reports
node_dashboard -->|"renders palette"| node_search
node_dashboard -->|"renders dialog"| node_leadedit
node_dashboard -->|"renders drawer"| node_leadsheet
node_dashboard -->|"renders navigation"| node_rail
node_context -->|"exposes state"| node_state
node_leadviews -->|"renders rows"| node_leadtable
node_state -->|"requests CRM data"| node_sdk
node_search -->|"queries leads"| node_api
node_api -->|"configures client"| node_sdk
node_sdk -->|"sends API requests"| node_backend
node_reports -.->|"exports reports"| node_csv
node_dashboard -->|"supports theme"| node_design
node_dashboard -->|"shows overdue alerts"| node_followups

click node_auth "https://github.com/shantanu700/lead_flow_frontend/blob/main/app/auth/page.tsx"
click node_home "https://github.com/shantanu700/lead_flow_frontend/blob/main/components/home/home.tsx"
click node_dashboard "https://github.com/shantanu700/lead_flow_frontend/blob/main/app/dashboard/page.tsx"
click node_state "https://github.com/shantanu700/lead_flow_frontend/blob/main/app/dashboard/use-dashboard.ts"
click node_context "https://github.com/shantanu700/lead_flow_frontend/blob/main/components/dashboard/context.tsx"
click node_leadviews "https://github.com/shantanu700/lead_flow_frontend/blob/main/components/dashboard/views/leads.tsx"
click node_leadtable "https://github.com/shantanu700/lead_flow_frontend/blob/main/components/dashboard/lead-table.tsx"
click node_leadedit "https://github.com/shantanu700/lead_flow_frontend/blob/main/components/dashboard/lead-dialog.tsx"
click node_leadsheet "https://github.com/shantanu700/lead_flow_frontend/blob/main/components/dashboard/lead-sheet.tsx"
click node_followups "https://github.com/shantanu700/lead_flow_frontend/blob/main/components/dashboard/views/follow-ups.tsx"
click node_rail "https://github.com/shantanu700/lead_flow_frontend/blob/main/components/dashboard/rail.tsx"
click node_search "https://github.com/shantanu700/lead_flow_frontend/blob/main/components/command-palette.tsx"
click node_reports "https://github.com/shantanu700/lead_flow_frontend/blob/main/components/dashboard/views/reports.tsx"
click node_csv "https://github.com/shantanu700/lead_flow_frontend/blob/main/lib/report-csv.ts"
click node_api "https://github.com/shantanu700/lead_flow_frontend/blob/main/lib/api.ts"
click node_sdk "https://github.com/shantanu700/lead_flow_frontend/blob/main/src/client/sdk.gen.ts"
click node_design "https://github.com/shantanu700/lead_flow_frontend/blob/main/components/theme-provider.tsx"

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_auth,node_home toneBlue
class node_dashboard,node_state,node_context,node_leadviews,node_leadtable,node_leadedit,node_leadsheet,node_followups,node_rail toneAmber
class node_search,node_reports,node_csv,node_backend toneMint
class node_api,node_sdk,node_design toneRose
class node_rep toneIndigo
```

## Components

### Entry and Session

- [Sign In / Register](https://github.com/shantanu700/lead_flow_frontend/blob/main/app/auth/page.tsx): `app/auth/page.tsx`
- [Product Home](https://github.com/shantanu700/lead_flow_frontend/blob/main/components/home/home.tsx): `components/home/home.tsx`

### Lead Management

- [Dashboard Frame](https://github.com/shantanu700/lead_flow_frontend/blob/main/app/dashboard/page.tsx): `app/dashboard/page.tsx`
- [Dashboard State](https://github.com/shantanu700/lead_flow_frontend/blob/main/app/dashboard/use-dashboard.ts): `app/dashboard/use-dashboard.ts`
- [Shared Dashboard Context](https://github.com/shantanu700/lead_flow_frontend/blob/main/components/dashboard/context.tsx): `components/dashboard/context.tsx`
- [Lead and Overview Views](https://github.com/shantanu700/lead_flow_frontend/blob/main/components/dashboard/views/leads.tsx): `components/dashboard/views/leads.tsx`
- [Lead Table](https://github.com/shantanu700/lead_flow_frontend/blob/main/components/dashboard/lead-table.tsx): `components/dashboard/lead-table.tsx`
- [Lead Add / Edit](https://github.com/shantanu700/lead_flow_frontend/blob/main/components/dashboard/lead-dialog.tsx): `components/dashboard/lead-dialog.tsx`
- [Lead Timeline Drawer](https://github.com/shantanu700/lead_flow_frontend/blob/main/components/dashboard/lead-sheet.tsx): `components/dashboard/lead-sheet.tsx`
- [Follow-up Views](https://github.com/shantanu700/lead_flow_frontend/blob/main/components/dashboard/views/follow-ups.tsx): `components/dashboard/views/follow-ups.tsx`
- [Navigation Rail](https://github.com/shantanu700/lead_flow_frontend/blob/main/components/dashboard/rail.tsx): `components/dashboard/rail.tsx`

### Search and Insights

- [Search Palette](https://github.com/shantanu700/lead_flow_frontend/blob/main/components/command-palette.tsx): `components/command-palette.tsx`
- [Reports View](https://github.com/shantanu700/lead_flow_frontend/blob/main/components/dashboard/views/reports.tsx): `components/dashboard/views/reports.tsx`
- [CSV Export](https://github.com/shantanu700/lead_flow_frontend/blob/main/lib/report-csv.ts): `lib/report-csv.ts`

### Frontend and API

- [API Configuration](https://github.com/shantanu700/lead_flow_frontend/blob/main/lib/api.ts): `lib/api.ts`
- [Generated API Operations](https://github.com/shantanu700/lead_flow_frontend/blob/main/src/client/sdk.gen.ts): `src/client/sdk.gen.ts`
- [Theme and Motion](https://github.com/shantanu700/lead_flow_frontend/blob/main/components/theme-provider.tsx): `components/theme-provider.tsx`

### Other components

- **Sales Rep**
- **LeadFlow Backend API**

## Connections

- Sales Rep → Sign In / Register: signs in
- Sales Rep → Product Home: visits
- Product Home → Dashboard Frame: opens app
- Sign In / Register → Generated API Operations: calls auth (evidence: `app/auth/page.tsx`)
- Dashboard Frame → Dashboard State: loads state (evidence: `app/dashboard/page.tsx`)
- Dashboard Frame → Shared Dashboard Context: provides state (evidence: `app/dashboard/page.tsx`)
- Dashboard Frame → Lead and Overview Views: renders views (evidence: `app/dashboard/page.tsx`)
- Dashboard Frame → Follow-up Views: renders view (evidence: `app/dashboard/page.tsx`)
- Dashboard Frame → Reports View: renders view (evidence: `app/dashboard/page.tsx`)
- Dashboard Frame → Search Palette: renders palette (evidence: `app/dashboard/page.tsx`)
- Dashboard Frame → Lead Add / Edit: renders dialog (evidence: `app/dashboard/page.tsx`)
- Dashboard Frame → Lead Timeline Drawer: renders drawer (evidence: `app/dashboard/page.tsx`)
- Dashboard Frame → Navigation Rail: renders navigation (evidence: `app/dashboard/page.tsx`)
- Shared Dashboard Context → Dashboard State: exposes state (evidence: `components/dashboard/context.tsx`)
- Lead and Overview Views → Lead Table: renders rows
- Dashboard State → Generated API Operations: requests CRM data (evidence: `app/dashboard/use-dashboard.ts`)
- Search Palette → API Configuration: queries leads (evidence: `components/command-palette.tsx`)
- API Configuration → Generated API Operations: configures client (evidence: `lib/api.ts`)
- Generated API Operations → LeadFlow Backend API: sends API requests
- Reports View → CSV Export: exports reports
- Dashboard Frame → Theme and Motion: supports theme
- Dashboard Frame → Follow-up Views: shows overdue alerts (evidence: `app/dashboard/page.tsx`)
