# rhems95/queuing-system architecture

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

- Interactive diagram: https://gitdiagram.com/rhems95/queuing-system
- Repository: https://github.com/rhems95/queuing-system

## Overview

PECIT Queuing System is a Laravel application for issuing and serving daily student queue tickets. The main flow is kiosk ticket creation (service, priority, Student ID, wait estimate, print), followed by staff call/recall/hold/complete actions and a public, anonymous display. Admins manage students and users and review tickets, service history, and reports. The graph includes documented capabilities whose controller implementations were not sampled; links involving those areas reflect the documented workflow, not inspected call sites.

Main entry points: [`app/Models/Queue.php`](https://github.com/rhems95/queuing-system/blob/main/app/Models/Queue.php) (Tickets), [`app/Http/Controllers/KioskController.php`](https://github.com/rhems95/queuing-system/blob/main/app/Http/Controllers/KioskController.php) (Kiosk ticket flow), [`app/Http/Controllers/WindowController.php`](https://github.com/rhems95/queuing-system/blob/main/app/Http/Controllers/WindowController.php) (Window actions), [`resources/views/admin/dashboard.blade.php`](https://github.com/rhems95/queuing-system/blob/main/resources/views/admin/dashboard.blade.php) (Admin screens)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ticketing["Ticketing"]
  node_kiosk["Kiosk ticket flow"]
  node_guard["Student ticket guard"]
  node_wait["Wait estimator"]
  node_kiosk_ui["Kiosk screens<br/>[index.blade.php]"]
  node_ticket_print["Ticket print views<br/>[printing.blade.php]"]
end

subgraph group_service_ops["Service Operations"]
  node_window_ops["Window actions"]
  node_scheduler["Fair queue scheduler"]
  node_queue_service["Queue service<br/>[QueueService.php]"]
  node_staff_window["Staff window<br/>[window.blade.php]"]
  node_staff_float["Staff float<br/>[float.blade.php]"]
  node_display_controller["Display data"]
  node_display_ui["Public display<br/>[index.blade.php]"]
end

subgraph group_admin["Administration"]
  node_admin_dashboard["Live dashboard"]
  node_users_admin["User management"]
  node_students_admin["Student management"]
  node_history_admin["History and reports"]
  node_admin_views["Admin screens"]
end

subgraph group_identity["Access Control"]
  node_login["Login"]
  node_auth_middleware["Role access checks"]
end

subgraph group_persistence["Queue Data"]
  node_queues[("Tickets<br/>[Queue.php]")]
  node_queue_calls[("Call records<br/>[QueueCall.php]")]
  node_students[("Student register<br/>[Student.php]")]
  node_services_windows[("Services and windows<br/>[Service.php]")]
  node_users[("User records<br/>[User.php]")]
end

node_customer(("Customer"))
node_staff_user(("Staff"))
node_admin_user(("Administrator"))
node_lobby(("Lobby viewers"))

node_customer -->|"requests ticket"| node_kiosk_ui
node_kiosk_ui -->|"submits details"| node_kiosk
node_kiosk -->|"checks open ticket"| node_guard
node_kiosk -->|"estimates wait"| node_wait
node_kiosk -->|"creates ticket"| node_queues
node_kiosk -->|"looks up ID"| node_students
node_kiosk -->|"loads services"| node_services_windows
node_kiosk -->|"renders ticket"| node_ticket_print
node_ticket_print -->|"prints number"| node_customer
node_guard -->|"checks daily tickets"| node_queues
node_wait -->|"reads waiting tickets"| node_queues
node_wait -->|"reads service history"| node_queue_calls
node_staff_user -->|"signs in"| node_login
node_login -->|"checks credentials"| node_users
node_login -->|"routes staff"| node_staff_window
node_login -->|"routes float login"| node_staff_float
node_staff_user -->|"operates window"| node_staff_window
node_staff_user -->|"operates float"| node_staff_float
node_staff_window -->|"submits actions"| node_window_ops
node_staff_float -->|"submits actions"| node_window_ops
node_window_ops -->|"selects next ticket"| node_scheduler
node_window_ops -->|"resolves current call"| node_queue_service
node_window_ops -->|"updates ticket status"| node_queues
node_window_ops -->|"records calls"| node_queue_calls
node_window_ops -->|"locks service queue"| node_services_windows
node_scheduler -->|"orders waiting tickets"| node_queues
node_queue_service -->|"reads window calls"| node_queue_calls
node_queue_service -->|"resolves serving ticket"| node_queues
node_queue_service -->|"looks up student name"| node_students
node_lobby -->|"views queue"| node_display_ui
node_display_ui -->|"requests display data"| node_display_controller
node_display_controller -->|"reads waiting tickets"| node_queues
node_display_controller -->|"reads current calls"| node_queue_calls
node_display_controller -->|"groups by window"| node_services_windows
node_admin_user -->|"signs in"| node_login
node_admin_user -->|"uses admin tools"| node_admin_views
node_admin_views -->|"requests dashboard"| node_admin_dashboard
node_admin_views -->|"manages users"| node_users_admin
node_admin_views -->|"manages students"| node_students_admin
node_admin_views -->|"reviews records"| node_history_admin
node_admin_dashboard -->|"summarizes tickets"| node_queues
node_users_admin -->|"reads and writes"| node_users
node_users_admin -->|"assigns windows"| node_services_windows
node_students_admin -->|"imports and manages"| node_students
node_students_admin -->|"checks before delete"| node_guard
node_history_admin -->|"reads and edits"| node_queue_calls
node_history_admin -->|"reports tickets"| node_queues
node_history_admin -->|"groups reports"| node_services_windows

click node_kiosk "https://github.com/rhems95/queuing-system/blob/main/app/Http/Controllers/KioskController.php"
click node_guard "https://github.com/rhems95/queuing-system/blob/main/app/Services/StudentQueueGuard.php"
click node_wait "https://github.com/rhems95/queuing-system/blob/main/app/Services/WaitTimeEstimator.php"
click node_kiosk_ui "https://github.com/rhems95/queuing-system/blob/main/resources/views/kiosk/index.blade.php"
click node_ticket_print "https://github.com/rhems95/queuing-system/blob/main/resources/views/kiosk/printing.blade.php"
click node_window_ops "https://github.com/rhems95/queuing-system/blob/main/app/Http/Controllers/WindowController.php"
click node_scheduler "https://github.com/rhems95/queuing-system/blob/main/app/Services/FairQueueScheduler.php"
click node_queue_service "https://github.com/rhems95/queuing-system/blob/main/app/Services/QueueService.php"
click node_staff_window "https://github.com/rhems95/queuing-system/blob/main/resources/views/staff/window.blade.php"
click node_staff_float "https://github.com/rhems95/queuing-system/blob/main/resources/views/staff/float.blade.php"
click node_display_controller "https://github.com/rhems95/queuing-system/blob/main/app/Http/Controllers/DisplayController.php"
click node_display_ui "https://github.com/rhems95/queuing-system/blob/main/resources/views/display/index.blade.php"
click node_admin_dashboard "https://github.com/rhems95/queuing-system/blob/main/app/Http/Controllers/AdminDashboardController.php"
click node_users_admin "https://github.com/rhems95/queuing-system/blob/main/app/Http/Controllers/UserManagementController.php"
click node_students_admin "https://github.com/rhems95/queuing-system/blob/main/app/Http/Controllers/StudentManagementController.php"
click node_history_admin "https://github.com/rhems95/queuing-system/blob/main/app/Http/Controllers/HistoryController.php"
click node_admin_views "https://github.com/rhems95/queuing-system/blob/main/resources/views/admin/dashboard.blade.php"
click node_login "https://github.com/rhems95/queuing-system/blob/main/app/Http/Controllers/Auth/LoginController.php"
click node_auth_middleware "https://github.com/rhems95/queuing-system/blob/main/app/Http/Middleware/EnsureUserIsStaff.php"
click node_queues "https://github.com/rhems95/queuing-system/blob/main/app/Models/Queue.php"
click node_queue_calls "https://github.com/rhems95/queuing-system/blob/main/app/Models/QueueCall.php"
click node_students "https://github.com/rhems95/queuing-system/blob/main/app/Models/Student.php"
click node_services_windows "https://github.com/rhems95/queuing-system/blob/main/app/Models/Service.php"
click node_users "https://github.com/rhems95/queuing-system/blob/main/app/Models/User.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_kiosk,node_guard,node_wait,node_kiosk_ui,node_ticket_print,node_lobby toneBlue
class node_window_ops,node_scheduler,node_queue_service,node_staff_window,node_staff_float,node_display_controller,node_display_ui toneAmber
class node_admin_dashboard,node_users_admin,node_students_admin,node_history_admin,node_admin_views toneMint
class node_login,node_auth_middleware toneRose
class node_queues,node_queue_calls,node_students,node_services_windows,node_users,node_customer,node_staff_user,node_admin_user toneIndigo
```

## Components

### Ticketing

- [Kiosk ticket flow](https://github.com/rhems95/queuing-system/blob/main/app/Http/Controllers/KioskController.php): `app/Http/Controllers/KioskController.php`
- [Student ticket guard](https://github.com/rhems95/queuing-system/blob/main/app/Services/StudentQueueGuard.php): `app/Services/StudentQueueGuard.php`
- [Wait estimator](https://github.com/rhems95/queuing-system/blob/main/app/Services/WaitTimeEstimator.php): `app/Services/WaitTimeEstimator.php`
- [Kiosk screens](https://github.com/rhems95/queuing-system/blob/main/resources/views/kiosk/index.blade.php): `resources/views/kiosk/index.blade.php`
- [Ticket print views](https://github.com/rhems95/queuing-system/blob/main/resources/views/kiosk/printing.blade.php): `resources/views/kiosk/printing.blade.php`

### Service Operations

- [Window actions](https://github.com/rhems95/queuing-system/blob/main/app/Http/Controllers/WindowController.php): `app/Http/Controllers/WindowController.php`
- [Fair queue scheduler](https://github.com/rhems95/queuing-system/blob/main/app/Services/FairQueueScheduler.php): `app/Services/FairQueueScheduler.php`
- [Queue service](https://github.com/rhems95/queuing-system/blob/main/app/Services/QueueService.php): `app/Services/QueueService.php`
- [Staff window](https://github.com/rhems95/queuing-system/blob/main/resources/views/staff/window.blade.php): `resources/views/staff/window.blade.php`
- [Staff float](https://github.com/rhems95/queuing-system/blob/main/resources/views/staff/float.blade.php): `resources/views/staff/float.blade.php`
- [Display data](https://github.com/rhems95/queuing-system/blob/main/app/Http/Controllers/DisplayController.php): `app/Http/Controllers/DisplayController.php`
- [Public display](https://github.com/rhems95/queuing-system/blob/main/resources/views/display/index.blade.php): `resources/views/display/index.blade.php`

### Administration

- [Live dashboard](https://github.com/rhems95/queuing-system/blob/main/app/Http/Controllers/AdminDashboardController.php): `app/Http/Controllers/AdminDashboardController.php`
- [User management](https://github.com/rhems95/queuing-system/blob/main/app/Http/Controllers/UserManagementController.php): `app/Http/Controllers/UserManagementController.php`
- [Student management](https://github.com/rhems95/queuing-system/blob/main/app/Http/Controllers/StudentManagementController.php): `app/Http/Controllers/StudentManagementController.php`
- [History and reports](https://github.com/rhems95/queuing-system/blob/main/app/Http/Controllers/HistoryController.php): `app/Http/Controllers/HistoryController.php`
- [Admin screens](https://github.com/rhems95/queuing-system/blob/main/resources/views/admin/dashboard.blade.php): `resources/views/admin/dashboard.blade.php`

### Access Control

- [Login](https://github.com/rhems95/queuing-system/blob/main/app/Http/Controllers/Auth/LoginController.php): `app/Http/Controllers/Auth/LoginController.php`
- [Role access checks](https://github.com/rhems95/queuing-system/blob/main/app/Http/Middleware/EnsureUserIsStaff.php): `app/Http/Middleware/EnsureUserIsStaff.php`

### Queue Data

- [Tickets](https://github.com/rhems95/queuing-system/blob/main/app/Models/Queue.php): `app/Models/Queue.php`
- [Call records](https://github.com/rhems95/queuing-system/blob/main/app/Models/QueueCall.php): `app/Models/QueueCall.php`
- [Student register](https://github.com/rhems95/queuing-system/blob/main/app/Models/Student.php): `app/Models/Student.php`
- [Services and windows](https://github.com/rhems95/queuing-system/blob/main/app/Models/Service.php): `app/Models/Service.php`
- [User records](https://github.com/rhems95/queuing-system/blob/main/app/Models/User.php): `app/Models/User.php`

### Other components

- **Customer**
- **Staff**
- **Administrator**
- **Lobby viewers**

## Connections

- Customer → Kiosk screens: requests ticket
- Kiosk screens → Kiosk ticket flow: submits details
- Kiosk ticket flow → Student ticket guard: checks open ticket
- Kiosk ticket flow → Wait estimator: estimates wait
- Kiosk ticket flow → Tickets: creates ticket
- Kiosk ticket flow → Student register: looks up ID
- Kiosk ticket flow → Services and windows: loads services
- Kiosk ticket flow → Ticket print views: renders ticket
- Ticket print views → Customer: prints number
- Student ticket guard → Tickets: checks daily tickets
- Wait estimator → Tickets: reads waiting tickets
- Wait estimator → Call records: reads service history
- Staff → Login: signs in
- Login → User records: checks credentials
- Login → Staff window: routes staff
- Login → Staff float: routes float login
- Staff → Staff window: operates window
- Staff → Staff float: operates float
- Staff window → Window actions: submits actions
- Staff float → Window actions: submits actions
- Window actions → Fair queue scheduler: selects next ticket
- Window actions → Queue service: resolves current call
- Window actions → Tickets: updates ticket status
- Window actions → Call records: records calls
- Window actions → Services and windows: locks service queue
- Fair queue scheduler → Tickets: orders waiting tickets
- Queue service → Call records: reads window calls
- Queue service → Tickets: resolves serving ticket
- Queue service → Student register: looks up student name
- Lobby viewers → Public display: views queue
- Public display → Display data: requests display data
- Display data → Tickets: reads waiting tickets
- Display data → Call records: reads current calls
- Display data → Services and windows: groups by window
- Administrator → Login: signs in
- Administrator → Admin screens: uses admin tools
- Admin screens → Live dashboard: requests dashboard
- Admin screens → User management: manages users
- Admin screens → Student management: manages students
- Admin screens → History and reports: reviews records
- Live dashboard → Tickets: summarizes tickets
- User management → User records: reads and writes
- User management → Services and windows: assigns windows
- Student management → Student register: imports and manages
- Student management → Student ticket guard: checks before delete
- History and reports → Call records: reads and edits
- History and reports → Tickets: reports tickets
- History and reports → Services and windows: groups reports
