# rajdeep123-ops/cognicare-health-portal- architecture

> Architecture diagram of the GitHub repository rajdeep123-ops/cognicare-health-portal-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rajdeep123-ops/cognicare-health-portal-
- Repository: https://github.com/rajdeep123-ops/cognicare-health-portal-

## Overview

CogniCompanion is a cognitive-wellness portal: users create an account or sign in, complete a 30-question screening, review a symptom profile and recommended companion, and reach a dashboard for follow-up and companion access. The app stores accounts and screening results in browser storage; scoring and question data form an internal assessment layer. The server also exposes AI-generated screening summaries with a fallback. Some component wiring is inferred from the visible app structure; the excerpts do not establish whether the screening UI calls the AI endpoint.

Main entry points: [`src/App.tsx`](https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/App.tsx) (App Controller), [`src/utils/authStorage.ts`](https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/utils/authStorage.ts) (Account & Results), [`src/components/Screening/CognitiveScreening.tsx`](https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/components/Screening/CognitiveScreening.tsx) (30-Question Screening), [`src/components/Auth/LoginView.tsx`](https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/components/Auth/LoginView.tsx) (Sign In)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Portal Experience"]
  node_app["App Controller<br/>[App.tsx]"]
  node_navbar["Navigation<br/>[Navbar.tsx]"]
  node_dashboard["Wellness Dashboard<br/>[DashboardHome.tsx]"]
  node_tracker["Health Tracker"]
  node_companion["Companion Modules"]
  node_navigation["External Navigation<br/>[navigation.ts]"]
end

subgraph group_assessment["Screening &amp; Results"]
  node_screening["30-Question Screening"]
  node_questions["Question Set<br/>[questions.ts]"]
  node_scoring["Screening Scoring<br/>[scoring.ts]"]
  node_result["Result Profile"]
end

subgraph group_identity["Identity &amp; State"]
  node_login["Sign In<br/>[LoginView.tsx]"]
  node_signup["Account Setup<br/>[SignUpView.tsx]"]
  node_forgot["Password Recovery"]
  node_authstore["Account &amp; Results<br/>[authStorage.ts]"]
  node_browserstore[("Browser Storage")]
  node_security["Validation &amp; Hashing<br/>[security.ts]"]
end

subgraph group_analysis["Analysis Services"]
  node_server["Analysis API<br/>[server.ts]"]
  node_gemini["Gemini AI"]
end

node_person(("Portal User"))

node_person -->|"uses"| node_app
node_app -->|"renders"| node_navbar
node_app -->|"renders"| node_login
node_app -->|"renders"| node_signup
node_app -->|"starts"| node_screening
node_app -->|"shows"| node_dashboard
node_login -->|"authenticates"| node_authstore
node_login -->|"validates"| node_security
node_login -->|"opens"| node_forgot
node_signup -->|"registers"| node_authstore
node_authstore -->|"hashes passwords"| node_security
node_authstore -->|"loads questions"| node_questions
node_authstore -->|"scores sample"| node_scoring
node_authstore -->|"reads and writes"| node_browserstore
node_screening -->|"presents"| node_questions
node_screening -->|"scores responses"| node_scoring
node_screening -->|"shows results"| node_result
node_app -->|"loads and saves results"| node_authstore
node_app -->|"redirects"| node_navigation
node_navigation -->|"opens"| node_companion
node_dashboard -->|"includes"| node_tracker
node_dashboard -->|"opens modules"| node_navigation
node_person -->|"requests analysis"| node_server
node_server -.->|"generates summary"| node_gemini

