# raghdbashour/inc_app architecture

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

- Interactive diagram: https://gitdiagram.com/raghdbashour/inc_app
- Repository: https://github.com/raghdbashour/inc_app

## Overview

This is a Next.js insurance-cost estimation and client-management frontend. Users register or sign in, enter client health and demographic data for a prediction, then manage clients and review dashboard analytics and prediction comparisons. The graph also preserves the public marketing pages and shared language/theme capabilities. Edges reflect shown calls or SOURCE INDEX references; backend behavior is external, and unsampled implementations are not inferred.

Main entry points: [`components/ClientsTable.tsx`](https://github.com/raghdbashour/inc_app/blob/master/components/ClientsTable.tsx) (Client table), [`lib/getUserInfo.ts`](https://github.com/raghdbashour/inc_app/blob/master/lib/getUserInfo.ts) (User lookup), [`app/dashboard/layout.tsx`](https://github.com/raghdbashour/inc_app/blob/master/app/dashboard/layout.tsx) (Dashboard layout), [`app/page.tsx`](https://github.com/raghdbashour/inc_app/blob/master/app/page.tsx) (Public home)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App and access"]
  node_home["Public home<br/>[page.tsx]"]
  node_marketing["Marketing sections<br/>[hero-section.tsx]"]
  node_login["Login page<br/>[page.tsx]"]
  node_register["Registration page<br/>[page.tsx]"]
  node_auth["Auth requests<br/>[auth.ts]"]
  node_authcard["Auth card<br/>[auth-card.tsx]"]
  node_authtypes["Auth data types<br/>[auth.ts]"]
end

subgraph group_clients["Client workflow"]
  node_dashboard["Dashboard page<br/>[page.tsx]"]
  node_dashlayout["Dashboard layout<br/>[layout.tsx]"]
  node_clientspage["Clients page<br/>[page.tsx]"]
  node_addform["Add client form"]
  node_uploadform["Bulk client upload"]
  node_table["Client table<br/>[ClientsTable.tsx]"]
  node_profile["Client profile<br/>[client-profile.tsx]"]
  node_clientfetch["Client retrieval<br/>[getClients.ts]"]
  node_clienttypes["Client data types<br/>[client.ts]"]
  node_userinfo["User lookup<br/>[getUserInfo.ts]"]
end

subgraph group_insights["Analytics"]
  node_charts["Dashboard charts"]
  node_analysis["Analysis retrieval<br/>[getAnalysis.ts]"]
  node_analysistypes["Analysis types<br/>[analysis.ts]"]
  node_comparison["Prediction comparison"]
  node_chartdata["Chart data retrieval<br/>[getCharts.ts]"]
  node_comparedata["Comparison retrieval"]
end

subgraph group_experience["Shared experience"]
  node_sidebar["Dashboard navigation"]
  node_language["Language provider"]
  node_translations["Translation setup<br/>[i18n.ts]"]
  node_theme["Theme provider<br/>[theme-provider.tsx]"]
  node_orb["Background orb<br/>[orb.tsx]"]
end

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

node_visitor -->|"visits"| node_home
node_visitor -->|"signs in"| node_login
node_visitor -->|"registers"| node_register
node_visitor -.->|"enters client"| node_addform
node_home -->|"renders"| node_marketing
node_home -->|"renders"| node_orb
node_login -->|"renders"| node_authcard
node_register -->|"renders"| node_authcard
node_login -->|"calls login"| node_auth
node_register -->|"calls register"| node_auth
node_auth -->|"sends credentials"| node_backend
node_auth -->|"uses types"| node_authtypes
node_dashboard -->|"renders"| node_charts
node_dashboard -->|"renders"| node_table
node_dashboard -->|"requests analysis"| node_analysis
node_dashlayout -->|"loads user"| node_userinfo
node_dashlayout -->|"renders"| node_sidebar
node_dashlayout -->|"provides form"| node_addform
node_dashlayout -->|"provides upload"| node_uploadform
node_clientspage -->|"renders"| node_table
node_addform -->|"loads user"| node_userinfo
node_addform -->|"requests prediction and creates client"| node_backend
node_uploadform -->|"loads user"| node_userinfo
node_uploadform -->|"predicts and creates clients"| node_backend
node_table -->|"loads clients"| node_clientfetch
node_table -->|"updates and deletes clients"| node_backend
node_table -->|"shows profile"| node_profile
node_table -->|"uses types"| node_clienttypes
node_clientfetch -->|"fetches clients"| node_backend
node_clientfetch -->|"returns clients"| node_clienttypes
node_profile -->|"renders comparison"| node_comparison
node_comparison -->|"loads comparisons"| node_comparedata
node_comparison -->|"uses types"| node_clienttypes
node_charts -->|"loads chart data"| node_chartdata
node_charts -->|"uses types"| node_analysistypes
node_analysis -->|"uses types"| node_analysistypes
node_userinfo -->|"checks user"| node_backend
node_userinfo -->|"returns user"| node_authtypes
node_sidebar -->|"uses language"| node_language
node_sidebar -->|"uses theme"| node_theme
node_language -->|"initializes translations"| node_translations
node_marketing -.->|"appears on"| node_home

click node_home "https://github.com/raghdbashour/inc_app/blob/master/app/page.tsx"
click node_marketing "https://github.com/raghdbashour/inc_app/blob/master/components/hero-section.tsx"
click node_login "https://github.com/raghdbashour/inc_app/blob/master/app/login/page.tsx"
click node_register "https://github.com/raghdbashour/inc_app/blob/master/app/register/page.tsx"
click node_auth "https://github.com/raghdbashour/inc_app/blob/master/lib/auth.ts"
click node_authcard "https://github.com/raghdbashour/inc_app/blob/master/components/auth-card.tsx"
click node_dashboard "https://github.com/raghdbashour/inc_app/blob/master/app/dashboard/page.tsx"
click node_dashlayout "https://github.com/raghdbashour/inc_app/blob/master/app/dashboard/layout.tsx"
click node_clientspage "https://github.com/raghdbashour/inc_app/blob/master/app/dashboard/clients/page.tsx"
click node_addform "https://github.com/raghdbashour/inc_app/blob/master/components/add-client-form.tsx"
click node_uploadform "https://github.com/raghdbashour/inc_app/blob/master/components/upload-clients-form.tsx"
click node_table "https://github.com/raghdbashour/inc_app/blob/master/components/ClientsTable.tsx"
click node_profile "https://github.com/raghdbashour/inc_app/blob/master/components/client-profile.tsx"
click node_clientfetch "https://github.com/raghdbashour/inc_app/blob/master/lib/getClients.ts"
click node_clienttypes "https://github.com/raghdbashour/inc_app/blob/master/types/client.ts"
click node_userinfo "https://github.com/raghdbashour/inc_app/blob/master/lib/getUserInfo.ts"
click node_authtypes "https://github.com/raghdbashour/inc_app/blob/master/types/auth.ts"
click node_charts "https://github.com/raghdbashour/inc_app/blob/master/components/charts/dashboard-charts.tsx"
click node_analysis "https://github.com/raghdbashour/inc_app/blob/master/lib/getAnalysis.ts"
click node_analysistypes "https://github.com/raghdbashour/inc_app/blob/master/types/analysis.ts"
click node_comparison "https://github.com/raghdbashour/inc_app/blob/master/components/charts/compare-predictions.tsx"
click node_chartdata "https://github.com/raghdbashour/inc_app/blob/master/lib/getCharts.ts"
click node_comparedata "https://github.com/raghdbashour/inc_app/blob/master/lib/getComparePredictions.ts"
click node_sidebar "https://github.com/raghdbashour/inc_app/blob/master/components/dashboard-sidebar.tsx"
click node_language "https://github.com/raghdbashour/inc_app/blob/master/components/language-provider.tsx"
click node_translations "https://github.com/raghdbashour/inc_app/blob/master/lib/i18n.ts"
click node_theme "https://github.com/raghdbashour/inc_app/blob/master/components/theme-provider.tsx"
click node_orb "https://github.com/raghdbashour/inc_app/blob/master/components/orb.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_home,node_marketing,node_login,node_register,node_auth,node_authcard,node_authtypes toneBlue
class node_dashboard,node_dashlayout,node_clientspage,node_addform,node_uploadform,node_table,node_profile,node_clientfetch,node_clienttypes,node_userinfo toneAmber
class node_charts,node_analysis,node_analysistypes,node_comparison,node_chartdata,node_comparedata,node_backend toneMint
class node_sidebar,node_language,node_translations,node_theme,node_orb toneRose
class node_visitor toneIndigo
```

## Components

### App and access

- [Public home](https://github.com/raghdbashour/inc_app/blob/master/app/page.tsx): `app/page.tsx`
- [Marketing sections](https://github.com/raghdbashour/inc_app/blob/master/components/hero-section.tsx): `components/hero-section.tsx`
- [Login page](https://github.com/raghdbashour/inc_app/blob/master/app/login/page.tsx): `app/login/page.tsx`
- [Registration page](https://github.com/raghdbashour/inc_app/blob/master/app/register/page.tsx): `app/register/page.tsx`
- [Auth requests](https://github.com/raghdbashour/inc_app/blob/master/lib/auth.ts): `lib/auth.ts`
- [Auth card](https://github.com/raghdbashour/inc_app/blob/master/components/auth-card.tsx): `components/auth-card.tsx`
- [Auth data types](https://github.com/raghdbashour/inc_app/blob/master/types/auth.ts): `types/auth.ts`

### Client workflow

- [Dashboard page](https://github.com/raghdbashour/inc_app/blob/master/app/dashboard/page.tsx): `app/dashboard/page.tsx`
- [Dashboard layout](https://github.com/raghdbashour/inc_app/blob/master/app/dashboard/layout.tsx): `app/dashboard/layout.tsx`
- [Clients page](https://github.com/raghdbashour/inc_app/blob/master/app/dashboard/clients/page.tsx): `app/dashboard/clients/page.tsx`
- [Add client form](https://github.com/raghdbashour/inc_app/blob/master/components/add-client-form.tsx): `components/add-client-form.tsx`
- [Bulk client upload](https://github.com/raghdbashour/inc_app/blob/master/components/upload-clients-form.tsx): `components/upload-clients-form.tsx`
- [Client table](https://github.com/raghdbashour/inc_app/blob/master/components/ClientsTable.tsx): `components/ClientsTable.tsx`
- [Client profile](https://github.com/raghdbashour/inc_app/blob/master/components/client-profile.tsx): `components/client-profile.tsx`
- [Client retrieval](https://github.com/raghdbashour/inc_app/blob/master/lib/getClients.ts): `lib/getClients.ts`
- [Client data types](https://github.com/raghdbashour/inc_app/blob/master/types/client.ts): `types/client.ts`
- [User lookup](https://github.com/raghdbashour/inc_app/blob/master/lib/getUserInfo.ts): `lib/getUserInfo.ts`

### Analytics

- [Dashboard charts](https://github.com/raghdbashour/inc_app/blob/master/components/charts/dashboard-charts.tsx): `components/charts/dashboard-charts.tsx`
- [Analysis retrieval](https://github.com/raghdbashour/inc_app/blob/master/lib/getAnalysis.ts): `lib/getAnalysis.ts`
- [Analysis types](https://github.com/raghdbashour/inc_app/blob/master/types/analysis.ts): `types/analysis.ts`
- [Prediction comparison](https://github.com/raghdbashour/inc_app/blob/master/components/charts/compare-predictions.tsx): `components/charts/compare-predictions.tsx`
- [Chart data retrieval](https://github.com/raghdbashour/inc_app/blob/master/lib/getCharts.ts): `lib/getCharts.ts`
- [Comparison retrieval](https://github.com/raghdbashour/inc_app/blob/master/lib/getComparePredictions.ts): `lib/getComparePredictions.ts`

### Shared experience

- [Dashboard navigation](https://github.com/raghdbashour/inc_app/blob/master/components/dashboard-sidebar.tsx): `components/dashboard-sidebar.tsx`
- [Language provider](https://github.com/raghdbashour/inc_app/blob/master/components/language-provider.tsx): `components/language-provider.tsx`
- [Translation setup](https://github.com/raghdbashour/inc_app/blob/master/lib/i18n.ts): `lib/i18n.ts`
- [Theme provider](https://github.com/raghdbashour/inc_app/blob/master/components/theme-provider.tsx): `components/theme-provider.tsx`
- [Background orb](https://github.com/raghdbashour/inc_app/blob/master/components/orb.tsx): `components/orb.tsx`

### Other components

- **Visitor**
- **Application API**

## Connections

- Visitor → Public home: visits (evidence: `app/page.tsx`)
- Visitor → Login page: signs in (evidence: `app/login/page.tsx`)
- Visitor → Registration page: registers (evidence: `app/register/page.tsx`)
- Visitor → Add client form: enters client
- Public home → Marketing sections: renders (evidence: `app/page.tsx`)
- Public home → Background orb: renders (evidence: `app/page.tsx`)
- Login page → Auth card: renders (evidence: `app/login/page.tsx`)
- Registration page → Auth card: renders (evidence: `app/register/page.tsx`)
- Login page → Auth requests: calls login (evidence: `app/login/page.tsx`)
- Registration page → Auth requests: calls register (evidence: `app/register/page.tsx`)
- Auth requests → Application API: sends credentials (evidence: `lib/auth.ts`)
- Auth requests → Auth data types: uses types (evidence: `lib/auth.ts`)
- Dashboard page → Dashboard charts: renders (evidence: `app/dashboard/page.tsx`)
- Dashboard page → Client table: renders (evidence: `app/dashboard/page.tsx`)
- Dashboard page → Analysis retrieval: requests analysis (evidence: `app/dashboard/page.tsx`)
- Dashboard layout → User lookup: loads user (evidence: `app/dashboard/layout.tsx`)
- Dashboard layout → Dashboard navigation: renders (evidence: `app/dashboard/layout.tsx`)
- Dashboard layout → Add client form: provides form (evidence: `app/dashboard/layout.tsx`)
- Dashboard layout → Bulk client upload: provides upload (evidence: `app/dashboard/layout.tsx`)
- Clients page → Client table: renders (evidence: `app/dashboard/clients/page.tsx`)
- Add client form → User lookup: loads user (evidence: `components/add-client-form.tsx`)
- Add client form → Application API: requests prediction and creates client (evidence: `components/add-client-form.tsx`)
- Bulk client upload → User lookup: loads user (evidence: `components/upload-clients-form.tsx`)
- Bulk client upload → Application API: predicts and creates clients (evidence: `components/upload-clients-form.tsx`)
- Client table → Client retrieval: loads clients (evidence: `components/ClientsTable.tsx`)
- Client table → Application API: updates and deletes clients (evidence: `components/ClientsTable.tsx`)
- Client table → Client profile: shows profile (evidence: `components/ClientsTable.tsx`)
- Client table → Client data types: uses types (evidence: `components/ClientsTable.tsx`)
- Client retrieval → Application API: fetches clients (evidence: `lib/getClients.ts`)
- Client retrieval → Client data types: returns clients (evidence: `lib/getClients.ts`)
- Client profile → Prediction comparison: renders comparison (evidence: `components/client-profile.tsx`)
- Prediction comparison → Comparison retrieval: loads comparisons (evidence: `components/charts/compare-predictions.tsx`)
- Prediction comparison → Client data types: uses types (evidence: `components/charts/compare-predictions.tsx`)
- Dashboard charts → Chart data retrieval: loads chart data (evidence: `components/charts/dashboard-charts.tsx`)
- Dashboard charts → Analysis types: uses types (evidence: `components/charts/dashboard-charts.tsx`)
- Analysis retrieval → Analysis types: uses types (evidence: `lib/getAnalysis.ts`)
- User lookup → Application API: checks user (evidence: `lib/getUserInfo.ts`)
- User lookup → Auth data types: returns user (evidence: `lib/getUserInfo.ts`)
- Dashboard navigation → Language provider: uses language (evidence: `components/dashboard-sidebar.tsx`)
- Dashboard navigation → Theme provider: uses theme (evidence: `components/dashboard-sidebar.tsx`)
- Language provider → Translation setup: initializes translations (evidence: `components/language-provider.tsx`)
- Marketing sections → Public home: appears on (evidence: `app/page.tsx`)
