# whynic/satset architecture

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

- Interactive diagram: https://gitdiagram.com/whynic/satset
- Repository: https://github.com/whynic/satset

## Overview

SatSet is a Laravel virtual-queue web app for restaurants and food festivals. Customers browse restaurants, inspect wait estimates, optionally view same-category alternatives, create a ticket, track its public-token status, and may cancel; browser push subscriptions enable turn and cancellation alerts. Admins authenticate, manage restaurants, monitor queue metrics, and call, complete, skip, cancel, or reset tickets. QueueService owns ticket sequencing, status transitions, wait estimates, and recommendations; push delivery is a distinct supporting capability. README and sampled controllers support the main flows; unsampled view and polling wiring is documented rather than inferred from source.

Main entry points: [`routes/web.php`](https://github.com/whynic/satset/blob/main/routes/web.php) (Web routes), [`app/Services/QueueService.php`](https://github.com/whynic/satset/blob/main/app/Services/QueueService.php) (Queue rules), [`app/Services/QueuePushNotificationService.php`](https://github.com/whynic/satset/blob/main/app/Services/QueuePushNotificationService.php) (Push orchestration), [`app/Models/QueueTicket.php`](https://github.com/whynic/satset/blob/main/app/Models/QueueTicket.php) (Queue tickets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer experience"]
  node_home["Restaurant discovery<br/>[HomeController.php]"]
  node_restaurant_pages["Restaurant pages"]
  node_recommendations["Alternative recommendations<br/>[QueueService.php]"]
  node_queue_entry["Ticket creation"]
  node_ticket_status["Ticket status and cancel"]
  node_polling["Active queue polling<br/>[queue-poll.js]"]
  node_subscription_ui["Push subscription browser"]
  node_service_worker["Push event handler<br/>[sw.js]"]
end

subgraph group_admin["Admin operations"]
  node_restaurant_admin["Restaurant administration"]
  node_dashboard["Queue dashboard"]
  node_admin_queue["Queue management"]
  node_queue_overview["Queue overview"]
  node_admin_auth["Admin authentication"]
end

subgraph group_queue["Queue domain"]
  node_queue_service["Queue rules<br/>[QueueService.php]"]
  node_ticket_model[("Queue tickets<br/>[QueueTicket.php]")]
  node_restaurant_model[("Restaurant records<br/>[Restaurant.php]")]
  node_user_model[("Admin users<br/>[User.php]")]
end

subgraph group_push["Push notifications"]
  node_push_service["Push orchestration"]
  node_called_notice["Called notification"]
  node_almost_notice["Almost-turn notification"]
  node_cancelled_notice["Cancellation notification"]
end

node_customer_actor(("Customer"))
node_admin_actor(("Administrator"))
node_routes["Web routes<br/>[web.php]"]
node_push_service_external(("Web Push service"))

node_customer_actor -->|"opens routes"| node_routes
node_admin_actor -->|"uses admin routes"| node_routes
node_routes -->|"routes home"| node_home
node_routes -->|"routes restaurant pages"| node_restaurant_pages
node_routes -->|"routes ticket actions"| node_queue_entry
node_routes -->|"routes ticket status"| node_ticket_status
node_routes -->|"routes admin login"| node_admin_auth
node_routes -->|"routes dashboard"| node_dashboard
node_routes -->|"routes queue controls"| node_admin_queue
node_routes -->|"routes queue overview"| node_queue_overview
node_routes -->|"routes restaurant admin"| node_restaurant_admin
node_home -->|"gets queue snapshot"| node_queue_service
node_restaurant_pages -->|"uses queue estimates"| node_queue_service
node_customer_actor -->|"views alternatives"| node_recommendations
node_queue_entry -->|"creates ticket"| node_queue_service
node_queue_entry -->|"redirects if crowded"| node_recommendations
node_queue_service -->|"creates and updates"| node_ticket_model
node_queue_service -->|"reads restaurant data"| node_restaurant_model
node_ticket_status -->|"gets status and cancels"| node_queue_service
node_ticket_status -->|"notifies cancellation"| node_push_service
node_ticket_status -->|"loads ticket"| node_ticket_model
node_customer_actor -->|"refreshes status"| node_polling
node_polling -->|"requests status"| node_ticket_status
node_customer_actor -->|"enables notifications"| node_subscription_ui
node_subscription_ui -->|"registers worker"| node_service_worker
node_subscription_ui -->|"submits subscription"| node_routes
node_service_worker -->|"opens ticket on click"| node_customer_actor
node_restaurant_admin -->|"creates and updates"| node_restaurant_model
node_dashboard -->|"gets queue snapshots"| node_queue_service
node_dashboard -->|"reads restaurants"| node_restaurant_model
node_dashboard -->|"reads queue metrics"| node_ticket_model
node_admin_queue -->|"runs queue actions"| node_queue_service
node_admin_queue -->|"triggers alerts"| node_push_service
node_admin_queue -->|"reads active tickets"| node_ticket_model
node_admin_queue -->|"reads restaurant queue"| node_restaurant_model
node_queue_overview -->|"reads queue tickets"| node_ticket_model
node_admin_auth -.->|"authenticates admin"| node_user_model
node_admin_queue -->|"updates waiting alerts"| node_push_service
node_push_service -->|"calculates positions"| node_queue_service
node_push_service -->|"sends to subscribers"| node_ticket_model
node_push_service -->|"creates alert"| node_called_notice
node_push_service -->|"creates alert"| node_almost_notice
node_push_service -->|"creates alert"| node_cancelled_notice
node_ticket_model -.->|"delivers web push"| node_push_service_external

click node_routes "https://github.com/whynic/satset/blob/main/routes/web.php"
click node_home "https://github.com/whynic/satset/blob/main/app/Http/Controllers/HomeController.php"
click node_restaurant_pages "https://github.com/whynic/satset/blob/main/app/Http/Controllers/RestaurantController.php"
click node_recommendations "https://github.com/whynic/satset/blob/main/app/Services/QueueService.php"
click node_queue_entry "https://github.com/whynic/satset/blob/main/app/Http/Controllers/QueueController.php"
click node_ticket_status "https://github.com/whynic/satset/blob/main/app/Http/Controllers/QueueController.php"
click node_polling "https://github.com/whynic/satset/blob/main/public/js/queue-poll.js"
click node_subscription_ui "https://github.com/whynic/satset/blob/main/public/js/push-subscription.js"
click node_service_worker "https://github.com/whynic/satset/blob/main/public/sw.js"
click node_restaurant_admin "https://github.com/whynic/satset/blob/main/app/Http/Controllers/Admin/AdminRestaurantController.php"
click node_dashboard "https://github.com/whynic/satset/blob/main/app/Http/Controllers/Admin/AdminDashboardController.php"
click node_admin_queue "https://github.com/whynic/satset/blob/main/app/Http/Controllers/Admin/AdminQueueController.php"
click node_queue_overview "https://github.com/whynic/satset/blob/main/app/Http/Controllers/Admin/AdminQueueOverviewController.php"
click node_admin_auth "https://github.com/whynic/satset/blob/main/app/Http/Controllers/Admin/AdminAuthController.php"
click node_queue_service "https://github.com/whynic/satset/blob/main/app/Services/QueueService.php"
click node_ticket_model "https://github.com/whynic/satset/blob/main/app/Models/QueueTicket.php"
click node_restaurant_model "https://github.com/whynic/satset/blob/main/app/Models/Restaurant.php"
click node_user_model "https://github.com/whynic/satset/blob/main/app/Models/User.php"
click node_push_service "https://github.com/whynic/satset/blob/main/app/Services/QueuePushNotificationService.php"
click node_called_notice "https://github.com/whynic/satset/blob/main/app/Notifications/QueueCalledNotification.php"
click node_almost_notice "https://github.com/whynic/satset/blob/main/app/Notifications/QueueAlmostTurnNotification.php"
click node_cancelled_notice "https://github.com/whynic/satset/blob/main/app/Notifications/QueueCancelledNotification.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_home,node_restaurant_pages,node_recommendations,node_queue_entry,node_ticket_status,node_polling,node_subscription_ui,node_service_worker toneBlue
class node_restaurant_admin,node_dashboard,node_admin_queue,node_queue_overview,node_admin_auth toneAmber
class node_queue_service,node_ticket_model,node_restaurant_model,node_user_model,node_routes toneMint
class node_push_service,node_called_notice,node_almost_notice,node_cancelled_notice toneRose
class node_customer_actor,node_admin_actor,node_push_service_external toneIndigo
```

## Components

### Customer experience

- [Restaurant discovery](https://github.com/whynic/satset/blob/main/app/Http/Controllers/HomeController.php): `app/Http/Controllers/HomeController.php`
- [Restaurant pages](https://github.com/whynic/satset/blob/main/app/Http/Controllers/RestaurantController.php): `app/Http/Controllers/RestaurantController.php`
- [Alternative recommendations](https://github.com/whynic/satset/blob/main/app/Services/QueueService.php): `app/Services/QueueService.php`
- [Ticket creation](https://github.com/whynic/satset/blob/main/app/Http/Controllers/QueueController.php): `app/Http/Controllers/QueueController.php`
- [Ticket status and cancel](https://github.com/whynic/satset/blob/main/app/Http/Controllers/QueueController.php): `app/Http/Controllers/QueueController.php`
- [Active queue polling](https://github.com/whynic/satset/blob/main/public/js/queue-poll.js): `public/js/queue-poll.js`
- [Push subscription browser](https://github.com/whynic/satset/blob/main/public/js/push-subscription.js): `public/js/push-subscription.js`
- [Push event handler](https://github.com/whynic/satset/blob/main/public/sw.js): `public/sw.js`

### Admin operations

- [Restaurant administration](https://github.com/whynic/satset/blob/main/app/Http/Controllers/Admin/AdminRestaurantController.php): `app/Http/Controllers/Admin/AdminRestaurantController.php`
- [Queue dashboard](https://github.com/whynic/satset/blob/main/app/Http/Controllers/Admin/AdminDashboardController.php): `app/Http/Controllers/Admin/AdminDashboardController.php`
- [Queue management](https://github.com/whynic/satset/blob/main/app/Http/Controllers/Admin/AdminQueueController.php): `app/Http/Controllers/Admin/AdminQueueController.php`
- [Queue overview](https://github.com/whynic/satset/blob/main/app/Http/Controllers/Admin/AdminQueueOverviewController.php): `app/Http/Controllers/Admin/AdminQueueOverviewController.php`
- [Admin authentication](https://github.com/whynic/satset/blob/main/app/Http/Controllers/Admin/AdminAuthController.php): `app/Http/Controllers/Admin/AdminAuthController.php`

### Queue domain

- [Queue rules](https://github.com/whynic/satset/blob/main/app/Services/QueueService.php): `app/Services/QueueService.php`
- [Queue tickets](https://github.com/whynic/satset/blob/main/app/Models/QueueTicket.php): `app/Models/QueueTicket.php`
- [Restaurant records](https://github.com/whynic/satset/blob/main/app/Models/Restaurant.php): `app/Models/Restaurant.php`
- [Admin users](https://github.com/whynic/satset/blob/main/app/Models/User.php): `app/Models/User.php`

### Push notifications

- [Push orchestration](https://github.com/whynic/satset/blob/main/app/Services/QueuePushNotificationService.php): `app/Services/QueuePushNotificationService.php`
- [Called notification](https://github.com/whynic/satset/blob/main/app/Notifications/QueueCalledNotification.php): `app/Notifications/QueueCalledNotification.php`
- [Almost-turn notification](https://github.com/whynic/satset/blob/main/app/Notifications/QueueAlmostTurnNotification.php): `app/Notifications/QueueAlmostTurnNotification.php`
- [Cancellation notification](https://github.com/whynic/satset/blob/main/app/Notifications/QueueCancelledNotification.php): `app/Notifications/QueueCancelledNotification.php`

### Other components

- **Customer**
- **Administrator**
- [Web routes](https://github.com/whynic/satset/blob/main/routes/web.php): `routes/web.php`
- **Web Push service**

## Connections

- Customer → Web routes: opens routes (evidence: `README.md`)
- Administrator → Web routes: uses admin routes (evidence: `README.md`)
- Web routes → Restaurant discovery: routes home (evidence: `routes/web.php`)
- Web routes → Restaurant pages: routes restaurant pages (evidence: `routes/web.php`)
- Web routes → Ticket creation: routes ticket actions (evidence: `routes/web.php`)
- Web routes → Ticket status and cancel: routes ticket status (evidence: `routes/web.php`)
- Web routes → Admin authentication: routes admin login (evidence: `routes/web.php`)
- Web routes → Queue dashboard: routes dashboard (evidence: `routes/web.php`)
- Web routes → Queue management: routes queue controls (evidence: `routes/web.php`)
- Web routes → Queue overview: routes queue overview (evidence: `routes/web.php`)
- Web routes → Restaurant administration: routes restaurant admin (evidence: `routes/web.php`)
- Restaurant discovery → Queue rules: gets queue snapshot (evidence: `app/Http/Controllers/HomeController.php`)
- Restaurant pages → Queue rules: uses queue estimates (evidence: `app/Http/Controllers/RestaurantController.php`)
- Customer → Alternative recommendations: views alternatives (evidence: `README.md`)
- Ticket creation → Queue rules: creates ticket (evidence: `app/Http/Controllers/QueueController.php`)
- Ticket creation → Alternative recommendations: redirects if crowded (evidence: `app/Http/Controllers/QueueController.php`)
- Queue rules → Queue tickets: creates and updates (evidence: `app/Services/QueueService.php`)
- Queue rules → Restaurant records: reads restaurant data (evidence: `app/Services/QueueService.php`)
- Ticket status and cancel → Queue rules: gets status and cancels (evidence: `app/Http/Controllers/QueueController.php`)
- Ticket status and cancel → Push orchestration: notifies cancellation (evidence: `app/Http/Controllers/QueueController.php`)
- Ticket status and cancel → Queue tickets: loads ticket (evidence: `app/Http/Controllers/QueueController.php`)
- Customer → Active queue polling: refreshes status (evidence: `README.md`)
- Active queue polling → Ticket status and cancel: requests status (evidence: `README.md`)
- Customer → Push subscription browser: enables notifications (evidence: `README.md`)
- Push subscription browser → Push event handler: registers worker (evidence: `README.md`)
- Push subscription browser → Web routes: submits subscription (evidence: `README.md`)
- Push event handler → Customer: opens ticket on click (evidence: `README.md`)
- Restaurant administration → Restaurant records: creates and updates (evidence: `app/Http/Controllers/Admin/AdminRestaurantController.php`)
- Queue dashboard → Queue rules: gets queue snapshots (evidence: `app/Http/Controllers/Admin/AdminDashboardController.php`)
- Queue dashboard → Restaurant records: reads restaurants (evidence: `app/Http/Controllers/Admin/AdminDashboardController.php`)
- Queue dashboard → Queue tickets: reads queue metrics (evidence: `app/Http/Controllers/Admin/AdminDashboardController.php`)
- Queue management → Queue rules: runs queue actions (evidence: `app/Http/Controllers/Admin/AdminQueueController.php`)
- Queue management → Push orchestration: triggers alerts (evidence: `app/Http/Controllers/Admin/AdminQueueController.php`)
- Queue management → Queue tickets: reads active tickets (evidence: `app/Http/Controllers/Admin/AdminQueueController.php`)
- Queue management → Restaurant records: reads restaurant queue (evidence: `app/Http/Controllers/Admin/AdminQueueController.php`)
- Queue overview → Queue tickets: reads queue tickets (evidence: `app/Http/Controllers/Admin/AdminQueueOverviewController.php`)
- Admin authentication → Admin users: authenticates admin
- Queue management → Push orchestration: updates waiting alerts (evidence: `app/Http/Controllers/Admin/AdminQueueController.php`)
- Push orchestration → Queue rules: calculates positions (evidence: `app/Services/QueuePushNotificationService.php`)
- Push orchestration → Queue tickets: sends to subscribers (evidence: `app/Services/QueuePushNotificationService.php`)
- Push orchestration → Called notification: creates alert (evidence: `app/Services/QueuePushNotificationService.php`)
- Push orchestration → Almost-turn notification: creates alert (evidence: `app/Services/QueuePushNotificationService.php`)
- Push orchestration → Cancellation notification: creates alert (evidence: `app/Services/QueuePushNotificationService.php`)
- Queue tickets → Web Push service: delivers web push
