# vaibhav-1786/clinic_appointment_laravel architecture

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

- Interactive diagram: https://gitdiagram.com/vaibhav-1786/clinic_appointment_laravel
- Repository: https://github.com/vaibhav-1786/clinic_appointment_laravel

## Overview

Clinic_appointment_laravel is a Laravel clinic-management application serving patients, doctors, receptionists, and administrators. Its central workflow is patient appointment booking: the patient submits a request, the booking service validates availability and records the appointment, and role-specific dashboards expose the resulting schedule. The wider product includes clinic discovery and front-desk queues, clinical records, billing, patient support services, and administration. Edges are limited to relationships evidenced by sampled excerpts or the source index; unsampled subsystems are represented without guessed call paths.

Main entry points: [`app/Services/Appointments/BookingService.php`](https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Services/Appointments/BookingService.php) (Booking and status rules), [`app/Http/Controllers/DashboardController.php`](https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Http/Controllers/DashboardController.php) (Role dashboards), [`app/Http/Controllers/Receptionist/BillingController.php`](https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Http/Controllers/Receptionist/BillingController.php) (Reception billing), [`app/Http/Controllers/Patient/AppointmentController.php`](https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Http/Controllers/Patient/AppointmentController.php) (Patient appointment requests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Identity and access"]
  node_auth["Sign-in and recovery"]
  node_role_context["Role context<br/>[RoleContext.php]"]
  node_middleware["Request access controls<br/>[app.php]"]
  node_google["Google token verification"]
end

subgraph group_appointments["Appointments and clinics"]
  node_appointment_ui["Patient appointment requests"]
  node_booking["Booking and status rules<br/>[BookingService.php]"]
  node_slot_service["Slot availability<br/>[SlotService.php]"]
  node_appointment_records[("Appointment records<br/>[Appointment.php]")]
  node_schedule["Doctor scheduling"]
  node_clinic_discovery["Clinic discovery"]
  node_opd_queue["OPD queue management"]
end

subgraph group_care["Clinical care"]
  node_clinical["Clinical records and prescribing"]
end

subgraph group_finance["Billing and payments"]
  node_billing_controller["Reception billing"]
  node_invoice_service["Invoice management<br/>[InvoiceService.php]"]
  node_invoice_records[("Invoice and payment records<br/>[Invoice.php]")]
end

subgraph group_operations["Patient and clinic operations"]
  node_dashboard["Role dashboards"]
  node_patient_extras["Patient support services"]
  node_patient_services_routes["Patient service routes"]
  node_admin_review["Doctor application review"]
  node_admin_application["Admin application interface"]
  node_notifications["Notification centre"]
end

node_patient(("Patient"))
node_doctor(("Doctor"))
node_receptionist(("Receptionist"))
node_admin(("Administrator"))
node_google_service{{"Google identity service"}}

node_patient -.->|"requests booking"| node_appointment_ui
node_appointment_ui -->|"delegates booking"| node_booking
node_booking -->|"checks slots"| node_slot_service
node_booking -->|"updates records"| node_appointment_records
node_schedule -->|"reads appointments"| node_appointment_records
node_doctor -.->|"maintains schedule"| node_schedule
node_dashboard -->|"reads booking status"| node_booking
node_dashboard -->|"loads nearby clinics"| node_clinic_discovery
node_dashboard -->|"counts unread"| node_notifications
node_opd_queue -->|"locks booking work"| node_booking
node_billing_controller -->|"reads invoices"| node_invoice_records
node_billing_controller -.->|"serves billing screens"| node_receptionist
node_invoice_service -.->|"recalculates invoices"| node_invoice_records
node_admin_application -->|"delegates review"| node_admin_review
node_admin_review -.->|"records decisions"| node_admin
node_patient_services_routes -->|"routes patient services"| node_patient_extras
node_auth -->|"uses role context"| node_role_context
node_middleware -->|"resolves role"| node_role_context
node_google -->|"verifies token"| node_google_service
node_clinical -.->|"records care for"| node_patient
node_doctor -.->|"provides care"| node_clinical

click node_auth "https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Http/Controllers/Auth/LoginController.php"
click node_role_context "https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Support/RoleContext.php"
click node_middleware "https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/bootstrap/app.php"
click node_appointment_ui "https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Http/Controllers/Patient/AppointmentController.php"
click node_booking "https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Services/Appointments/BookingService.php"
click node_slot_service "https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Services/Appointments/SlotService.php"
click node_appointment_records "https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Models/Appointment.php"
click node_schedule "https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Http/Controllers/Doctor/ScheduleController.php"
click node_dashboard "https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Http/Controllers/DashboardController.php"
click node_clinic_discovery "https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Services/Clinics/ClinicDiscoveryService.php"
click node_opd_queue "https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Services/Queue/OpdQueueService.php"
click node_clinical "https://github.com/vaibhav-1786/clinic_appointment_laravel/tree/main/app/Services/Clinical"
click node_billing_controller "https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Http/Controllers/Receptionist/BillingController.php"
click node_invoice_service "https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Services/Billing/InvoiceService.php"
click node_invoice_records "https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Models/Invoice.php"
click node_patient_extras "https://github.com/vaibhav-1786/clinic_appointment_laravel/tree/main/app/Services/PatientExtras"
click node_patient_services_routes "https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/routes/patient_services.php"
click node_admin_review "https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Services/Admin/ApplicationReviewService.php"
click node_admin_application "https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Http/Controllers/Admin/ApplicationController.php"
click node_notifications "https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Services/Notifications/NotificationCentreService.php"
click node_google "https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Services/Auth/GoogleAuthService.php"

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_auth,node_role_context,node_middleware,node_google toneBlue
class node_appointment_ui,node_booking,node_slot_service,node_appointment_records,node_schedule,node_clinic_discovery,node_opd_queue toneAmber
class node_clinical toneMint
class node_billing_controller,node_invoice_service,node_invoice_records toneRose
class node_dashboard,node_patient_extras,node_patient_services_routes,node_admin_review,node_admin_application,node_notifications,node_patient,node_doctor,node_receptionist,node_admin,node_google_service toneIndigo
```

## Components

### Identity and access

- [Sign-in and recovery](https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Http/Controllers/Auth/LoginController.php): `app/Http/Controllers/Auth/LoginController.php`
- [Role context](https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Support/RoleContext.php): `app/Support/RoleContext.php`
- [Request access controls](https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/bootstrap/app.php): `bootstrap/app.php`
- [Google token verification](https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Services/Auth/GoogleAuthService.php): `app/Services/Auth/GoogleAuthService.php`

### Appointments and clinics

- [Patient appointment requests](https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Http/Controllers/Patient/AppointmentController.php): `app/Http/Controllers/Patient/AppointmentController.php`
- [Booking and status rules](https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Services/Appointments/BookingService.php): `app/Services/Appointments/BookingService.php`
- [Slot availability](https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Services/Appointments/SlotService.php): `app/Services/Appointments/SlotService.php`
- [Appointment records](https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Models/Appointment.php): `app/Models/Appointment.php`
- [Doctor scheduling](https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Http/Controllers/Doctor/ScheduleController.php): `app/Http/Controllers/Doctor/ScheduleController.php`
- [Clinic discovery](https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Services/Clinics/ClinicDiscoveryService.php): `app/Services/Clinics/ClinicDiscoveryService.php`
- [OPD queue management](https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Services/Queue/OpdQueueService.php): `app/Services/Queue/OpdQueueService.php`

### Clinical care

- [Clinical records and prescribing](https://github.com/vaibhav-1786/clinic_appointment_laravel/tree/main/app/Services/Clinical): `app/Services/Clinical`

### Billing and payments

- [Reception billing](https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Http/Controllers/Receptionist/BillingController.php): `app/Http/Controllers/Receptionist/BillingController.php`
- [Invoice management](https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Services/Billing/InvoiceService.php): `app/Services/Billing/InvoiceService.php`
- [Invoice and payment records](https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Models/Invoice.php): `app/Models/Invoice.php`

### Patient and clinic operations

- [Role dashboards](https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Http/Controllers/DashboardController.php): `app/Http/Controllers/DashboardController.php`
- [Patient support services](https://github.com/vaibhav-1786/clinic_appointment_laravel/tree/main/app/Services/PatientExtras): `app/Services/PatientExtras`
- [Patient service routes](https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/routes/patient_services.php): `routes/patient_services.php`
- [Doctor application review](https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Services/Admin/ApplicationReviewService.php): `app/Services/Admin/ApplicationReviewService.php`
- [Admin application interface](https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Http/Controllers/Admin/ApplicationController.php): `app/Http/Controllers/Admin/ApplicationController.php`
- [Notification centre](https://github.com/vaibhav-1786/clinic_appointment_laravel/blob/main/app/Services/Notifications/NotificationCentreService.php): `app/Services/Notifications/NotificationCentreService.php`

### Other components

- **Patient**
- **Doctor**
- **Receptionist**
- **Administrator**
- **Google identity service**

## Connections

- Patient → Patient appointment requests: requests booking
- Patient appointment requests → Booking and status rules: delegates booking (evidence: `app/Http/Controllers/Patient/AppointmentController.php`)
- Booking and status rules → Slot availability: checks slots (evidence: `app/Services/Appointments/BookingService.php`)
- Booking and status rules → Appointment records: updates records (evidence: `app/Services/Appointments/BookingService.php`)
- Doctor scheduling → Appointment records: reads appointments (evidence: `app/Http/Controllers/Doctor/ScheduleController.php`)
- Doctor → Doctor scheduling: maintains schedule
- Role dashboards → Booking and status rules: reads booking status (evidence: `app/Http/Controllers/DashboardController.php`)
- Role dashboards → Clinic discovery: loads nearby clinics (evidence: `app/Http/Controllers/DashboardController.php`)
- Role dashboards → Notification centre: counts unread (evidence: `app/Http/Controllers/DashboardController.php`)
- OPD queue management → Booking and status rules: locks booking work (evidence: `app/Services/Queue/OpdQueueService.php`)
- Reception billing → Invoice and payment records: reads invoices (evidence: `app/Http/Controllers/Receptionist/BillingController.php`)
- Reception billing → Receptionist: serves billing screens
- Invoice management → Invoice and payment records: recalculates invoices (evidence: `app/Services/Billing/InvoiceService.php`)
- Admin application interface → Doctor application review: delegates review (evidence: `app/Http/Controllers/Admin/ApplicationController.php`)
- Doctor application review → Administrator: records decisions
- Patient service routes → Patient support services: routes patient services (evidence: `routes/patient_services.php`)
- Sign-in and recovery → Role context: uses role context (evidence: `app/Http/Controllers/Auth/LoginController.php`)
- Request access controls → Role context: resolves role (evidence: `bootstrap/app.php`)
- Google token verification → Google identity service: verifies token (evidence: `app/Services/Auth/GoogleAuthService.php`)
- Clinical records and prescribing → Patient: records care for
- Doctor → Clinical records and prescribing: provides care
