# abhiram235/docspot-medical-appointment-booking-system architecture

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

- Interactive diagram: https://gitdiagram.com/abhiram235/docspot-medical-appointment-booking-system
- Repository: https://github.com/abhiram235/docspot-medical-appointment-booking-system

## Overview

Docspot is a three-role healthcare appointment platform: patients find approved doctors, inspect availability and book; doctors manage schedules and appointments; admins review doctors and oversee platform activity. The React app routes role-specific dashboards to a Spring Boot REST backend, with JWT role-based access documented in the README. AppointmentService handles booking and scheduled appointment work; the README also documents next-day reminders and retrying appointment email. Several backend integrations are represented only by the tree or README, so those links are marked unverified rather than asserted as inspected calls.

Main entry points: [`docspot-frontend/docspot-frontend/src/api`](https://github.com/abhiram235/docspot-medical-appointment-booking-system/tree/main/docspot-frontend/docspot-frontend/src/api) (REST clients), [`docspot-backend/docspot/src/main/java/com/docspot/service/AppointmentService.java`](https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-backend/docspot/src/main/java/com/docspot/service/AppointmentService.java) (Appointment lifecycle), [`docspot-frontend/docspot-frontend/src/App.jsx`](https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-frontend/docspot-frontend/src/App.jsx) (Application shell), [`docspot-backend/docspot/src/main/java/com/docspot/controller/AuthController.java`](https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-backend/docspot/src/main/java/com/docspot/controller/AuthController.java) (Auth endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_app["Application shell<br/>[App.jsx]"]
  node_routes["Role dashboards<br/>[AppRoutes.jsx]"]
  node_pages["Role workflows"]
  node_api["REST clients"]
end

subgraph group_identity["Identity and access"]
  node_authui["Auth context<br/>[AuthContext.jsx]"]
  node_authcontroller["Auth endpoints"]
  node_authservice["Auth service<br/>[AuthService.java]"]
  node_security["JWT security"]
end

subgraph group_care["Care workflows"]
  node_patientcontroller["Patient endpoints"]
  node_patientservice["Patient workflows"]
  node_doctorcontroller["Doctor endpoints"]
  node_doctorservice["Doctor workflows<br/>[DoctorService.java]"]
  node_admincontroller["Admin endpoints"]
  node_adminservice["Admin workflows<br/>[AdminService.java]"]
  node_appointments["Appointment lifecycle"]
end

subgraph group_platform["Persistence and messaging"]
  node_store[("Relational data")]
  node_notifications["Notifications"]
  node_email["Email delivery<br/>[EmailService.java]"]
  node_files["Document storage"]
end

node_actors(("Patient / Doctor / Admin"))

node_actors -->|"use dashboards"| node_app
node_app -->|"renders routes"| node_routes
node_routes -->|"routes roles"| node_pages
node_app -->|"provides auth"| node_authui
node_pages -.->|"request data"| node_api
node_api -.->|"call REST"| node_authcontroller
node_api -.->|"call REST"| node_patientcontroller
node_api -.->|"call REST"| node_doctorcontroller
node_api -.->|"call REST"| node_admincontroller
node_authcontroller -.->|"delegates to"| node_authservice
node_authservice -->|"issues JWT"| node_security
node_security -.->|"guards endpoints"| node_authcontroller
node_patientcontroller -->|"delegates to"| node_patientservice
node_patientservice -.->|"handles booking"| node_appointments
node_doctorcontroller -->|"delegates to"| node_doctorservice
node_admincontroller -.->|"delegates to"| node_adminservice
node_appointments -->|"reads writes"| node_store
node_appointments -.->|"publishes events"| node_notifications
node_appointments -.->|"sends reminders"| node_email
node_doctorservice -.->|"stores documents"| node_files
node_email -.->|"emails patients"| node_actors

click node_app "https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-frontend/docspot-frontend/src/App.jsx"
click node_routes "https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-frontend/docspot-frontend/src/routes/AppRoutes.jsx"
click node_pages "https://github.com/abhiram235/docspot-medical-appointment-booking-system/tree/main/docspot-frontend/docspot-frontend/src/pages"
click node_api "https://github.com/abhiram235/docspot-medical-appointment-booking-system/tree/main/docspot-frontend/docspot-frontend/src/api"
click node_authui "https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-frontend/docspot-frontend/src/context/AuthContext.jsx"
click node_authcontroller "https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-backend/docspot/src/main/java/com/docspot/controller/AuthController.java"
click node_authservice "https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-backend/docspot/src/main/java/com/docspot/service/AuthService.java"
click node_security "https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-backend/docspot/src/main/java/com/docspot/config/SecurityConfig.java"
click node_patientcontroller "https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-backend/docspot/src/main/java/com/docspot/controller/PatientController.java"
click node_patientservice "https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-backend/docspot/src/main/java/com/docspot/service/PatientService.java"
click node_doctorcontroller "https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-backend/docspot/src/main/java/com/docspot/controller/DoctorController.java"
click node_doctorservice "https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-backend/docspot/src/main/java/com/docspot/service/DoctorService.java"
click node_admincontroller "https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-backend/docspot/src/main/java/com/docspot/controller/AdminController.java"
click node_adminservice "https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-backend/docspot/src/main/java/com/docspot/service/AdminService.java"
click node_appointments "https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-backend/docspot/src/main/java/com/docspot/service/AppointmentService.java"
click node_store "https://github.com/abhiram235/docspot-medical-appointment-booking-system/tree/main/docspot-backend/docspot/src/main/java/com/docspot/entity"
click node_notifications "https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-backend/docspot/src/main/java/com/docspot/service/NotificationService.java"
click node_email "https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-backend/docspot/src/main/java/com/docspot/service/EmailService.java"
click node_files "https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-backend/docspot/src/main/java/com/docspot/service/FileStorageService.java"

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_routes,node_pages,node_api toneBlue
class node_authui,node_authcontroller,node_authservice,node_security toneAmber
class node_patientcontroller,node_patientservice,node_doctorcontroller,node_doctorservice,node_admincontroller,node_adminservice,node_appointments toneMint
class node_store,node_notifications,node_email,node_files toneRose
class node_actors toneIndigo
```

## Components

### React client

- [Application shell](https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-frontend/docspot-frontend/src/App.jsx): `docspot-frontend/docspot-frontend/src/App.jsx`
- [Role dashboards](https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-frontend/docspot-frontend/src/routes/AppRoutes.jsx): `docspot-frontend/docspot-frontend/src/routes/AppRoutes.jsx`
- [Role workflows](https://github.com/abhiram235/docspot-medical-appointment-booking-system/tree/main/docspot-frontend/docspot-frontend/src/pages): `docspot-frontend/docspot-frontend/src/pages`
- [REST clients](https://github.com/abhiram235/docspot-medical-appointment-booking-system/tree/main/docspot-frontend/docspot-frontend/src/api): `docspot-frontend/docspot-frontend/src/api`

### Identity and access

- [Auth context](https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-frontend/docspot-frontend/src/context/AuthContext.jsx): `docspot-frontend/docspot-frontend/src/context/AuthContext.jsx`
- [Auth endpoints](https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-backend/docspot/src/main/java/com/docspot/controller/AuthController.java): `docspot-backend/docspot/src/main/java/com/docspot/controller/AuthController.java`
- [Auth service](https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-backend/docspot/src/main/java/com/docspot/service/AuthService.java): `docspot-backend/docspot/src/main/java/com/docspot/service/AuthService.java`
- [JWT security](https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-backend/docspot/src/main/java/com/docspot/config/SecurityConfig.java): `docspot-backend/docspot/src/main/java/com/docspot/config/SecurityConfig.java`

### Care workflows

- [Patient endpoints](https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-backend/docspot/src/main/java/com/docspot/controller/PatientController.java): `docspot-backend/docspot/src/main/java/com/docspot/controller/PatientController.java`
- [Patient workflows](https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-backend/docspot/src/main/java/com/docspot/service/PatientService.java): `docspot-backend/docspot/src/main/java/com/docspot/service/PatientService.java`
- [Doctor endpoints](https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-backend/docspot/src/main/java/com/docspot/controller/DoctorController.java): `docspot-backend/docspot/src/main/java/com/docspot/controller/DoctorController.java`
- [Doctor workflows](https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-backend/docspot/src/main/java/com/docspot/service/DoctorService.java): `docspot-backend/docspot/src/main/java/com/docspot/service/DoctorService.java`
- [Admin endpoints](https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-backend/docspot/src/main/java/com/docspot/controller/AdminController.java): `docspot-backend/docspot/src/main/java/com/docspot/controller/AdminController.java`
- [Admin workflows](https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-backend/docspot/src/main/java/com/docspot/service/AdminService.java): `docspot-backend/docspot/src/main/java/com/docspot/service/AdminService.java`
- [Appointment lifecycle](https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-backend/docspot/src/main/java/com/docspot/service/AppointmentService.java): `docspot-backend/docspot/src/main/java/com/docspot/service/AppointmentService.java`

### Persistence and messaging

- [Relational data](https://github.com/abhiram235/docspot-medical-appointment-booking-system/tree/main/docspot-backend/docspot/src/main/java/com/docspot/entity): `docspot-backend/docspot/src/main/java/com/docspot/entity`
- [Notifications](https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-backend/docspot/src/main/java/com/docspot/service/NotificationService.java): `docspot-backend/docspot/src/main/java/com/docspot/service/NotificationService.java`
- [Email delivery](https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-backend/docspot/src/main/java/com/docspot/service/EmailService.java): `docspot-backend/docspot/src/main/java/com/docspot/service/EmailService.java`
- [Document storage](https://github.com/abhiram235/docspot-medical-appointment-booking-system/blob/main/docspot-backend/docspot/src/main/java/com/docspot/service/FileStorageService.java): `docspot-backend/docspot/src/main/java/com/docspot/service/FileStorageService.java`

### Other components

- **Patient / Doctor / Admin**

## Connections

- Patient / Doctor / Admin → Application shell: use dashboards (evidence: `docspot-frontend/docspot-frontend/src/App.jsx`)
- Application shell → Role dashboards: renders routes (evidence: `docspot-frontend/docspot-frontend/src/App.jsx`)
- Role dashboards → Role workflows: routes roles (evidence: `docspot-frontend/docspot-frontend/src/routes/AppRoutes.jsx`)
- Application shell → Auth context: provides auth (evidence: `docspot-frontend/docspot-frontend/src/App.jsx`)
- Role workflows → REST clients: request data
- REST clients → Auth endpoints: call REST
- REST clients → Patient endpoints: call REST
- REST clients → Doctor endpoints: call REST
- REST clients → Admin endpoints: call REST
- Auth endpoints → Auth service: delegates to (evidence: `docspot-backend/docspot/src/main/java/com/docspot/controller/AuthController.java`)
- Auth service → JWT security: issues JWT (evidence: `docspot-backend/docspot/src/main/java/com/docspot/service/AuthService.java`)
- JWT security → Auth endpoints: guards endpoints
- Patient endpoints → Patient workflows: delegates to (evidence: `docspot-backend/docspot/src/main/java/com/docspot/controller/PatientController.java`)
- Patient workflows → Appointment lifecycle: handles booking
- Doctor endpoints → Doctor workflows: delegates to (evidence: `docspot-backend/docspot/src/main/java/com/docspot/controller/DoctorController.java`)
- Admin endpoints → Admin workflows: delegates to (evidence: `docspot-backend/docspot/src/main/java/com/docspot/controller/AdminController.java`)
- Appointment lifecycle → Relational data: reads writes (evidence: `docspot-backend/docspot/src/main/java/com/docspot/service/AppointmentService.java`)
- Appointment lifecycle → Notifications: publishes events
- Appointment lifecycle → Email delivery: sends reminders
- Doctor workflows → Document storage: stores documents (evidence: `docspot-backend/docspot/src/main/java/com/docspot/service/DoctorService.java`)
- Email delivery → Patient / Doctor / Admin: emails patients
