# ssathwick007-creator/ghostqueue architecture

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

- Interactive diagram: https://gitdiagram.com/ssathwick007-creator/ghostqueue
- Repository: https://github.com/ssathwick007-creator/ghostqueue

## Overview

GhostQueue is a hospital appointment and clinical-intelligence desktop application. Admins, doctors, and patients use role-specific interfaces to manage appointments and patients; the system predicts no-show risk, maintains a standby queue, and proposes slot reallocations that require administrator approval. The README also documents reminders, analytics, and configurable facility settings. Several domain modules are represented by their exact tree paths but were not sampled, so their internal call relationships are not asserted.

Main entry points: [`src/main/java/com/ghostqueue/controller`](https://github.com/ssathwick007-creator/ghostqueue/tree/main/src/main/java/com/ghostqueue/controller) (Admin operations UI), [`src/main/java/com/ghostqueue/service/AppointmentService.java`](https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/service/AppointmentService.java) (Appointment services), [`src/main/java/com/ghostqueue/service/ReallocationService.java`](https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/service/ReallocationService.java) (Reallocation approval), [`src/main/java/com/ghostqueue/service/PredictionService.java`](https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/service/PredictionService.java) (Prediction workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Role-Based Experience"]
  node_app["JavaFX application<br/>[MainApp.java]"]
  node_adminui["Admin operations UI"]
  node_doctorui["Doctor portal"]
  node_patientui["Patient portal"]
end

subgraph group_operations["Clinical Operations"]
  node_appointments["Appointment services"]
  node_queue["Waiting queue<br/>[QueueService.java]"]
  node_reminders["Reminders &amp; outreach"]
  node_analytics["Analytics &amp; reporting"]
  node_settings["Facility settings"]
  node_domain["Clinical domain records"]
end

subgraph group_intelligence["Prediction &amp; Reallocation"]
  node_prediction["No-show prediction"]
  node_predictionservice["Prediction workflow"]
  node_reallocation["Reallocation approval"]
  node_matching["Candidate matching"]
end

subgraph group_persistence["Persistence &amp; Configuration"]
  node_repositories["Clinical repositories"]
  node_predictionrepo["Prediction repository"]
  node_database[("Supabase data backend")]
end

subgraph group_identity["Identity &amp; Notifications"]
  node_auth["Supabase authentication"]
  node_session["Session management"]
  node_notification["In-app notifications"]
end

node_users(("Hospital users"))

node_users -->|"use"| node_app
node_app -.->|"hosts"| node_adminui
node_users -->|"manage operations"| node_adminui
node_users -->|"use portal"| node_doctorui
node_users -->|"book appointments"| node_patientui
node_adminui -.->|"manage bookings"| node_appointments
node_doctorui -.->|"manage schedules"| node_appointments
node_patientui -.->|"request bookings"| node_appointments
node_appointments -->|"read and write"| node_repositories
node_appointments -->|"handle appointments"| node_domain
node_adminui -->|"review risk"| node_predictionservice
node_predictionservice -->|"load appointments"| node_appointments
node_predictionservice -->|"run inference"| node_prediction
node_predictionservice -->|"persist results"| node_predictionrepo
node_predictionrepo -.->|"store predictions"| node_database
node_adminui -->|"review suggestions"| node_reallocation
node_reallocation -->|"rank candidates"| node_matching
node_reallocation -->|"inspect slots"| node_appointments
node_reallocation -->|"update candidate status"| node_queue
node_reallocation -->|"record approval"| node_repositories
node_adminui -->|"manage standby pool"| node_queue
node_adminui -->|"coordinate outreach"| node_reminders
node_adminui -->|"review reports"| node_analytics
node_adminui -->|"configure facility"| node_settings
node_settings -.->|"set risk thresholds"| node_predictionservice
node_auth -->|"establish session"| node_session
node_adminui -.->|"authenticate"| node_auth
node_doctorui -.->|"authenticate"| node_auth
node_patientui -.->|"authenticate"| node_auth
node_doctorui -->|"receive updates"| node_notification
node_patientui -->|"receive updates"| node_notification

click node_app "https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/MainApp.java"
click node_adminui "https://github.com/ssathwick007-creator/ghostqueue/tree/main/src/main/java/com/ghostqueue/controller"
click node_doctorui "https://github.com/ssathwick007-creator/ghostqueue/tree/main/src/main/java/com/ghostqueue/controller/doctor"
click node_patientui "https://github.com/ssathwick007-creator/ghostqueue/tree/main/src/main/java/com/ghostqueue/controller/patient"
click node_appointments "https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/service/AppointmentService.java"
click node_queue "https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/service/QueueService.java"
click node_reminders "https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/service/ReminderService.java"
click node_analytics "https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/service/AnalyticsService.java"
click node_settings "https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/service/SettingsService.java"
click node_domain "https://github.com/ssathwick007-creator/ghostqueue/tree/main/src/main/java/com/ghostqueue/model"
click node_prediction "https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/prediction/PredictionEngine.java"
click node_predictionservice "https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/service/PredictionService.java"
click node_reallocation "https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/service/ReallocationService.java"
click node_matching "https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/scheduling/ReallocationEngine.java"
click node_repositories "https://github.com/ssathwick007-creator/ghostqueue/tree/main/src/main/java/com/ghostqueue/repository"
click node_predictionrepo "https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/prediction/PredictionRepository.java"
click node_database "https://github.com/ssathwick007-creator/ghostqueue/tree/main/src/main/java/com/ghostqueue/repository/supabase"
click node_auth "https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/supabase/SupabaseAuthService.java"
click node_session "https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/supabase/SessionManager.java"
click node_notification "https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/service/NotificationService.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_adminui,node_doctorui,node_patientui,node_users toneBlue
class node_appointments,node_queue,node_reminders,node_analytics,node_settings,node_domain toneAmber
class node_prediction,node_predictionservice,node_reallocation,node_matching toneMint
class node_repositories,node_predictionrepo,node_database toneRose
class node_auth,node_session,node_notification toneIndigo
```

## Components

### Role-Based Experience

- [JavaFX application](https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/MainApp.java): `src/main/java/com/ghostqueue/MainApp.java`
- [Admin operations UI](https://github.com/ssathwick007-creator/ghostqueue/tree/main/src/main/java/com/ghostqueue/controller): `src/main/java/com/ghostqueue/controller`
- [Doctor portal](https://github.com/ssathwick007-creator/ghostqueue/tree/main/src/main/java/com/ghostqueue/controller/doctor): `src/main/java/com/ghostqueue/controller/doctor`
- [Patient portal](https://github.com/ssathwick007-creator/ghostqueue/tree/main/src/main/java/com/ghostqueue/controller/patient): `src/main/java/com/ghostqueue/controller/patient`

### Clinical Operations

- [Appointment services](https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/service/AppointmentService.java): `src/main/java/com/ghostqueue/service/AppointmentService.java`
- [Waiting queue](https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/service/QueueService.java): `src/main/java/com/ghostqueue/service/QueueService.java`
- [Reminders & outreach](https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/service/ReminderService.java): `src/main/java/com/ghostqueue/service/ReminderService.java`
- [Analytics & reporting](https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/service/AnalyticsService.java): `src/main/java/com/ghostqueue/service/AnalyticsService.java`
- [Facility settings](https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/service/SettingsService.java): `src/main/java/com/ghostqueue/service/SettingsService.java`
- [Clinical domain records](https://github.com/ssathwick007-creator/ghostqueue/tree/main/src/main/java/com/ghostqueue/model): `src/main/java/com/ghostqueue/model`

### Prediction & Reallocation

- [No-show prediction](https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/prediction/PredictionEngine.java): `src/main/java/com/ghostqueue/prediction/PredictionEngine.java`
- [Prediction workflow](https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/service/PredictionService.java): `src/main/java/com/ghostqueue/service/PredictionService.java`
- [Reallocation approval](https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/service/ReallocationService.java): `src/main/java/com/ghostqueue/service/ReallocationService.java`
- [Candidate matching](https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/scheduling/ReallocationEngine.java): `src/main/java/com/ghostqueue/scheduling/ReallocationEngine.java`

### Persistence & Configuration

- [Clinical repositories](https://github.com/ssathwick007-creator/ghostqueue/tree/main/src/main/java/com/ghostqueue/repository): `src/main/java/com/ghostqueue/repository`
- [Prediction repository](https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/prediction/PredictionRepository.java): `src/main/java/com/ghostqueue/prediction/PredictionRepository.java`
- [Supabase data backend](https://github.com/ssathwick007-creator/ghostqueue/tree/main/src/main/java/com/ghostqueue/repository/supabase): `src/main/java/com/ghostqueue/repository/supabase`

### Identity & Notifications

- [Supabase authentication](https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/supabase/SupabaseAuthService.java): `src/main/java/com/ghostqueue/supabase/SupabaseAuthService.java`
- [Session management](https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/supabase/SessionManager.java): `src/main/java/com/ghostqueue/supabase/SessionManager.java`
- [In-app notifications](https://github.com/ssathwick007-creator/ghostqueue/blob/main/src/main/java/com/ghostqueue/service/NotificationService.java): `src/main/java/com/ghostqueue/service/NotificationService.java`

### Other components

- **Hospital users**

## Connections

- Hospital users → JavaFX application: use
- JavaFX application → Admin operations UI: hosts
- Hospital users → Admin operations UI: manage operations
- Hospital users → Doctor portal: use portal
- Hospital users → Patient portal: book appointments
- Admin operations UI → Appointment services: manage bookings (evidence: `src/main/java/com/ghostqueue/controller/AppointmentsController.java`)
- Doctor portal → Appointment services: manage schedules
- Patient portal → Appointment services: request bookings
- Appointment services → Clinical repositories: read and write (evidence: `src/main/java/com/ghostqueue/service/AppointmentService.java`)
- Appointment services → Clinical domain records: handle appointments (evidence: `src/main/java/com/ghostqueue/service/AppointmentService.java`)
- Admin operations UI → Prediction workflow: review risk (evidence: `src/main/java/com/ghostqueue/controller/PredictionController.java`)
- Prediction workflow → Appointment services: load appointments (evidence: `src/main/java/com/ghostqueue/service/PredictionService.java`)
- Prediction workflow → No-show prediction: run inference (evidence: `src/main/java/com/ghostqueue/service/PredictionService.java`)
- Prediction workflow → Prediction repository: persist results (evidence: `src/main/java/com/ghostqueue/service/PredictionService.java`)
- Prediction repository → Supabase data backend: store predictions
- Admin operations UI → Reallocation approval: review suggestions (evidence: `src/main/java/com/ghostqueue/controller/ReallocationController.java`)
- Reallocation approval → Candidate matching: rank candidates (evidence: `src/main/java/com/ghostqueue/service/ReallocationService.java`)
- Reallocation approval → Appointment services: inspect slots (evidence: `src/main/java/com/ghostqueue/service/ReallocationService.java`)
- Reallocation approval → Waiting queue: update candidate status (evidence: `src/main/java/com/ghostqueue/service/ReallocationService.java`)
- Reallocation approval → Clinical repositories: record approval (evidence: `src/main/java/com/ghostqueue/service/ReallocationService.java`)
- Admin operations UI → Waiting queue: manage standby pool
- Admin operations UI → Reminders & outreach: coordinate outreach
- Admin operations UI → Analytics & reporting: review reports
- Admin operations UI → Facility settings: configure facility
- Facility settings → Prediction workflow: set risk thresholds
- Supabase authentication → Session management: establish session (evidence: `src/main/java/com/ghostqueue/supabase/SupabaseAuthService.java`)
- Admin operations UI → Supabase authentication: authenticate
- Doctor portal → Supabase authentication: authenticate
- Patient portal → Supabase authentication: authenticate
- Doctor portal → In-app notifications: receive updates (evidence: `src/main/java/com/ghostqueue/controller/doctor/DoctorAppointmentsController.java`)
- Patient portal → In-app notifications: receive updates (evidence: `src/main/java/com/ghostqueue/controller/patient/PatientBookAppointmentController.java`)
