# mouryakotha/nexus__care architecture

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

- Interactive diagram: https://gitdiagram.com/mouryakotha/nexus__care
- Repository: https://github.com/mouryakotha/nexus__care

## Overview

Nexus Care is a patient-facing healthcare platform backed by an Express/MongoDB API. The documented user journey includes AI health guidance, specialist consultations and appointments, medical-text simplification, and reminders; the repository also includes family-care insights, community moderation, and related health features. The graph shows verified API dispatch and sampled backend calls. Several frontend and backend routes are present in the tree but were not sampled, so their internal wiring is not asserted.

Main entry points: [`backend/controllers/voiceController.js`](https://github.com/mouryakotha/nexus__care/blob/main/backend/controllers/voiceController.js) (Voice assistant), [`backend/routes/familyRoutes.js`](https://github.com/mouryakotha/nexus__care/blob/main/backend/routes/familyRoutes.js) (Family care API), [`backend/routes/appointmentRoutes.js`](https://github.com/mouryakotha/nexus__care/blob/main/backend/routes/appointmentRoutes.js) (Appointment API), [`backend/models/HealthTimeline.js`](https://github.com/mouryakotha/nexus__care/blob/main/backend/models/HealthTimeline.js) (Health timeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Patient experience"]
  node_symptoms["Symptom checker<br/>[aisymtom.js]"]
  node_consultations["Telemedicine"]
  node_appointments_ui["Appointments<br/>[appointment.js]"]
  node_translation["MediTranslate<br/>[meditranslate.js]"]
  node_mentor_ui["AI Mentor<br/>[ai-mentor.js]"]
  node_emergency["Emergency dialer<br/>[emergency.js]"]
  node_reminders_ui["Reminders<br/>[reminder.js]"]
end

subgraph group_api["API and care workflows"]
  node_server["Express server<br/>[server.js]"]
  node_appointment_api["Appointment API"]
  node_review_api["Review API<br/>[reviewRoutes.js]"]
  node_review_handler["Review handler"]
  node_family_api["Family care API<br/>[familyRoutes.js]"]
  node_auth["Authentication<br/>[authMiddleware.js]"]
  node_notification_service["Notifications"]
end

subgraph group_ai["AI and analytics"]
  node_ai_controller["AI controller<br/>[aiController.js]"]
  node_voice["Voice assistant<br/>[voiceController.js]"]
  node_gemini["Gemini service<br/>[geminiService.js]"]
  node_risk["Risk analysis<br/>[riskEngine.js]"]
  node_insights["Care insights<br/>[insightEngine.js]"]
end

subgraph group_data["Healthcare data"]
  node_user_model[("User records<br/>[User.js]")]
  node_appointment_model[("Appointment records<br/>[Appointment.js]")]
  node_timeline[("Health timeline<br/>[HealthTimeline.js]")]
  node_conversation[("AI conversations<br/>[Conversation.js]")]
  node_cognitive[("Cognitive logs<br/>[CognitiveLog.js]")]
  node_discussion[("Community discussions<br/>[Discussion.js]")]
  node_review_model[("Review records<br/>[Review.js]")]
  node_family_member[("Family members<br/>[FamilyMember.js]")]
end

node_patient(("Patient"))

node_patient -->|"checks symptoms"| node_symptoms
node_patient -->|"books consultations"| node_consultations
node_patient -->|"manages appointments"| node_appointments_ui
node_patient -->|"simplifies text"| node_translation
node_patient -->|"gets guidance"| node_mentor_ui
node_patient -->|"calls emergency"| node_emergency
node_patient -->|"tracks tasks"| node_reminders_ui
node_server -->|"routes requests"| node_appointment_api
node_server -->|"routes requests"| node_review_api
node_server -.->|"routes requests"| node_family_api
node_appointment_api -->|"checks access"| node_auth
node_appointment_api -->|"stores bookings"| node_appointment_model
node_appointment_api -->|"sends confirmation"| node_notification_service
node_review_api -->|"dispatches requests"| node_review_handler
node_review_handler -->|"reads and writes"| node_review_model
node_auth -->|"loads user"| node_user_model
node_family_api -->|"calculates risk"| node_risk
node_family_api -->|"generates insights"| node_insights
node_family_api -->|"queries timeline"| node_timeline
node_family_api -->|"queries members"| node_family_member
node_risk -->|"reads events"| node_timeline
node_insights -->|"reads history"| node_timeline
node_ai_controller -->|"requests generation"| node_gemini
node_ai_controller -->|"uses conversations"| node_conversation
node_ai_controller -->|"uses cognitive logs"| node_cognitive
node_voice -->|"routes intent"| node_gemini
node_voice -->|"books appointments"| node_appointment_model
node_voice -->|"deletes history"| node_conversation
node_voice -->|"saves speech metrics"| node_timeline
node_voice -->|"looks up appointments"| node_appointment_model
node_voice -.->|"moderates posts"| node_discussion
node_gemini -->|"moderates posts"| node_discussion

click node_symptoms "https://github.com/mouryakotha/nexus__care/blob/main/src/js/aisymtom.js"
click node_consultations "https://github.com/mouryakotha/nexus__care/blob/main/src/js/onlinetelemedince.js"
click node_appointments_ui "https://github.com/mouryakotha/nexus__care/blob/main/src/js/appointment.js"
click node_translation "https://github.com/mouryakotha/nexus__care/blob/main/src/js/meditranslate.js"
click node_mentor_ui "https://github.com/mouryakotha/nexus__care/blob/main/src/js/ai-mentor.js"
click node_emergency "https://github.com/mouryakotha/nexus__care/blob/main/src/js/emergency.js"
click node_reminders_ui "https://github.com/mouryakotha/nexus__care/blob/main/src/js/reminder.js"
click node_server "https://github.com/mouryakotha/nexus__care/blob/main/backend/server.js"
click node_appointment_api "https://github.com/mouryakotha/nexus__care/blob/main/backend/routes/appointmentRoutes.js"
click node_review_api "https://github.com/mouryakotha/nexus__care/blob/main/backend/routes/reviewRoutes.js"
click node_review_handler "https://github.com/mouryakotha/nexus__care/blob/main/backend/controllers/reviewController.js"
click node_family_api "https://github.com/mouryakotha/nexus__care/blob/main/backend/routes/familyRoutes.js"
click node_auth "https://github.com/mouryakotha/nexus__care/blob/main/backend/middleware/authMiddleware.js"
click node_ai_controller "https://github.com/mouryakotha/nexus__care/blob/main/backend/controllers/aiController.js"
click node_voice "https://github.com/mouryakotha/nexus__care/blob/main/backend/controllers/voiceController.js"
click node_gemini "https://github.com/mouryakotha/nexus__care/blob/main/backend/ai/gemini/geminiService.js"
click node_risk "https://github.com/mouryakotha/nexus__care/blob/main/backend/services/riskEngine.js"
click node_insights "https://github.com/mouryakotha/nexus__care/blob/main/backend/services/insightEngine.js"
click node_notification_service "https://github.com/mouryakotha/nexus__care/blob/main/backend/services/notificationService.js"
click node_user_model "https://github.com/mouryakotha/nexus__care/blob/main/backend/models/User.js"
click node_appointment_model "https://github.com/mouryakotha/nexus__care/blob/main/backend/models/Appointment.js"
click node_timeline "https://github.com/mouryakotha/nexus__care/blob/main/backend/models/HealthTimeline.js"
click node_conversation "https://github.com/mouryakotha/nexus__care/blob/main/backend/models/Conversation.js"
click node_cognitive "https://github.com/mouryakotha/nexus__care/blob/main/backend/models/CognitiveLog.js"
click node_discussion "https://github.com/mouryakotha/nexus__care/blob/main/backend/models/Discussion.js"
click node_review_model "https://github.com/mouryakotha/nexus__care/blob/main/backend/models/Review.js"
click node_family_member "https://github.com/mouryakotha/nexus__care/blob/main/backend/models/FamilyMember.js"

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_symptoms,node_consultations,node_appointments_ui,node_translation,node_mentor_ui,node_emergency,node_reminders_ui toneBlue
class node_server,node_appointment_api,node_review_api,node_review_handler,node_family_api,node_auth,node_notification_service toneAmber
class node_ai_controller,node_voice,node_gemini,node_risk,node_insights toneMint
class node_user_model,node_appointment_model,node_timeline,node_conversation,node_cognitive,node_discussion,node_review_model,node_family_member toneRose
class node_patient toneIndigo
```

## Components

### Patient experience

- [Symptom checker](https://github.com/mouryakotha/nexus__care/blob/main/src/js/aisymtom.js): `src/js/aisymtom.js`
- [Telemedicine](https://github.com/mouryakotha/nexus__care/blob/main/src/js/onlinetelemedince.js): `src/js/onlinetelemedince.js`
- [Appointments](https://github.com/mouryakotha/nexus__care/blob/main/src/js/appointment.js): `src/js/appointment.js`
- [MediTranslate](https://github.com/mouryakotha/nexus__care/blob/main/src/js/meditranslate.js): `src/js/meditranslate.js`
- [AI Mentor](https://github.com/mouryakotha/nexus__care/blob/main/src/js/ai-mentor.js): `src/js/ai-mentor.js`
- [Emergency dialer](https://github.com/mouryakotha/nexus__care/blob/main/src/js/emergency.js): `src/js/emergency.js`
- [Reminders](https://github.com/mouryakotha/nexus__care/blob/main/src/js/reminder.js): `src/js/reminder.js`

### API and care workflows

- [Express server](https://github.com/mouryakotha/nexus__care/blob/main/backend/server.js): `backend/server.js`
- [Appointment API](https://github.com/mouryakotha/nexus__care/blob/main/backend/routes/appointmentRoutes.js): `backend/routes/appointmentRoutes.js`
- [Review API](https://github.com/mouryakotha/nexus__care/blob/main/backend/routes/reviewRoutes.js): `backend/routes/reviewRoutes.js`
- [Review handler](https://github.com/mouryakotha/nexus__care/blob/main/backend/controllers/reviewController.js): `backend/controllers/reviewController.js`
- [Family care API](https://github.com/mouryakotha/nexus__care/blob/main/backend/routes/familyRoutes.js): `backend/routes/familyRoutes.js`
- [Authentication](https://github.com/mouryakotha/nexus__care/blob/main/backend/middleware/authMiddleware.js): `backend/middleware/authMiddleware.js`
- [Notifications](https://github.com/mouryakotha/nexus__care/blob/main/backend/services/notificationService.js): `backend/services/notificationService.js`

### AI and analytics

- [AI controller](https://github.com/mouryakotha/nexus__care/blob/main/backend/controllers/aiController.js): `backend/controllers/aiController.js`
- [Voice assistant](https://github.com/mouryakotha/nexus__care/blob/main/backend/controllers/voiceController.js): `backend/controllers/voiceController.js`
- [Gemini service](https://github.com/mouryakotha/nexus__care/blob/main/backend/ai/gemini/geminiService.js): `backend/ai/gemini/geminiService.js`
- [Risk analysis](https://github.com/mouryakotha/nexus__care/blob/main/backend/services/riskEngine.js): `backend/services/riskEngine.js`
- [Care insights](https://github.com/mouryakotha/nexus__care/blob/main/backend/services/insightEngine.js): `backend/services/insightEngine.js`

### Healthcare data

- [User records](https://github.com/mouryakotha/nexus__care/blob/main/backend/models/User.js): `backend/models/User.js`
- [Appointment records](https://github.com/mouryakotha/nexus__care/blob/main/backend/models/Appointment.js): `backend/models/Appointment.js`
- [Health timeline](https://github.com/mouryakotha/nexus__care/blob/main/backend/models/HealthTimeline.js): `backend/models/HealthTimeline.js`
- [AI conversations](https://github.com/mouryakotha/nexus__care/blob/main/backend/models/Conversation.js): `backend/models/Conversation.js`
- [Cognitive logs](https://github.com/mouryakotha/nexus__care/blob/main/backend/models/CognitiveLog.js): `backend/models/CognitiveLog.js`
- [Community discussions](https://github.com/mouryakotha/nexus__care/blob/main/backend/models/Discussion.js): `backend/models/Discussion.js`
- [Review records](https://github.com/mouryakotha/nexus__care/blob/main/backend/models/Review.js): `backend/models/Review.js`
- [Family members](https://github.com/mouryakotha/nexus__care/blob/main/backend/models/FamilyMember.js): `backend/models/FamilyMember.js`

### Other components

- **Patient**

## Connections

- Patient → Symptom checker: checks symptoms (evidence: `README.md`)
- Patient → Telemedicine: books consultations (evidence: `README.md`)
- Patient → Appointments: manages appointments (evidence: `README.md`)
- Patient → MediTranslate: simplifies text (evidence: `README.md`)
- Patient → AI Mentor: gets guidance (evidence: `README.md`)
- Patient → Emergency dialer: calls emergency (evidence: `README.md`)
- Patient → Reminders: tracks tasks (evidence: `README.md`)
- Express server → Appointment API: routes requests (evidence: `backend/server.js`)
- Express server → Review API: routes requests (evidence: `backend/server.js`)
- Express server → Family care API: routes requests
- Appointment API → Authentication: checks access (evidence: `backend/routes/appointmentRoutes.js`)
- Appointment API → Appointment records: stores bookings (evidence: `backend/routes/appointmentRoutes.js`)
- Appointment API → Notifications: sends confirmation (evidence: `backend/routes/appointmentRoutes.js`)
- Review API → Review handler: dispatches requests (evidence: `backend/routes/reviewRoutes.js`)
- Review handler → Review records: reads and writes (evidence: `backend/controllers/reviewController.js`)
- Authentication → User records: loads user (evidence: `backend/middleware/authMiddleware.js`)
- Family care API → Risk analysis: calculates risk (evidence: `backend/routes/familyRoutes.js`)
- Family care API → Care insights: generates insights (evidence: `backend/routes/familyRoutes.js`)
- Family care API → Health timeline: queries timeline (evidence: `backend/routes/familyRoutes.js`)
- Family care API → Family members: queries members (evidence: `backend/routes/familyRoutes.js`)
- Risk analysis → Health timeline: reads events (evidence: `backend/services/riskEngine.js`)
- Care insights → Health timeline: reads history (evidence: `backend/services/insightEngine.js`)
- AI controller → Gemini service: requests generation (evidence: `backend/controllers/aiController.js`)
- AI controller → AI conversations: uses conversations (evidence: `backend/controllers/aiController.js`)
- AI controller → Cognitive logs: uses cognitive logs (evidence: `backend/controllers/aiController.js`)
- Voice assistant → Gemini service: routes intent (evidence: `backend/controllers/voiceController.js`)
- Voice assistant → Appointment records: books appointments (evidence: `backend/controllers/voiceController.js`)
- Voice assistant → AI conversations: deletes history (evidence: `backend/controllers/voiceController.js`)
- Voice assistant → Health timeline: saves speech metrics (evidence: `backend/controllers/voiceController.js`)
- Voice assistant → Appointment records: looks up appointments (evidence: `backend/controllers/voiceController.js`)
- Voice assistant → Community discussions: moderates posts
- Gemini service → Community discussions: moderates posts (evidence: `backend/routes/communityRoutes.js`)
