# stellaroneai/easymed-healthcare-platform architecture

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

- Interactive diagram: https://gitdiagram.com/stellaroneai/easymed-healthcare-platform
- Repository: https://github.com/stellaroneai/easymed-healthcare-platform

## Overview

EasyMedPro is a multi-role Indian healthcare platform. Users authenticate by OTP or administrator login, then enter role-specific dashboards; the patient dashboard brings together clinical data, ABHA, family, telemedicine, insurance, monitoring, education, and AI/voice experiences. Vercel API functions provide server-side authentication and healthcare data access, backed by MongoDB. The README documents multilingual support and planned ABDM/ABHA integration. Several dashboard and API implementations are unsampled, so their capabilities are included but uncertain internal links are omitted.

Main entry points: [`src/pages/PatientDashboard.tsx`](https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/pages/PatientDashboard.tsx) (Patient dashboard), [`src/App.tsx`](https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/App.tsx) (App shell), [`api`](https://github.com/stellaroneai/easymed-healthcare-platform/tree/main/api) (Clinical data APIs), [`api/_lib/authz.ts`](https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/api/_lib/authz.ts) (Authorization)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_app["App shell<br/>[App.tsx]"]
  node_login["Login<br/>[LoginPage.tsx]"]
  node_patientdash["Patient dashboard"]
  node_roledash["Role dashboards"]
  node_language["Language context"]
  node_translations["Translations<br/>[translations.ts]"]
end

subgraph group_identity["Identity and ABHA"]
  node_authservice["Auth service<br/>[realAuthService.ts]"]
  node_abhactx["ABHA context<br/>[ABHAContext.tsx]"]
  node_abhaservice["ABHA service<br/>[abhaService.ts]"]
end

subgraph group_clinical["Clinical workflows"]
  node_abha["ABHA integration"]
  node_clinicalfeatures["Patient features"]
  node_family["Family management"]
  node_clinicaldata["Clinical data service"]
  node_telemedicine["Telemedicine"]
  node_insurance["Insurance claims"]
  node_remote["Remote monitoring"]
  node_education["Patient education"]
  node_voice["Voice assistant<br/>[VoiceAssistant.tsx]"]
  node_ai["AI health experiences"]
end

subgraph group_services["Server APIs"]
  node_authapi["Authentication APIs"]
  node_abhaproxy["ABHA proxy<br/>[proxy.ts]"]
  node_clinicalapi["Clinical data APIs"]
  node_aiapi["AI APIs"]
  node_admin["Admin team API<br/>[team.ts]"]
end

subgraph group_platform["Server foundations"]
  node_twilio["Twilio Verify<br/>[twilio.ts]"]
  node_session["Session cookies<br/>[session.ts]"]
  node_mongo[("MongoDB access<br/>[mongo.ts]")]
  node_authz["Authorization<br/>[authz.ts]"]
  node_audit["Audit logging<br/>[audit.ts]"]
  node_response["API responses<br/>[response.ts]"]
end

node_user(("Platform users"))

node_user -->|"opens"| node_app
node_app -->|"renders"| node_login
node_login -->|"authenticates through"| node_authservice
node_authservice -->|"calls"| node_authapi
node_authservice -->|"sends OTP through"| node_twilio
node_authapi -->|"uses"| node_twilio
node_authapi -->|"creates sessions"| node_session
node_app -->|"routes patients to"| node_patientdash
node_app -->|"routes other roles to"| node_roledash
node_app -->|"provides"| node_language
node_language -->|"reads"| node_translations
node_patientdash -->|"renders"| node_clinicalfeatures
node_patientdash -->|"loads clinical data through"| node_clinicaldata
node_patientdash -->|"renders"| node_abha
node_patientdash -->|"renders"| node_family
node_patientdash -->|"renders"| node_telemedicine
node_patientdash -->|"renders"| node_insurance
node_patientdash -->|"renders"| node_remote
node_patientdash -->|"renders"| node_education
node_patientdash -->|"renders"| node_voice
node_patientdash -->|"renders"| node_ai
node_abha -->|"uses"| node_abhaservice
node_abhactx -->|"uses"| node_abhaservice
node_abhaservice -->|"requests through"| node_abhaproxy
node_ai -.->|"server-side AI capability"| node_aiapi
node_clinicaldata -.->|"API linkage"| node_clinicalapi
node_clinicalapi -->|"reads and writes"| node_mongo
node_clinicalapi -->|"checks access with"| node_authz
node_clinicalapi -->|"records access with"| node_audit
node_authz -->|"verifies"| node_session
node_authz -->|"returns errors with"| node_response
node_audit -->|"writes logs to"| node_mongo
node_admin -->|"checks access with"| node_authz
node_admin -->|"reads and writes"| node_mongo
node_admin -->|"records actions with"| node_audit

click node_app "https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/App.tsx"
click node_login "https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/components/LoginPage.tsx"
click node_patientdash "https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/pages/PatientDashboard.tsx"
click node_roledash "https://github.com/stellaroneai/easymed-healthcare-platform/tree/main/src/components/dashboards"
click node_language "https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/contexts/LanguageContext.tsx"
click node_translations "https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/translations.ts"
click node_authservice "https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/services/realAuthService.ts"
click node_authapi "https://github.com/stellaroneai/easymed-healthcare-platform/tree/main/api/auth"
click node_twilio "https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/api/_lib/twilio.ts"
click node_session "https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/api/_lib/session.ts"
click node_abha "https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/components/ABHAIntegration.tsx"
click node_abhactx "https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/contexts/ABHAContext.tsx"
click node_abhaservice "https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/services/abhaService.ts"
click node_abhaproxy "https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/api/abha/proxy.ts"
click node_clinicalfeatures "https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/pages/PatientDashboard.tsx"
click node_family "https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/components/FamilyManagement.tsx"
click node_clinicaldata "https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/services/clinicalDataService.ts"
click node_clinicalapi "https://github.com/stellaroneai/easymed-healthcare-platform/tree/main/api"
click node_telemedicine "https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/components/TelemedicineConsultation.tsx"
click node_insurance "https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/components/InsuranceClaims.tsx"
click node_remote "https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/components/RemotePatientMonitoring.tsx"
click node_education "https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/components/PatientEducationLibrary.tsx"
click node_voice "https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/components/VoiceAssistant.tsx"
click node_ai "https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/components/AIChatAssistant.tsx"
click node_aiapi "https://github.com/stellaroneai/easymed-healthcare-platform/tree/main/api/ai"
click node_mongo "https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/api/_lib/mongo.ts"
click node_authz "https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/api/_lib/authz.ts"
click node_audit "https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/api/_lib/audit.ts"
click node_response "https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/api/_lib/response.ts"
click node_admin "https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/api/admin/team.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_login,node_patientdash,node_roledash,node_language,node_translations,node_user toneBlue
class node_authservice,node_abhactx,node_abhaservice toneAmber
class node_abha,node_clinicalfeatures,node_family,node_clinicaldata,node_telemedicine,node_insurance,node_remote,node_education,node_voice,node_ai toneMint
class node_authapi,node_abhaproxy,node_clinicalapi,node_aiapi,node_admin toneRose
class node_twilio,node_session,node_mongo,node_authz,node_audit,node_response toneIndigo
```

## Components

### User experience

- [App shell](https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/App.tsx): `src/App.tsx`
- [Login](https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/components/LoginPage.tsx): `src/components/LoginPage.tsx`
- [Patient dashboard](https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/pages/PatientDashboard.tsx): `src/pages/PatientDashboard.tsx`
- [Role dashboards](https://github.com/stellaroneai/easymed-healthcare-platform/tree/main/src/components/dashboards): `src/components/dashboards`
- [Language context](https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/contexts/LanguageContext.tsx): `src/contexts/LanguageContext.tsx`
- [Translations](https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/translations.ts): `src/translations.ts`

### Identity and ABHA

- [Auth service](https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/services/realAuthService.ts): `src/services/realAuthService.ts`
- [ABHA context](https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/contexts/ABHAContext.tsx): `src/contexts/ABHAContext.tsx`
- [ABHA service](https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/services/abhaService.ts): `src/services/abhaService.ts`

### Clinical workflows

- [ABHA integration](https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/components/ABHAIntegration.tsx): `src/components/ABHAIntegration.tsx`
- [Patient features](https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/pages/PatientDashboard.tsx): `src/pages/PatientDashboard.tsx`
- [Family management](https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/components/FamilyManagement.tsx): `src/components/FamilyManagement.tsx`
- [Clinical data service](https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/services/clinicalDataService.ts): `src/services/clinicalDataService.ts`
- [Telemedicine](https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/components/TelemedicineConsultation.tsx): `src/components/TelemedicineConsultation.tsx`
- [Insurance claims](https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/components/InsuranceClaims.tsx): `src/components/InsuranceClaims.tsx`
- [Remote monitoring](https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/components/RemotePatientMonitoring.tsx): `src/components/RemotePatientMonitoring.tsx`
- [Patient education](https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/components/PatientEducationLibrary.tsx): `src/components/PatientEducationLibrary.tsx`
- [Voice assistant](https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/components/VoiceAssistant.tsx): `src/components/VoiceAssistant.tsx`
- [AI health experiences](https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/src/components/AIChatAssistant.tsx): `src/components/AIChatAssistant.tsx`

### Server APIs

- [Authentication APIs](https://github.com/stellaroneai/easymed-healthcare-platform/tree/main/api/auth): `api/auth`
- [ABHA proxy](https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/api/abha/proxy.ts): `api/abha/proxy.ts`
- [Clinical data APIs](https://github.com/stellaroneai/easymed-healthcare-platform/tree/main/api): `api`
- [AI APIs](https://github.com/stellaroneai/easymed-healthcare-platform/tree/main/api/ai): `api/ai`
- [Admin team API](https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/api/admin/team.ts): `api/admin/team.ts`

### Server foundations

- [Twilio Verify](https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/api/_lib/twilio.ts): `api/_lib/twilio.ts`
- [Session cookies](https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/api/_lib/session.ts): `api/_lib/session.ts`
- [MongoDB access](https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/api/_lib/mongo.ts): `api/_lib/mongo.ts`
- [Authorization](https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/api/_lib/authz.ts): `api/_lib/authz.ts`
- [Audit logging](https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/api/_lib/audit.ts): `api/_lib/audit.ts`
- [API responses](https://github.com/stellaroneai/easymed-healthcare-platform/blob/main/api/_lib/response.ts): `api/_lib/response.ts`

### Other components

- **Platform users**

## Connections

- Platform users → App shell: opens (evidence: `src/App.tsx`)
- App shell → Login: renders (evidence: `src/App.tsx`)
- Login → Auth service: authenticates through (evidence: `src/components/LoginPage.tsx`)
- Auth service → Authentication APIs: calls (evidence: `src/services/realAuthService.ts`)
- Auth service → Twilio Verify: sends OTP through (evidence: `src/services/realAuthService.ts`)
- Authentication APIs → Twilio Verify: uses (evidence: `api/auth/verify-otp.ts`)
- Authentication APIs → Session cookies: creates sessions (evidence: `api/auth/verify-otp.ts`)
- App shell → Patient dashboard: routes patients to (evidence: `src/App.tsx`)
- App shell → Role dashboards: routes other roles to (evidence: `src/App.tsx`)
- App shell → Language context: provides (evidence: `src/App.tsx`)
- Language context → Translations: reads (evidence: `src/contexts/LanguageContext.tsx`)
- Patient dashboard → Patient features: renders (evidence: `src/pages/PatientDashboard.tsx`)
- Patient dashboard → Clinical data service: loads clinical data through (evidence: `src/pages/PatientDashboard.tsx`)
- Patient dashboard → ABHA integration: renders (evidence: `src/pages/PatientDashboard.tsx`)
- Patient dashboard → Family management: renders (evidence: `src/pages/PatientDashboard.tsx`)
- Patient dashboard → Telemedicine: renders (evidence: `src/pages/PatientDashboard.tsx`)
- Patient dashboard → Insurance claims: renders (evidence: `src/pages/PatientDashboard.tsx`)
- Patient dashboard → Remote monitoring: renders (evidence: `src/pages/PatientDashboard.tsx`)
- Patient dashboard → Patient education: renders (evidence: `src/pages/PatientDashboard.tsx`)
- Patient dashboard → Voice assistant: renders (evidence: `src/pages/PatientDashboard.tsx`)
- Patient dashboard → AI health experiences: renders (evidence: `src/pages/PatientDashboard.tsx`)
- ABHA integration → ABHA service: uses (evidence: `src/components/ABHAIntegration.tsx`)
- ABHA context → ABHA service: uses (evidence: `src/contexts/ABHAContext.tsx`)
- ABHA service → ABHA proxy: requests through (evidence: `src/services/abhaService.ts`)
- AI health experiences → AI APIs: server-side AI capability (evidence: `README.md`)
- Clinical data service → Clinical data APIs: API linkage
- Clinical data APIs → MongoDB access: reads and writes (evidence: `api/appointments/me.ts`)
- Clinical data APIs → Authorization: checks access with (evidence: `api/appointments/me.ts`)
- Clinical data APIs → Audit logging: records access with (evidence: `api/appointments/me.ts`)
- Authorization → Session cookies: verifies (evidence: `api/_lib/authz.ts`)
- Authorization → API responses: returns errors with (evidence: `api/_lib/authz.ts`)
- Audit logging → MongoDB access: writes logs to (evidence: `api/_lib/audit.ts`)
- Admin team API → Authorization: checks access with (evidence: `api/admin/team.ts`)
- Admin team API → MongoDB access: reads and writes (evidence: `api/admin/team.ts`)
- Admin team API → Audit logging: records actions with (evidence: `api/admin/team.ts`)
