# jagan-16/zobot architecture

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

- Interactive diagram: https://gitdiagram.com/jagan-16/zobot
- Repository: https://github.com/jagan-16/zobot

## Overview

MedCore Health presents a healthcare consultation booking experience: patients interact with the chatbot, receive AI-interpreted next steps, verify a phone number, choose a service and time, and manage bookings. The frontend also exposes an admin dashboard for booking metrics. Booking and OTP behavior is implemented with in-memory mock data in both the Express backend and frontend mock service; the dashboard uses the frontend mock service. The graph omits unshown action branches and does not imply persistence. README capabilities and sampled code support the principal workflow; excerpts limit certainty about detailed chatbot dispatch.

Main entry points: [`components/ChatWidget.tsx`](https://github.com/jagan-16/zobot/blob/main/components/ChatWidget.tsx) (Booking chatbot), [`App.tsx`](https://github.com/jagan-16/zobot/blob/main/App.tsx) (Clinic landing app), [`services/llm.ts`](https://github.com/jagan-16/zobot/blob/main/services/llm.ts) (Gemini assistant), [`services/api.ts`](https://github.com/jagan-16/zobot/blob/main/services/api.ts) (HTTP API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_patient_ui["Patient experience"]
  node_app["Clinic landing app<br/>[App.tsx]"]
  node_chat["Booking chatbot<br/>[ChatWidget.tsx]"]
end

subgraph group_chat_services["Chat and AI"]
  node_llm["Gemini assistant<br/>[llm.ts]"]
end

subgraph group_booking_services["Booking operations"]
  node_frontend_api["HTTP API client<br/>[api.ts]"]
  node_mock_api["Admin mock API<br/>[mockApi.ts]"]
  node_backend["Express API<br/>[server.js]"]
  node_serverless["Vercel API<br/>[index.js]"]
  node_booking_state[("In-memory bookings<br/>[server.js]")]
  node_mock_state[("Frontend mock bookings<br/>[mockApi.ts]")]
end

subgraph group_admin["Administration"]
  node_admin_view["Admin dashboard<br/>[AdminDashboard.tsx]"]
end

node_patient(("Patient"))
node_gemini{{"Google Gemini"}}

node_patient -->|"visits"| node_app
node_app -->|"renders"| node_chat
node_app -->|"opens"| node_admin_view
node_patient -.->|"interacts"| node_chat
node_chat -->|"requests replies"| node_llm
node_llm -->|"generates content"| node_gemini
node_chat -->|"runs actions"| node_frontend_api
node_frontend_api -.->|"HTTP requests"| node_backend
node_backend -->|"reads and writes"| node_booking_state
node_admin_view -->|"loads bookings"| node_mock_api
node_mock_api -->|"reads and writes"| node_mock_state
node_serverless -->|"maintains bookings"| node_booking_state

click node_app "https://github.com/jagan-16/zobot/blob/main/App.tsx"
click node_chat "https://github.com/jagan-16/zobot/blob/main/components/ChatWidget.tsx"
click node_admin_view "https://github.com/jagan-16/zobot/blob/main/components/AdminDashboard.tsx"
click node_llm "https://github.com/jagan-16/zobot/blob/main/services/llm.ts"
click node_frontend_api "https://github.com/jagan-16/zobot/blob/main/services/api.ts"
click node_mock_api "https://github.com/jagan-16/zobot/blob/main/services/mockApi.ts"
click node_backend "https://github.com/jagan-16/zobot/blob/main/backend/server.js"
click node_serverless "https://github.com/jagan-16/zobot/blob/main/api/index.js"
click node_booking_state "https://github.com/jagan-16/zobot/blob/main/backend/server.js"
click node_mock_state "https://github.com/jagan-16/zobot/blob/main/services/mockApi.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_chat toneBlue
class node_llm toneAmber
class node_frontend_api,node_mock_api,node_backend,node_serverless,node_booking_state,node_mock_state toneMint
class node_admin_view toneRose
class node_patient,node_gemini toneIndigo
```

## Components

### Patient experience

- [Clinic landing app](https://github.com/jagan-16/zobot/blob/main/App.tsx): `App.tsx`
- [Booking chatbot](https://github.com/jagan-16/zobot/blob/main/components/ChatWidget.tsx): `components/ChatWidget.tsx`

### Chat and AI

- [Gemini assistant](https://github.com/jagan-16/zobot/blob/main/services/llm.ts): `services/llm.ts`

### Booking operations

- [HTTP API client](https://github.com/jagan-16/zobot/blob/main/services/api.ts): `services/api.ts`
- [Admin mock API](https://github.com/jagan-16/zobot/blob/main/services/mockApi.ts): `services/mockApi.ts`
- [Express API](https://github.com/jagan-16/zobot/blob/main/backend/server.js): `backend/server.js`
- [Vercel API](https://github.com/jagan-16/zobot/blob/main/api/index.js): `api/index.js`
- [In-memory bookings](https://github.com/jagan-16/zobot/blob/main/backend/server.js): `backend/server.js`
- [Frontend mock bookings](https://github.com/jagan-16/zobot/blob/main/services/mockApi.ts): `services/mockApi.ts`

### Administration

- [Admin dashboard](https://github.com/jagan-16/zobot/blob/main/components/AdminDashboard.tsx): `components/AdminDashboard.tsx`

### Other components

- **Patient**
- **Google Gemini**

## Connections

- Patient → Clinic landing app: visits (evidence: `README.md`)
- Clinic landing app → Booking chatbot: renders (evidence: `App.tsx`)
- Clinic landing app → Admin dashboard: opens (evidence: `App.tsx`)
- Patient → Booking chatbot: interacts
- Booking chatbot → Gemini assistant: requests replies (evidence: `components/ChatWidget.tsx`)
- Gemini assistant → Google Gemini: generates content (evidence: `services/llm.ts`)
- Booking chatbot → HTTP API client: runs actions (evidence: `components/ChatWidget.tsx`)
- HTTP API client → Express API: HTTP requests
- Express API → In-memory bookings: reads and writes (evidence: `backend/server.js`)
- Admin dashboard → Admin mock API: loads bookings (evidence: `components/AdminDashboard.tsx`)
- Admin mock API → Frontend mock bookings: reads and writes (evidence: `services/mockApi.ts`)
- Vercel API → In-memory bookings: maintains bookings (evidence: `api/index.js`)
