# vinayvermavlogs/empathic-health-insights architecture

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

- Interactive diagram: https://gitdiagram.com/vinayvermavlogs/empathic-health-insights
- Repository: https://github.com/vinayvermavlogs/empathic-health-insights

## Overview

Emotion Nova is a React application for emotion and wellness monitoring, with account, profile, chat, analysis, and reporting screens. The main dashboard currently obtains its live stream from a simulator, derives health metrics and recommendations, and presents camera-analysis and report features; authenticated sessions can be saved to Supabase. The README also describes vision analysis and collaboration. Those capabilities appear in the tree, but their complete runtime wiring is not shown in the excerpts, so unverified links are omitted. The graph reflects the sampled source and README rather than assuming all advertised integrations are active.

Main entry points: [`src/pages/Index.tsx`](https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/pages/Index.tsx) (Monitoring Dashboard), [`src/App.tsx`](https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/App.tsx) (Routes and Shell), [`src/lib/healthMapping.ts`](https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/lib/healthMapping.ts) (Emotion Health Mapping), [`src/integrations/supabase/client.ts`](https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/integrations/supabase/client.ts) (Supabase)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_app["Routes and Shell<br/>[App.tsx]"]
  node_dashboard["Monitoring Dashboard<br/>[Index.tsx]"]
  node_architecture["Architecture Explorer<br/>[Architecture.tsx]"]
  node_ui["UI Components"]
end

subgraph group_analysis["Emotion Analysis"]
  node_camera["Camera Analysis<br/>[WebcamAnalysis.tsx]"]
  node_simulator["Emotion Stream Simulator"]
  node_health["Emotion Health Mapping<br/>[healthMapping.ts]"]
  node_facefn["Face Analysis Function<br/>[index.ts]"]
end

subgraph group_wellness["Wellness Insights"]
  node_emotionviews["Emotion Panels<br/>[EmotionPanel.tsx]"]
  node_recommendations["Recommendations"]
  node_aiinsights["AI Insights Panel"]
  node_reports["Wellness Report Export<br/>[ReportExport.tsx]"]
  node_healthcard["Mental Health Card"]
  node_moodanalysis["Mood Analysis<br/>[MoodAnalysis.tsx]"]
end

subgraph group_services["Accounts and Services"]
  node_auth["Authentication<br/>[Auth.tsx]"]
  node_profile["User Profile<br/>[Profile.tsx]"]
  node_session["Session Persistence<br/>[useSessionSaver.ts]"]
  node_supabase[("Supabase<br/>[client.ts]")]
  node_aichat["AI Chat<br/>[AIChat.tsx]"]
  node_chatfn["Health Chat Function<br/>[index.ts]"]
end

node_user(("User"))

node_user -->|"opens"| node_app
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_auth
node_app -->|"routes to"| node_profile
node_app -->|"routes to"| node_aichat
node_app -->|"routes to"| node_healthcard
node_app -->|"routes to"| node_moodanalysis
node_app -->|"routes to"| node_architecture
node_dashboard -->|"reads stream"| node_simulator
node_simulator -->|"maps metrics"| node_health
node_dashboard -->|"gets recommendations"| node_health
node_dashboard -->|"renders"| node_camera
node_camera -.->|"may invoke"| node_facefn
node_dashboard -->|"renders"| node_emotionviews
node_dashboard -->|"renders"| node_recommendations
node_dashboard -->|"renders"| node_aiinsights
node_dashboard -->|"renders"| node_reports
node_reports -->|"uses metrics"| node_health
node_dashboard -->|"saves session"| node_session
node_session -->|"writes history"| node_supabase
node_auth -->|"authenticates"| node_supabase
node_profile -->|"uses client"| node_supabase
node_moodanalysis -->|"uses client"| node_supabase
node_healthcard -->|"uses mappings"| node_health
node_aichat -.->|"may invoke"| node_chatfn
node_dashboard -->|"uses controls"| node_ui

