# muhmmmadirtizakhan/medixweb architecture

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

- Interactive diagram: https://gitdiagram.com/muhmmmadirtizakhan/medixweb
- Repository: https://github.com/muhmmmadirtizakhan/medixweb

## Overview

MedixWeb is a hospital-assistant and appointment-management web app. A patient uses the React chat experience to describe symptoms, receive a doctor recommendation, and book, update, or cancel an appointment; the README also describes a schedule-aware calendar and persistent chat history. The backend chatbot route owns the AI and appointment API logic, with Supabase persistence and separate notification routes. Edges for unsampled frontend and appointment details rely on README documentation; those implementation details were not inspected.

Main entry points: [`backend/routes/chatbot.js`](https://github.com/muhmmmadirtizakhan/medixweb/blob/main/backend/routes/chatbot.js) (Chat and appointment API), [`frontrend/src/App.jsx`](https://github.com/muhmmmadirtizakhan/medixweb/blob/main/frontrend/src/App.jsx) (React app), [`backend/server.js`](https://github.com/muhmmmadirtizakhan/medixweb/blob/main/backend/server.js) (Express API server), [`frontrend/src/assets/components/chatbot/ChatWindow.jsx`](https://github.com/muhmmmadirtizakhan/medixweb/blob/main/frontrend/src/assets/components/chatbot/ChatWindow.jsx) (Chat interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_patient_ui["Patient experience"]
  node_app["React app<br/>[App.jsx]"]
  node_chat_context["Chat state<br/>[ChatContext.jsx]"]
  node_chat_window["Chat interface<br/>[ChatWindow.jsx]"]
  node_doctor_catalog["Doctor directory<br/>[doctorsData.js]"]
  node_appointment_calendar["Appointment calendar"]
end

subgraph group_care_flow["Assistant and appointments"]
  node_chat_api["Chat and appointment API<br/>[chatbot.js]"]
  node_intent_detection["Intent detection<br/>[chatbot.js]"]
  node_symptom_recommendation["Symptom recommendations<br/>[doctors-data.js]"]
  node_appointment_workflow["Appointment operations<br/>[chatbot.js]"]
  node_groq["Groq language model"]
end

subgraph group_platform["Backend and persistence"]
  node_backend_server["Express API server<br/>[server.js]"]
  node_supabase_client["Supabase client<br/>[supabase.js]"]
  node_supabase_store[("Supabase data store")]
  node_clerk["Clerk identity service"]
  node_user_sync["User synchronization<br/>[users.js]"]
end

subgraph group_communications["Notifications"]
  node_whatsapp_api["WhatsApp messaging<br/>[whatsapp.js]"]
  node_whapi["Whapi service"]
  node_email_api["Email notifications<br/>[email.js]"]
  node_brevo["Brevo email service"]
end

node_patient(("Patient"))

node_patient -->|"uses"| node_app
node_app -->|"renders"| node_chat_window
node_app -->|"uses state"| node_chat_context
node_app -.->|"shows doctors"| node_doctor_catalog
node_chat_window -.->|"sends chat"| node_chat_api
node_chat_window -.->|"supports booking"| node_appointment_calendar
node_backend_server -->|"mounts route"| node_chat_api
node_backend_server -->|"mounts route"| node_user_sync
node_backend_server -->|"mounts route"| node_whatsapp_api
node_backend_server -->|"mounts route"| node_email_api
node_app -->|"syncs signed-in user"| node_user_sync
node_user_sync -->|"queries users"| node_supabase_client
node_chat_api -->|"reads and writes"| node_supabase_client
node_supabase_client -.->|"accesses"| node_supabase_store
node_chat_api -->|"classifies intent"| node_intent_detection
node_chat_api -->|"requests completions"| node_groq
node_chat_api -->|"uses doctor data"| node_symptom_recommendation
node_chat_api -->|"handles appointment actions"| node_appointment_workflow
node_whatsapp_api -->|"sends messages"| node_whapi
node_email_api -->|"sends email"| node_brevo
node_clerk -.->|"provides identity"| node_app

click node_app "https://github.com/muhmmmadirtizakhan/medixweb/blob/main/frontrend/src/App.jsx"
click node_chat_context "https://github.com/muhmmmadirtizakhan/medixweb/blob/main/frontrend/src/context/ChatContext.jsx"
click node_chat_window "https://github.com/muhmmmadirtizakhan/medixweb/blob/main/frontrend/src/assets/components/chatbot/ChatWindow.jsx"
click node_doctor_catalog "https://github.com/muhmmmadirtizakhan/medixweb/blob/main/frontrend/src/data/doctorsData.js"
click node_appointment_calendar "https://github.com/muhmmmadirtizakhan/medixweb/tree/main/frontrend/src/assets/components"
click node_chat_api "https://github.com/muhmmmadirtizakhan/medixweb/blob/main/backend/routes/chatbot.js"
click node_intent_detection "https://github.com/muhmmmadirtizakhan/medixweb/blob/main/backend/routes/chatbot.js"
click node_symptom_recommendation "https://github.com/muhmmmadirtizakhan/medixweb/blob/main/backend/knowledge-base/doctors-data.js"
click node_appointment_workflow "https://github.com/muhmmmadirtizakhan/medixweb/blob/main/backend/routes/chatbot.js"
click node_backend_server "https://github.com/muhmmmadirtizakhan/medixweb/blob/main/backend/server.js"
click node_supabase_client "https://github.com/muhmmmadirtizakhan/medixweb/blob/main/backend/config/supabase.js"
click node_user_sync "https://github.com/muhmmmadirtizakhan/medixweb/blob/main/backend/routes/users.js"
click node_whatsapp_api "https://github.com/muhmmmadirtizakhan/medixweb/blob/main/backend/routes/whatsapp.js"
click node_email_api "https://github.com/muhmmmadirtizakhan/medixweb/blob/main/backend/routes/email.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_chat_context,node_chat_window,node_doctor_catalog,node_appointment_calendar toneBlue
class node_chat_api,node_intent_detection,node_symptom_recommendation,node_appointment_workflow,node_groq toneAmber
class node_backend_server,node_supabase_client,node_supabase_store,node_clerk,node_user_sync toneMint
class node_whatsapp_api,node_whapi,node_email_api,node_brevo toneRose
class node_patient toneIndigo
```

## Components

### Patient experience

- [React app](https://github.com/muhmmmadirtizakhan/medixweb/blob/main/frontrend/src/App.jsx): `frontrend/src/App.jsx`
- [Chat state](https://github.com/muhmmmadirtizakhan/medixweb/blob/main/frontrend/src/context/ChatContext.jsx): `frontrend/src/context/ChatContext.jsx`
- [Chat interface](https://github.com/muhmmmadirtizakhan/medixweb/blob/main/frontrend/src/assets/components/chatbot/ChatWindow.jsx): `frontrend/src/assets/components/chatbot/ChatWindow.jsx`
- [Doctor directory](https://github.com/muhmmmadirtizakhan/medixweb/blob/main/frontrend/src/data/doctorsData.js): `frontrend/src/data/doctorsData.js`
- [Appointment calendar](https://github.com/muhmmmadirtizakhan/medixweb/tree/main/frontrend/src/assets/components): `frontrend/src/assets/components`

### Assistant and appointments

- [Chat and appointment API](https://github.com/muhmmmadirtizakhan/medixweb/blob/main/backend/routes/chatbot.js): `backend/routes/chatbot.js`
- [Intent detection](https://github.com/muhmmmadirtizakhan/medixweb/blob/main/backend/routes/chatbot.js): `backend/routes/chatbot.js`
- [Symptom recommendations](https://github.com/muhmmmadirtizakhan/medixweb/blob/main/backend/knowledge-base/doctors-data.js): `backend/knowledge-base/doctors-data.js`
- [Appointment operations](https://github.com/muhmmmadirtizakhan/medixweb/blob/main/backend/routes/chatbot.js): `backend/routes/chatbot.js`
- **Groq language model**

### Backend and persistence

- [Express API server](https://github.com/muhmmmadirtizakhan/medixweb/blob/main/backend/server.js): `backend/server.js`
- [Supabase client](https://github.com/muhmmmadirtizakhan/medixweb/blob/main/backend/config/supabase.js): `backend/config/supabase.js`
- **Supabase data store**
- **Clerk identity service**
- [User synchronization](https://github.com/muhmmmadirtizakhan/medixweb/blob/main/backend/routes/users.js): `backend/routes/users.js`

### Notifications

- [WhatsApp messaging](https://github.com/muhmmmadirtizakhan/medixweb/blob/main/backend/routes/whatsapp.js): `backend/routes/whatsapp.js`
- **Whapi service**
- [Email notifications](https://github.com/muhmmmadirtizakhan/medixweb/blob/main/backend/routes/email.js): `backend/routes/email.js`
- **Brevo email service**

### Other components

- **Patient**

## Connections

- Patient → React app: uses (evidence: `README.md`)
- React app → Chat interface: renders (evidence: `frontrend/src/App.jsx`)
- React app → Chat state: uses state (evidence: `frontrend/src/main.jsx`)
- React app → Doctor directory: shows doctors (evidence: `README.md`)
- Chat interface → Chat and appointment API: sends chat (evidence: `README.md`)
- Chat interface → Appointment calendar: supports booking (evidence: `README.md`)
- Express API server → Chat and appointment API: mounts route (evidence: `backend/server.js`)
- Express API server → User synchronization: mounts route (evidence: `backend/server.js`)
- Express API server → WhatsApp messaging: mounts route (evidence: `backend/server.js`)
- Express API server → Email notifications: mounts route (evidence: `backend/server.js`)
- React app → User synchronization: syncs signed-in user (evidence: `frontrend/src/App.jsx`)
- User synchronization → Supabase client: queries users (evidence: `backend/routes/users.js`)
- Chat and appointment API → Supabase client: reads and writes (evidence: `backend/routes/chatbot.js`)
- Supabase client → Supabase data store: accesses (evidence: `backend/config/supabase.js`)
- Chat and appointment API → Intent detection: classifies intent (evidence: `backend/routes/chatbot.js`)
- Chat and appointment API → Groq language model: requests completions (evidence: `backend/routes/chatbot.js`)
- Chat and appointment API → Symptom recommendations: uses doctor data (evidence: `backend/routes/chatbot.js`)
- Chat and appointment API → Appointment operations: handles appointment actions (evidence: `README.md`)
- WhatsApp messaging → Whapi service: sends messages (evidence: `backend/routes/whatsapp.js`)
- Email notifications → Brevo email service: sends email (evidence: `backend/routes/email.js`)
- Clerk identity service → React app: provides identity (evidence: `README.md`)
