# karthikchejarla/doctorappointment architecture

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

- Interactive diagram: https://gitdiagram.com/karthikchejarla/doctorappointment
- Repository: https://github.com/karthikchejarla/doctorappointment

## Overview

This is a doctor-appointment booking application with a React frontend and Spring backend. Patients register or sign in, discover and filter doctors, inspect booked slots, book appointments, and manage bookings; doctors have a separate dashboard for appointment and slot management. The backend exposes these operations through a REST controller, delegates appointment and registration work to a service, and uses repositories for doctor, patient, and appointment data. The sampled service also sends registration and booking emails. Some frontend and backend modules were not sampled, so their detailed call wiring is omitted.

Main entry points: [`doctorAppointment/src/main/java/com/spring/doctorAppointment/controller/PatientController.java`](https://github.com/karthikchejarla/doctorappointment/blob/main/doctorAppointment/src/main/java/com/spring/doctorAppointment/controller/PatientController.java) (Appointment API), [`doctorAppointment/src/main/java/com/spring/doctorAppointment/service/PatientService.java`](https://github.com/karthikchejarla/doctorappointment/blob/main/doctorAppointment/src/main/java/com/spring/doctorAppointment/service/PatientService.java) (Appointment service), [`Frontend/src/App.jsx`](https://github.com/karthikchejarla/doctorappointment/blob/main/Frontend/src/App.jsx) (App routing), [`doctorAppointment/src/main/java/com/spring/doctorAppointment/service/CustomUserDetailsService.java`](https://github.com/karthikchejarla/doctorappointment/blob/main/doctorAppointment/src/main/java/com/spring/doctorAppointment/service/CustomUserDetailsService.java) (User lookup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["App routing<br/>[App.jsx]"]
  node_auth["Sign in / register<br/>[Auth.jsx]"]
  node_patientdash["Patient dashboard"]
  node_doctordash["Doctor dashboard"]
  node_bookslot["Slot booking UI<br/>[Bookslot.jsx]"]
  node_doctorregister["Doctor registration UI<br/>[DoctorRegister.jsx]"]
  node_login["Login UI<br/>[Login.jsx]"]
  node_patientregister["Patient registration UI"]
end

subgraph group_api["REST API"]
  node_controller["Appointment API"]
end

subgraph group_domain["Appointment domain"]
  node_service["Appointment service"]
  node_doctors[("Doctor records<br/>[DoctorRepo.java]")]
  node_patients[("Patient records<br/>[PatientRepo.java]")]
  node_appointments[("Appointment records")]
  node_emailservice["Email service<br/>[EmailService.java]"]
end

subgraph group_security["Access and security"]
  node_securityconfig["Security configuration"]
  node_userdetails["User lookup"]
  node_ratelimit["Rate limiting"]
end

node_patient(("Patient"))
node_mail["Mail provider"]

node_patient -->|"uses"| node_app
node_app -->|"shows when signed out"| node_auth
node_app -->|"routes patient"| node_patientdash
node_app -->|"routes doctor"| node_doctordash
node_auth -->|"calls auth endpoints"| node_controller
node_patientdash -->|"calls booking API"| node_controller
node_bookslot -->|"books slots"| node_controller
node_doctorregister -->|"registers doctor"| node_controller
node_patientregister -->|"registers patient"| node_controller
node_login -->|"signs in"| node_controller
node_doctordash -->|"manages appointments"| node_controller
node_controller -->|"delegates operations"| node_service
node_controller -->|"looks up login"| node_doctors
node_controller -->|"looks up login"| node_patients
node_service -->|"reads and writes"| node_doctors
node_service -->|"reads and writes"| node_patients
node_service -->|"reads and writes"| node_appointments
node_service -->|"sends notices"| node_emailservice
node_emailservice -.->|"sends email"| node_mail
node_securityconfig -->|"loads user details"| node_userdetails
node_userdetails -->|"checks doctor email"| node_doctors
node_userdetails -->|"checks patient email"| node_patients
node_ratelimit -->|"filters requests"| node_controller

click node_app "https://github.com/karthikchejarla/doctorappointment/blob/main/Frontend/src/App.jsx"
click node_auth "https://github.com/karthikchejarla/doctorappointment/blob/main/Frontend/src/Components/Auth.jsx"
click node_patientdash "https://github.com/karthikchejarla/doctorappointment/blob/main/Frontend/src/Components/PatientDashboard.jsx"
click node_doctordash "https://github.com/karthikchejarla/doctorappointment/blob/main/Frontend/src/Components/DoctorDashboard.jsx"
click node_bookslot "https://github.com/karthikchejarla/doctorappointment/blob/main/Frontend/src/Components/Bookslot.jsx"
click node_doctorregister "https://github.com/karthikchejarla/doctorappointment/blob/main/Frontend/src/Components/DoctorRegister.jsx"
click node_login "https://github.com/karthikchejarla/doctorappointment/blob/main/Frontend/src/Components/Login.jsx"
click node_patientregister "https://github.com/karthikchejarla/doctorappointment/blob/main/Frontend/src/Components/PaitentRegister.jsx"
click node_controller "https://github.com/karthikchejarla/doctorappointment/blob/main/doctorAppointment/src/main/java/com/spring/doctorAppointment/controller/PatientController.java"
click node_service "https://github.com/karthikchejarla/doctorappointment/blob/main/doctorAppointment/src/main/java/com/spring/doctorAppointment/service/PatientService.java"
click node_doctors "https://github.com/karthikchejarla/doctorappointment/blob/main/doctorAppointment/src/main/java/com/spring/doctorAppointment/repo/DoctorRepo.java"
click node_patients "https://github.com/karthikchejarla/doctorappointment/blob/main/doctorAppointment/src/main/java/com/spring/doctorAppointment/repo/PatientRepo.java"
click node_appointments "https://github.com/karthikchejarla/doctorappointment/blob/main/doctorAppointment/src/main/java/com/spring/doctorAppointment/repo/AppointmentRepo.java"
click node_emailservice "https://github.com/karthikchejarla/doctorappointment/blob/main/doctorAppointment/src/main/java/com/spring/doctorAppointment/service/EmailService.java"
click node_securityconfig "https://github.com/karthikchejarla/doctorappointment/blob/main/doctorAppointment/src/main/java/com/spring/doctorAppointment/config/SecurityConfig.java"
click node_userdetails "https://github.com/karthikchejarla/doctorappointment/blob/main/doctorAppointment/src/main/java/com/spring/doctorAppointment/service/CustomUserDetailsService.java"
click node_ratelimit "https://github.com/karthikchejarla/doctorappointment/blob/main/doctorAppointment/src/main/java/com/spring/doctorAppointment/config/RateLimitingFilter.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_auth,node_patientdash,node_doctordash,node_bookslot,node_doctorregister,node_login,node_patientregister toneBlue
class node_controller toneAmber
class node_service,node_doctors,node_patients,node_appointments,node_emailservice toneMint
class node_securityconfig,node_userdetails,node_ratelimit toneRose
class node_patient,node_mail toneIndigo
```

## Components

### Web application

- [App routing](https://github.com/karthikchejarla/doctorappointment/blob/main/Frontend/src/App.jsx): `Frontend/src/App.jsx`
- [Sign in / register](https://github.com/karthikchejarla/doctorappointment/blob/main/Frontend/src/Components/Auth.jsx): `Frontend/src/Components/Auth.jsx`
- [Patient dashboard](https://github.com/karthikchejarla/doctorappointment/blob/main/Frontend/src/Components/PatientDashboard.jsx): `Frontend/src/Components/PatientDashboard.jsx`
- [Doctor dashboard](https://github.com/karthikchejarla/doctorappointment/blob/main/Frontend/src/Components/DoctorDashboard.jsx): `Frontend/src/Components/DoctorDashboard.jsx`
- [Slot booking UI](https://github.com/karthikchejarla/doctorappointment/blob/main/Frontend/src/Components/Bookslot.jsx): `Frontend/src/Components/Bookslot.jsx`
- [Doctor registration UI](https://github.com/karthikchejarla/doctorappointment/blob/main/Frontend/src/Components/DoctorRegister.jsx): `Frontend/src/Components/DoctorRegister.jsx`
- [Login UI](https://github.com/karthikchejarla/doctorappointment/blob/main/Frontend/src/Components/Login.jsx): `Frontend/src/Components/Login.jsx`
- [Patient registration UI](https://github.com/karthikchejarla/doctorappointment/blob/main/Frontend/src/Components/PaitentRegister.jsx): `Frontend/src/Components/PaitentRegister.jsx`

### REST API

- [Appointment API](https://github.com/karthikchejarla/doctorappointment/blob/main/doctorAppointment/src/main/java/com/spring/doctorAppointment/controller/PatientController.java): `doctorAppointment/src/main/java/com/spring/doctorAppointment/controller/PatientController.java`

### Appointment domain

- [Appointment service](https://github.com/karthikchejarla/doctorappointment/blob/main/doctorAppointment/src/main/java/com/spring/doctorAppointment/service/PatientService.java): `doctorAppointment/src/main/java/com/spring/doctorAppointment/service/PatientService.java`
- [Doctor records](https://github.com/karthikchejarla/doctorappointment/blob/main/doctorAppointment/src/main/java/com/spring/doctorAppointment/repo/DoctorRepo.java): `doctorAppointment/src/main/java/com/spring/doctorAppointment/repo/DoctorRepo.java`
- [Patient records](https://github.com/karthikchejarla/doctorappointment/blob/main/doctorAppointment/src/main/java/com/spring/doctorAppointment/repo/PatientRepo.java): `doctorAppointment/src/main/java/com/spring/doctorAppointment/repo/PatientRepo.java`
- [Appointment records](https://github.com/karthikchejarla/doctorappointment/blob/main/doctorAppointment/src/main/java/com/spring/doctorAppointment/repo/AppointmentRepo.java): `doctorAppointment/src/main/java/com/spring/doctorAppointment/repo/AppointmentRepo.java`
- [Email service](https://github.com/karthikchejarla/doctorappointment/blob/main/doctorAppointment/src/main/java/com/spring/doctorAppointment/service/EmailService.java): `doctorAppointment/src/main/java/com/spring/doctorAppointment/service/EmailService.java`

### Access and security

- [Security configuration](https://github.com/karthikchejarla/doctorappointment/blob/main/doctorAppointment/src/main/java/com/spring/doctorAppointment/config/SecurityConfig.java): `doctorAppointment/src/main/java/com/spring/doctorAppointment/config/SecurityConfig.java`
- [User lookup](https://github.com/karthikchejarla/doctorappointment/blob/main/doctorAppointment/src/main/java/com/spring/doctorAppointment/service/CustomUserDetailsService.java): `doctorAppointment/src/main/java/com/spring/doctorAppointment/service/CustomUserDetailsService.java`
- [Rate limiting](https://github.com/karthikchejarla/doctorappointment/blob/main/doctorAppointment/src/main/java/com/spring/doctorAppointment/config/RateLimitingFilter.java): `doctorAppointment/src/main/java/com/spring/doctorAppointment/config/RateLimitingFilter.java`

### Other components

- **Patient**
- **Mail provider**

## Connections

- Patient → App routing: uses
- App routing → Sign in / register: shows when signed out
- App routing → Patient dashboard: routes patient
- App routing → Doctor dashboard: routes doctor
- Sign in / register → Appointment API: calls auth endpoints
- Patient dashboard → Appointment API: calls booking API
- Slot booking UI → Appointment API: books slots
- Doctor registration UI → Appointment API: registers doctor
- Patient registration UI → Appointment API: registers patient
- Login UI → Appointment API: signs in
- Doctor dashboard → Appointment API: manages appointments
- Appointment API → Appointment service: delegates operations
- Appointment API → Doctor records: looks up login
- Appointment API → Patient records: looks up login
- Appointment service → Doctor records: reads and writes
- Appointment service → Patient records: reads and writes
- Appointment service → Appointment records: reads and writes
- Appointment service → Email service: sends notices
- Email service → Mail provider: sends email
- Security configuration → User lookup: loads user details
- User lookup → Doctor records: checks doctor email
- User lookup → Patient records: checks patient email
- Rate limiting → Appointment API: filters requests