click node_app "https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/App.tsx"
click node_dashboard "https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/pages/Index.tsx"
click node_camera "https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/components/WebcamAnalysis.tsx"
click node_simulator "https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/hooks/useEmotionSimulator.ts"
click node_health "https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/lib/healthMapping.ts"
click node_facefn "https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/supabase/functions/analyze-face/index.ts"
click node_emotionviews "https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/components/EmotionPanel.tsx"
click node_recommendations "https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/components/RecommendationsPanel.tsx"
click node_aiinsights "https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/components/AIInsightsPanel.tsx"
click node_reports "https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/components/ReportExport.tsx"
click node_healthcard "https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/pages/MentalHealthCard.tsx"
click node_moodanalysis "https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/pages/MoodAnalysis.tsx"
click node_auth "https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/pages/Auth.tsx"
click node_profile "https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/pages/Profile.tsx"
click node_session "https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/hooks/useSessionSaver.ts"
click node_supabase "https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/integrations/supabase/client.ts"
click node_aichat "https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/pages/AIChat.tsx"
click node_chatfn "https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/supabase/functions/health-chat/index.ts"
click node_architecture "https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/pages/Architecture.tsx"
click node_ui "https://github.com/vinayvermavlogs/empathic-health-insights/tree/main/src/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_app,node_dashboard,node_architecture,node_ui,node_user toneBlue
class node_camera,node_simulator,node_health,node_facefn toneAmber
class node_emotionviews,node_recommendations,node_aiinsights,node_reports,node_healthcard,node_moodanalysis toneMint
class node_auth,node_profile,node_session,node_supabase,node_aichat,node_chatfn toneRose
```

## Components

### Application

- [Routes and Shell](https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/App.tsx): `src/App.tsx`
- [Monitoring Dashboard](https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/pages/Index.tsx): `src/pages/Index.tsx`
- [Architecture Explorer](https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/pages/Architecture.tsx): `src/pages/Architecture.tsx`
- [UI Components](https://github.com/vinayvermavlogs/empathic-health-insights/tree/main/src/components/ui): `src/components/ui`

### Emotion Analysis

- [Camera Analysis](https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/components/WebcamAnalysis.tsx): `src/components/WebcamAnalysis.tsx`
- [Emotion Stream Simulator](https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/hooks/useEmotionSimulator.ts): `src/hooks/useEmotionSimulator.ts`
- [Emotion Health Mapping](https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/lib/healthMapping.ts): `src/lib/healthMapping.ts`
- [Face Analysis Function](https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/supabase/functions/analyze-face/index.ts): `supabase/functions/analyze-face/index.ts`

### Wellness Insights

- [Emotion Panels](https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/components/EmotionPanel.tsx): `src/components/EmotionPanel.tsx`
- [Recommendations](https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/components/RecommendationsPanel.tsx): `src/components/RecommendationsPanel.tsx`
- [AI Insights Panel](https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/components/AIInsightsPanel.tsx): `src/components/AIInsightsPanel.tsx`
- [Wellness Report Export](https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/components/ReportExport.tsx): `src/components/ReportExport.tsx`
- [Mental Health Card](https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/pages/MentalHealthCard.tsx): `src/pages/MentalHealthCard.tsx`
- [Mood Analysis](https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/pages/MoodAnalysis.tsx): `src/pages/MoodAnalysis.tsx`

### Accounts and Services

- [Authentication](https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/pages/Auth.tsx): `src/pages/Auth.tsx`
- [User Profile](https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/pages/Profile.tsx): `src/pages/Profile.tsx`
- [Session Persistence](https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/hooks/useSessionSaver.ts): `src/hooks/useSessionSaver.ts`
- [Supabase](https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/integrations/supabase/client.ts): `src/integrations/supabase/client.ts`
- [AI Chat](https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/src/pages/AIChat.tsx): `src/pages/AIChat.tsx`
- [Health Chat Function](https://github.com/vinayvermavlogs/empathic-health-insights/blob/main/supabase/functions/health-chat/index.ts): `supabase/functions/health-chat/index.ts`

### Other components

- **User**

## Connections

- User → Routes and Shell: opens (evidence: `src/App.tsx`)
- Routes and Shell → Monitoring Dashboard: routes to (evidence: `src/App.tsx`)
- Routes and Shell → Authentication: routes to (evidence: `src/App.tsx`)
- Routes and Shell → User Profile: routes to (evidence: `src/App.tsx`)
- Routes and Shell → AI Chat: routes to (evidence: `src/App.tsx`)
- Routes and Shell → Mental Health Card: routes to (evidence: `src/App.tsx`)
- Routes and Shell → Mood Analysis: routes to (evidence: `src/App.tsx`)
- Routes and Shell → Architecture Explorer: routes to (evidence: `src/App.tsx`)
- Monitoring Dashboard → Emotion Stream Simulator: reads stream (evidence: `src/pages/Index.tsx`)
- Emotion Stream Simulator → Emotion Health Mapping: maps metrics (evidence: `src/hooks/useEmotionSimulator.ts`)
- Monitoring Dashboard → Emotion Health Mapping: gets recommendations (evidence: `src/pages/Index.tsx`)
- Monitoring Dashboard → Camera Analysis: renders (evidence: `src/pages/Index.tsx`)
- Camera Analysis → Face Analysis Function: may invoke
- Monitoring Dashboard → Emotion Panels: renders (evidence: `src/pages/Index.tsx`)
- Monitoring Dashboard → Recommendations: renders (evidence: `src/pages/Index.tsx`)
- Monitoring Dashboard → AI Insights Panel: renders (evidence: `src/pages/Index.tsx`)
- Monitoring Dashboard → Wellness Report Export: renders (evidence: `src/pages/Index.tsx`)
- Wellness Report Export → Emotion Health Mapping: uses metrics (evidence: `src/components/ReportExport.tsx`)
- Monitoring Dashboard → Session Persistence: saves session (evidence: `src/pages/Index.tsx`)
- Session Persistence → Supabase: writes history (evidence: `src/hooks/useSessionSaver.ts`)
- Authentication → Supabase: authenticates (evidence: `src/pages/Auth.tsx`)
- User Profile → Supabase: uses client (evidence: `src/pages/Profile.tsx`)
- Mood Analysis → Supabase: uses client (evidence: `src/pages/MoodAnalysis.tsx`)
- Mental Health Card → Emotion Health Mapping: uses mappings (evidence: `src/pages/MentalHealthCard.tsx`)
- AI Chat → Health Chat Function: may invoke
- Monitoring Dashboard → UI Components: uses controls (evidence: `src/pages/Index.tsx`)
