# daxeshchaudhary/internship_project architecture

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

- Interactive diagram: https://gitdiagram.com/daxeshchaudhary/internship_project
- Repository: https://github.com/daxeshchaudhary/internship_project

## Overview

Carly AI is a medical-assistance and appointment-booking platform. A patient chats through the web interface; the client gathers patient details, requests AI-backed medical guidance and specialization matching, finds doctors and available slots, and submits a booking. The backend also supports a doctor portal and appointment notifications. Doctor availability and booking data are represented in repository files, while doctor credentials use SQLite. The README is brief and the server excerpts omit much route implementation, so uncertain subsystem wiring is not shown; the separate FastAPI service is documented as an alternative integration.

Main entry points: [`server.js`](https://github.com/daxeshchaudhary/internship_project/blob/main/server.js) (HTTP API), [`index.html`](https://github.com/daxeshchaudhary/internship_project/blob/main/index.html) (Patient Web UI), [`app.js`](https://github.com/daxeshchaudhary/internship_project/blob/main/app.js) (Conversation And Intake), [`knowledgeBaseReader.js`](https://github.com/daxeshchaudhary/internship_project/blob/main/knowledgeBaseReader.js) (Doctor Directory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_patient["Patient Experience"]
  node_web["Patient Web UI<br/>[index.html]"]
  node_chat["Conversation And Intake<br/>[app.js]"]
end

subgraph group_backend["Booking Backend"]
  node_server["HTTP API<br/>[server.js]"]
  node_knowledge["Doctor Directory"]
  node_doctor_data[("Doctor Directory Data<br/>[doctors.xlsx]")]
  node_availability[("Availability Data<br/>[availability.json]")]
  node_appointments[("Appointment Records<br/>[appointments.json]")]
  node_prescriptions[("Prescription Records<br/>[prescriptions.json]")]
end

subgraph group_doctor["Doctor Portal"]
  node_doctor_login["Doctor Login<br/>[doctor-login.html]"]
  node_doctor_dashboard["Doctor Dashboard"]
  node_auth_middleware["Doctor Route Guard"]
  node_auth["Doctor Authentication<br/>[doctorAuth.js]"]
  node_auth_db[("Credential Store<br/>[doctor_auth.db]")]
end

subgraph group_integrations["AI And Notifications"]
  node_prompts["Clinical Dialogues"]
  node_fastapi["Model API<br/>[main.py]"]
  node_email["Email Notifications<br/>[emailService.js]"]
  node_whatsapp["WhatsApp Messaging<br/>[whatsappService.js]"]
end

node_patient_actor(("Patient"))
node_doctor_actor(("Doctor"))
node_smtp["Gmail SMTP"]
node_twilio["Twilio WhatsApp"]

node_patient_actor -->|"uses"| node_web
node_web -->|"loads"| node_chat
node_chat -->|"requests guidance and booking"| node_server
node_server -->|"loads doctors"| node_knowledge
node_knowledge -->|"reads"| node_doctor_data
node_server -->|"checks slots"| node_availability
node_server -->|"reads and writes"| node_appointments
node_server -->|"accesses records"| node_prescriptions
node_server -->|"sends appointment notice"| node_email
node_email -->|"delivers mail"| node_smtp
node_doctor_actor -->|"signs in"| node_doctor_login
node_doctor_actor -->|"uses"| node_doctor_dashboard
node_doctor_login -->|"authenticates"| node_server
node_doctor_dashboard -->|"requests doctor data"| node_server
node_server -->|"guards doctor routes"| node_auth_middleware
node_auth_middleware -->|"verifies token"| node_auth
node_auth -->|"reads and updates"| node_auth_db
node_server -.->|"uses model service"| node_fastapi
node_fastapi -.->|"uses clinical material"| node_prompts
node_server -.->|"messaging integration"| node_whatsapp
node_whatsapp -->|"sends messages"| node_twilio

click node_web "https://github.com/daxeshchaudhary/internship_project/blob/main/index.html"
click node_chat "https://github.com/daxeshchaudhary/internship_project/blob/main/app.js"
click node_doctor_login "https://github.com/daxeshchaudhary/internship_project/blob/main/doctor-login.html"
click node_doctor_dashboard "https://github.com/daxeshchaudhary/internship_project/blob/main/doctor-dashboard.html"
click node_server "https://github.com/daxeshchaudhary/internship_project/blob/main/server.js"
click node_knowledge "https://github.com/daxeshchaudhary/internship_project/blob/main/knowledgeBaseReader.js"
click node_doctor_data "https://github.com/daxeshchaudhary/internship_project/blob/main/doctors.xlsx"
click node_availability "https://github.com/daxeshchaudhary/internship_project/blob/main/availability.json"
click node_appointments "https://github.com/daxeshchaudhary/internship_project/blob/main/appointments.json"
click node_prescriptions "https://github.com/daxeshchaudhary/internship_project/blob/main/prescriptions.json"
click node_auth_middleware "https://github.com/daxeshchaudhary/internship_project/blob/main/doctorAuthMiddleware.js"
click node_auth "https://github.com/daxeshchaudhary/internship_project/blob/main/doctorAuth.js"
click node_auth_db "https://github.com/daxeshchaudhary/internship_project/blob/main/doctor_auth.db"
click node_prompts "https://github.com/daxeshchaudhary/internship_project/tree/main/prompts"
click node_fastapi "https://github.com/daxeshchaudhary/internship_project/blob/main/main.py"
click node_email "https://github.com/daxeshchaudhary/internship_project/blob/main/emailService.js"
click node_whatsapp "https://github.com/daxeshchaudhary/internship_project/blob/main/whatsappService.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_web,node_chat toneBlue
class node_server,node_knowledge,node_doctor_data,node_availability,node_appointments,node_prescriptions toneAmber
class node_doctor_login,node_doctor_dashboard,node_auth_middleware,node_auth,node_auth_db toneMint
class node_prompts,node_fastapi,node_email,node_whatsapp toneRose
class node_patient_actor,node_doctor_actor,node_smtp,node_twilio toneIndigo
```

## Components

### Patient Experience

- [Patient Web UI](https://github.com/daxeshchaudhary/internship_project/blob/main/index.html): `index.html`
- [Conversation And Intake](https://github.com/daxeshchaudhary/internship_project/blob/main/app.js): `app.js`

### Booking Backend

- [HTTP API](https://github.com/daxeshchaudhary/internship_project/blob/main/server.js): `server.js`
- [Doctor Directory](https://github.com/daxeshchaudhary/internship_project/blob/main/knowledgeBaseReader.js): `knowledgeBaseReader.js`
- [Doctor Directory Data](https://github.com/daxeshchaudhary/internship_project/blob/main/doctors.xlsx): `doctors.xlsx`
- [Availability Data](https://github.com/daxeshchaudhary/internship_project/blob/main/availability.json): `availability.json`
- [Appointment Records](https://github.com/daxeshchaudhary/internship_project/blob/main/appointments.json): `appointments.json`
- [Prescription Records](https://github.com/daxeshchaudhary/internship_project/blob/main/prescriptions.json): `prescriptions.json`

### Doctor Portal

- [Doctor Login](https://github.com/daxeshchaudhary/internship_project/blob/main/doctor-login.html): `doctor-login.html`
- [Doctor Dashboard](https://github.com/daxeshchaudhary/internship_project/blob/main/doctor-dashboard.html): `doctor-dashboard.html`
- [Doctor Route Guard](https://github.com/daxeshchaudhary/internship_project/blob/main/doctorAuthMiddleware.js): `doctorAuthMiddleware.js`
- [Doctor Authentication](https://github.com/daxeshchaudhary/internship_project/blob/main/doctorAuth.js): `doctorAuth.js`
- [Credential Store](https://github.com/daxeshchaudhary/internship_project/blob/main/doctor_auth.db): `doctor_auth.db`

### AI And Notifications

- [Clinical Dialogues](https://github.com/daxeshchaudhary/internship_project/tree/main/prompts): `prompts`
- [Model API](https://github.com/daxeshchaudhary/internship_project/blob/main/main.py): `main.py`
- [Email Notifications](https://github.com/daxeshchaudhary/internship_project/blob/main/emailService.js): `emailService.js`
- [WhatsApp Messaging](https://github.com/daxeshchaudhary/internship_project/blob/main/whatsappService.js): `whatsappService.js`

### Other components

- **Patient**
- **Doctor**
- **Gmail SMTP**
- **Twilio WhatsApp**

## Connections

- Patient → Patient Web UI: uses
- Patient Web UI → Conversation And Intake: loads
- Conversation And Intake → HTTP API: requests guidance and booking
- HTTP API → Doctor Directory: loads doctors
- Doctor Directory → Doctor Directory Data: reads
- HTTP API → Availability Data: checks slots
- HTTP API → Appointment Records: reads and writes
- HTTP API → Prescription Records: accesses records
- HTTP API → Email Notifications: sends appointment notice
- Email Notifications → Gmail SMTP: delivers mail
- Doctor → Doctor Login: signs in
- Doctor → Doctor Dashboard: uses
- Doctor Login → HTTP API: authenticates
- Doctor Dashboard → HTTP API: requests doctor data
- HTTP API → Doctor Route Guard: guards doctor routes
- Doctor Route Guard → Doctor Authentication: verifies token
- Doctor Authentication → Credential Store: reads and updates
- HTTP API → Model API: uses model service
- Model API → Clinical Dialogues: uses clinical material
- HTTP API → WhatsApp Messaging: messaging integration
- WhatsApp Messaging → Twilio WhatsApp: sends messages
