# glitter1105/queue architecture

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

- Interactive diagram: https://gitdiagram.com/glitter1105/queue
- Repository: https://github.com/glitter1105/queue

## Overview

This is a Webman-based queue ticketing and service-window system. Customers obtain and check tickets; staff call, complete, pass, or cancel them; window configuration and a public display support the service flow. Queue state is modeled separately from window state, while GatewayWorker delivers live updates to display and staff clients. The README documents the main pages and MySQL/Redis stack; sampled controller excerpts show queue operations and Gateway sends. Frontend source is absent from the supplied tree, so UI internals and storage wiring are not mapped.

Main entry points: [`config/route.php`](https://github.com/glitter1105/queue/blob/main/config/route.php) (HTTP routes), [`app/controller/QueueController.php`](https://github.com/glitter1105/queue/blob/main/app/controller/QueueController.php) (Ticket and status), [`app/controller/WindowController.php`](https://github.com/glitter1105/queue/blob/main/app/controller/WindowController.php) (Window management), [`app/model/QueueNumber.php`](https://github.com/glitter1105/queue/blob/main/app/model/QueueNumber.php) (Queue records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_queue_ops["Queue operations"]
  node_ticket_flow["Ticket and status"]
  node_queue_record[("Queue records<br/>[QueueNumber.php]")]
end

subgraph group_windows["Service windows"]
  node_window_admin["Window management"]
  node_window_record[("Window records<br/>[Window.php]")]
end

subgraph group_realtime["Live updates"]
  node_websocket["WebSocket binding<br/>[Events.php]"]
  node_gateway_worker["GatewayWorker"]
end

subgraph group_http["HTTP handling"]
  node_http_routes["HTTP routes<br/>[route.php]"]
  node_http_request["Request handling<br/>[Request.php]"]
  node_http_response["Response handling<br/>[Response.php]"]
end

node_customer(("Customer"))
node_staff(("Staff"))
node_public_viewer(("Public viewer"))

node_customer -->|"requests tickets"| node_http_routes
node_staff -->|"manages queue"| node_http_routes
node_public_viewer -->|"opens display"| node_http_routes
node_http_routes -->|"routes requests"| node_ticket_flow
node_http_routes -->|"routes requests"| node_window_admin
node_ticket_flow -->|"queries and updates"| node_queue_record
node_window_admin -->|"manages windows"| node_window_record
node_window_admin -->|"checks active tickets"| node_queue_record
node_ticket_flow -->|"validates window"| node_window_record
node_ticket_flow -->|"sends updates"| node_gateway_worker
node_websocket -->|"binds client IDs"| node_gateway_worker
node_gateway_worker -.->|"pushes live status"| node_public_viewer
node_gateway_worker -.->|"pushes live status"| node_staff
node_http_routes -.->|"uses request type"| node_http_request
node_ticket_flow -->|"returns responses"| node_http_response
node_window_admin -->|"returns responses"| node_http_response

click node_ticket_flow "https://github.com/glitter1105/queue/blob/main/app/controller/QueueController.php"
click node_queue_record "https://github.com/glitter1105/queue/blob/main/app/model/QueueNumber.php"
click node_window_admin "https://github.com/glitter1105/queue/blob/main/app/controller/WindowController.php"
click node_window_record "https://github.com/glitter1105/queue/blob/main/app/model/Window.php"
click node_websocket "https://github.com/glitter1105/queue/blob/main/plugin/webman/gateway/Events.php"
click node_http_routes "https://github.com/glitter1105/queue/blob/main/config/route.php"
click node_http_request "https://github.com/glitter1105/queue/blob/main/support/Request.php"
click node_http_response "https://github.com/glitter1105/queue/blob/main/support/Response.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_ticket_flow,node_queue_record,node_public_viewer toneBlue
class node_window_admin,node_window_record toneAmber
class node_websocket,node_gateway_worker toneMint
class node_http_routes,node_http_request,node_http_response toneRose
class node_customer,node_staff toneIndigo
```

## Components

### Queue operations

- [Ticket and status](https://github.com/glitter1105/queue/blob/main/app/controller/QueueController.php): `app/controller/QueueController.php`
- [Queue records](https://github.com/glitter1105/queue/blob/main/app/model/QueueNumber.php): `app/model/QueueNumber.php`

### Service windows

- [Window management](https://github.com/glitter1105/queue/blob/main/app/controller/WindowController.php): `app/controller/WindowController.php`
- [Window records](https://github.com/glitter1105/queue/blob/main/app/model/Window.php): `app/model/Window.php`

### Live updates

- [WebSocket binding](https://github.com/glitter1105/queue/blob/main/plugin/webman/gateway/Events.php): `plugin/webman/gateway/Events.php`
- **GatewayWorker**

### HTTP handling

- [HTTP routes](https://github.com/glitter1105/queue/blob/main/config/route.php): `config/route.php`
- [Request handling](https://github.com/glitter1105/queue/blob/main/support/Request.php): `support/Request.php`
- [Response handling](https://github.com/glitter1105/queue/blob/main/support/Response.php): `support/Response.php`

### Other components

- **Customer**
- **Staff**
- **Public viewer**

## Connections

- Customer → HTTP routes: requests tickets (evidence: `README.md`)
- Staff → HTTP routes: manages queue (evidence: `README.md`)
- Public viewer → HTTP routes: opens display (evidence: `README.md`)
- HTTP routes → Ticket and status: routes requests (evidence: `config/route.php`)
- HTTP routes → Window management: routes requests (evidence: `config/route.php`)
- Ticket and status → Queue records: queries and updates (evidence: `app/controller/QueueController.php`)
- Window management → Window records: manages windows (evidence: `app/controller/WindowController.php`)
- Window management → Queue records: checks active tickets (evidence: `app/controller/WindowController.php`)
- Ticket and status → Window records: validates window (evidence: `app/controller/QueueController.php`)
- Ticket and status → GatewayWorker: sends updates (evidence: `app/controller/QueueController.php`)
- WebSocket binding → GatewayWorker: binds client IDs (evidence: `plugin/webman/gateway/Events.php`)
- GatewayWorker → Public viewer: pushes live status (evidence: `README.md`)
- GatewayWorker → Staff: pushes live status (evidence: `README.md`)
- HTTP routes → Request handling: uses request type
- Ticket and status → Response handling: returns responses (evidence: `app/controller/QueueController.php`)
- Window management → Response handling: returns responses (evidence: `app/controller/WindowController.php`)
