# shanmukhamanikantainti-web/medicrewv1 architecture

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

- Interactive diagram: https://gitdiagram.com/shanmukhamanikantainti-web/medicrewv1
- Repository: https://github.com/shanmukhamanikantainti-web/medicrewv1

## Overview

MediCrew is a role-based healthcare web application for patients, doctors, and administrators. Users enter through landing and authentication, then the application routes them to role-specific dashboards and workflows: patient health monitoring, AI health assistance, device telemetry, and appointments; doctor clinical oversight; and administrative governance and verification. Authentication and page features use Supabase, while the AI assistant delegates analysis to Gemini. The tree also includes a separate bridge server, but its relationship to the device workflow is not established by the available excerpts.

Main entry points: [`src/App.jsx`](https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/App.jsx) (Route and guard), [`src/lib/supabaseClient.js`](https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/lib/supabaseClient.js) (Supabase client), [`src/context/AuthContext.jsx`](https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/context/AuthContext.jsx) (Auth and profiles), [`src/components/Sidebar.jsx`](https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/components/Sidebar.jsx) (Role navigation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App entry and access"]
  node_app["Route and guard<br/>[App.jsx]"]
  node_landing["Landing page<br/>[Landing.jsx]"]
  node_auth["Sign-in and signup<br/>[Auth.jsx]"]
end

subgraph group_patient["Patient care"]
  node_patientdash["Patient dashboard"]
  node_assistant["AI health assistant<br/>[AIAssistant.jsx]"]
  node_devices["Device monitor<br/>[DeviceMonitor.jsx]"]
  node_appointments["Appointments<br/>[Appointments.jsx]"]
end

subgraph group_clinical["Clinical and administration"]
  node_doctor["Doctor dashboard"]
  node_admin["Admin dashboard<br/>[AdminDashboard.jsx]"]
  node_verification["Admin verification<br/>[AdminVerify.jsx]"]
end

subgraph group_services["Shared services"]
  node_authctx["Auth and profiles<br/>[AuthContext.jsx]"]
  node_supabaseclient["Supabase client<br/>[supabaseClient.js]"]
  node_supabase[("Supabase")]
  node_sidebar["Role navigation<br/>[Sidebar.jsx]"]
  node_shortcut["Admin shortcut<br/>[AdminShortcut.jsx]"]
  node_gemini["Gemini analysis<br/>[gemini.js]"]
  node_bridge["Device bridge server<br/>[server.js]"]
end

node_user(("User"))

node_user -->|"opens"| node_app
node_app -->|"routes to"| node_landing
node_app -->|"routes to"| node_auth
node_app -->|"routes to"| node_patientdash
node_app -->|"routes to"| node_assistant
node_app -->|"routes to"| node_devices
node_app -->|"routes to"| node_appointments
node_app -->|"routes to"| node_doctor
node_app -->|"routes to"| node_admin
node_app -->|"routes to"| node_verification
node_app -->|"checks access"| node_authctx
node_app -->|"renders"| node_shortcut
node_auth -->|"uses auth"| node_authctx
node_authctx -->|"queries"| node_supabaseclient
node_supabaseclient -->|"connects"| node_supabase
node_patientdash -->|"reads user"| node_authctx
node_patientdash -->|"renders"| node_sidebar
node_assistant -->|"requests analysis"| node_gemini
node_assistant -->|"stores results"| node_supabaseclient
node_assistant -->|"renders"| node_sidebar
node_devices -->|"uses data service"| node_supabaseclient
node_devices -->|"renders"| node_sidebar
node_appointments -->|"uses data service"| node_supabaseclient
node_appointments -->|"renders"| node_sidebar
node_doctor -->|"uses data service"| node_supabaseclient
node_doctor -->|"renders"| node_sidebar
node_admin -->|"uses data service"| node_supabaseclient
node_admin -->|"renders"| node_sidebar
node_verification -->|"checks verification"| node_authctx
node_shortcut -->|"checks role"| node_authctx
node_bridge -.-> node_devices

click node_app "https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/App.jsx"
click node_landing "https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/pages/Landing.jsx"
click node_auth "https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/pages/Auth.jsx"
click node_authctx "https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/context/AuthContext.jsx"
click node_supabaseclient "https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/lib/supabaseClient.js"
click node_sidebar "https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/components/Sidebar.jsx"
click node_shortcut "https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/components/AdminShortcut.jsx"
click node_patientdash "https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/pages/PatientDashboard.jsx"
click node_assistant "https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/pages/AIAssistant.jsx"
click node_gemini "https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/lib/gemini.js"
click node_devices "https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/pages/DeviceMonitor.jsx"
click node_appointments "https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/pages/Appointments.jsx"
click node_doctor "https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/pages/DoctorDashboard.jsx"
click node_admin "https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/pages/AdminDashboard.jsx"
click node_verification "https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/pages/AdminVerify.jsx"
click node_bridge "https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/medicrew-bridge/server.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_app,node_landing,node_auth,node_user toneBlue
class node_patientdash,node_assistant,node_devices,node_appointments toneAmber
class node_doctor,node_admin,node_verification toneMint
class node_authctx,node_supabaseclient,node_supabase,node_sidebar,node_shortcut,node_gemini,node_bridge toneRose
```

## Components

### App entry and access

- [Route and guard](https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/App.jsx): `src/App.jsx`
- [Landing page](https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/pages/Landing.jsx): `src/pages/Landing.jsx`
- [Sign-in and signup](https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/pages/Auth.jsx): `src/pages/Auth.jsx`

### Patient care

- [Patient dashboard](https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/pages/PatientDashboard.jsx): `src/pages/PatientDashboard.jsx`
- [AI health assistant](https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/pages/AIAssistant.jsx): `src/pages/AIAssistant.jsx`
- [Device monitor](https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/pages/DeviceMonitor.jsx): `src/pages/DeviceMonitor.jsx`
- [Appointments](https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/pages/Appointments.jsx): `src/pages/Appointments.jsx`

### Clinical and administration

- [Doctor dashboard](https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/pages/DoctorDashboard.jsx): `src/pages/DoctorDashboard.jsx`
- [Admin dashboard](https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/pages/AdminDashboard.jsx): `src/pages/AdminDashboard.jsx`
- [Admin verification](https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/pages/AdminVerify.jsx): `src/pages/AdminVerify.jsx`

### Shared services

- [Auth and profiles](https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Supabase client](https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/lib/supabaseClient.js): `src/lib/supabaseClient.js`
- **Supabase**
- [Role navigation](https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/components/Sidebar.jsx): `src/components/Sidebar.jsx`
- [Admin shortcut](https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/components/AdminShortcut.jsx): `src/components/AdminShortcut.jsx`
- [Gemini analysis](https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/src/lib/gemini.js): `src/lib/gemini.js`
- [Device bridge server](https://github.com/shanmukhamanikantainti-web/medicrewv1/blob/main/medicrew-bridge/server.js): `medicrew-bridge/server.js`

### Other components

- **User**

## Connections

- User → Route and guard: opens
- Route and guard → Landing page: routes to (evidence: `src/App.jsx`)
- Route and guard → Sign-in and signup: routes to (evidence: `src/App.jsx`)
- Route and guard → Patient dashboard: routes to (evidence: `src/App.jsx`)
- Route and guard → AI health assistant: routes to (evidence: `src/App.jsx`)
- Route and guard → Device monitor: routes to (evidence: `src/App.jsx`)
- Route and guard → Appointments: routes to (evidence: `src/App.jsx`)
- Route and guard → Doctor dashboard: routes to (evidence: `src/App.jsx`)
- Route and guard → Admin dashboard: routes to (evidence: `src/App.jsx`)
- Route and guard → Admin verification: routes to (evidence: `src/App.jsx`)
- Route and guard → Auth and profiles: checks access (evidence: `src/App.jsx`)
- Route and guard → Admin shortcut: renders (evidence: `src/App.jsx`)
- Sign-in and signup → Auth and profiles: uses auth (evidence: `src/pages/Auth.jsx`)
- Auth and profiles → Supabase client: queries (evidence: `src/context/AuthContext.jsx`)
- Supabase client → Supabase: connects (evidence: `src/lib/supabaseClient.js`)
- Patient dashboard → Auth and profiles: reads user (evidence: `src/pages/PatientDashboard.jsx`)
- Patient dashboard → Role navigation: renders (evidence: `src/pages/PatientDashboard.jsx`)
- AI health assistant → Gemini analysis: requests analysis (evidence: `src/pages/AIAssistant.jsx`)
- AI health assistant → Supabase client: stores results (evidence: `src/pages/AIAssistant.jsx`)
- AI health assistant → Role navigation: renders (evidence: `src/pages/AIAssistant.jsx`)
- Device monitor → Supabase client: uses data service (evidence: `src/pages/DeviceMonitor.jsx`)
- Device monitor → Role navigation: renders (evidence: `src/pages/DeviceMonitor.jsx`)
- Appointments → Supabase client: uses data service (evidence: `src/pages/Appointments.jsx`)
- Appointments → Role navigation: renders (evidence: `src/pages/Appointments.jsx`)
- Doctor dashboard → Supabase client: uses data service (evidence: `src/pages/DoctorDashboard.jsx`)
- Doctor dashboard → Role navigation: renders (evidence: `src/pages/DoctorDashboard.jsx`)
- Admin dashboard → Supabase client: uses data service (evidence: `src/pages/AdminDashboard.jsx`)
- Admin dashboard → Role navigation: renders (evidence: `src/pages/AdminDashboard.jsx`)
- Admin verification → Auth and profiles: checks verification (evidence: `src/pages/AdminVerify.jsx`)
- Admin shortcut → Auth and profiles: checks role (evidence: `src/components/AdminShortcut.jsx`)
- Device bridge server → Device monitor