click node_app "https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/App.tsx"
click node_navbar "https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/components/Navbar.tsx"
click node_login "https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/components/Auth/LoginView.tsx"
click node_signup "https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/components/Auth/SignUpView.tsx"
click node_forgot "https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/components/Auth/ForgotPasswordModal.tsx"
click node_authstore "https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/utils/authStorage.ts"
click node_security "https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/utils/security.ts"
click node_screening "https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/components/Screening/CognitiveScreening.tsx"
click node_questions "https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/data/questions.ts"
click node_scoring "https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/utils/scoring.ts"
click node_result "https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/components/Screening/ScreeningResultModal.tsx"
click node_dashboard "https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/components/Dashboard/DashboardHome.tsx"
click node_tracker "https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/components/Dashboard/CognitiveHealthTracker.tsx"
click node_navigation "https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/utils/navigation.ts"
click node_server "https://github.com/rajdeep123-ops/cognicare-health-portal-/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_navbar,node_dashboard,node_tracker,node_companion,node_navigation,node_person toneBlue
class node_screening,node_questions,node_scoring,node_result toneAmber
class node_login,node_signup,node_forgot,node_authstore,node_browserstore,node_security toneMint
class node_server,node_gemini toneRose
```

## Components

### Portal Experience

- [App Controller](https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/App.tsx): `src/App.tsx`
- [Navigation](https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/components/Navbar.tsx): `src/components/Navbar.tsx`
- [Wellness Dashboard](https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/components/Dashboard/DashboardHome.tsx): `src/components/Dashboard/DashboardHome.tsx`
- [Health Tracker](https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/components/Dashboard/CognitiveHealthTracker.tsx): `src/components/Dashboard/CognitiveHealthTracker.tsx`
- **Companion Modules**
- [External Navigation](https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/utils/navigation.ts): `src/utils/navigation.ts`

### Screening & Results

- [30-Question Screening](https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/components/Screening/CognitiveScreening.tsx): `src/components/Screening/CognitiveScreening.tsx`
- [Question Set](https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/data/questions.ts): `src/data/questions.ts`
- [Screening Scoring](https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/utils/scoring.ts): `src/utils/scoring.ts`
- [Result Profile](https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/components/Screening/ScreeningResultModal.tsx): `src/components/Screening/ScreeningResultModal.tsx`

### Identity & State

- [Sign In](https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/components/Auth/LoginView.tsx): `src/components/Auth/LoginView.tsx`
- [Account Setup](https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/components/Auth/SignUpView.tsx): `src/components/Auth/SignUpView.tsx`
- [Password Recovery](https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/components/Auth/ForgotPasswordModal.tsx): `src/components/Auth/ForgotPasswordModal.tsx`
- [Account & Results](https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/utils/authStorage.ts): `src/utils/authStorage.ts`
- **Browser Storage**
- [Validation & Hashing](https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/src/utils/security.ts): `src/utils/security.ts`

### Analysis Services

- [Analysis API](https://github.com/rajdeep123-ops/cognicare-health-portal-/blob/main/server.ts): `server.ts`
- **Gemini AI**

### Other components

- **Portal User**

## Connections

- Portal User → App Controller: uses
- App Controller → Navigation: renders
- App Controller → Sign In: renders
- App Controller → Account Setup: renders
- App Controller → 30-Question Screening: starts
- App Controller → Wellness Dashboard: shows
- Sign In → Account & Results: authenticates
- Sign In → Validation & Hashing: validates
- Sign In → Password Recovery: opens
- Account Setup → Account & Results: registers
- Account & Results → Validation & Hashing: hashes passwords
- Account & Results → Question Set: loads questions
- Account & Results → Screening Scoring: scores sample
- Account & Results → Browser Storage: reads and writes
- 30-Question Screening → Question Set: presents
- 30-Question Screening → Screening Scoring: scores responses
- 30-Question Screening → Result Profile: shows results
- App Controller → Account & Results: loads and saves results
- App Controller → External Navigation: redirects
- External Navigation → Companion Modules: opens
- Wellness Dashboard → Health Tracker: includes
- Wellness Dashboard → External Navigation: opens modules
- Portal User → Analysis API: requests analysis
- Analysis API → Gemini AI: generates summary
