# borgolov/webqueue2 architecture

> Architecture diagram of the GitHub repository borgolov/webqueue2, 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/borgolov/webqueue2
- Repository: https://github.com/borgolov/webqueue2

## Overview

This appears to be a Flask-based service-ticket and queue application with browser clients for terminals, staff, and public displays. The main user journey is selecting a service at a terminal, managing the resulting ticket through staff workflows, and announcing calls on a display; the sampled terminal and display clients show API and Socket.IO interactions, but the server-side event wiring was not sampled. The graph also preserves authentication, administration, API testing, and chat capabilities visible in the tree. Links to unsampled server subsystems are omitted where their wiring cannot be established.

Main entry points: [`app/static/terminal_hybrid/js/terminalapp.js`](https://github.com/borgolov/webqueue2/blob/master/app/static/terminal_hybrid/js/terminalapp.js) (Service Terminal), [`app/api/resources.py`](https://github.com/borgolov/webqueue2/blob/master/app/api/resources.py) (API Resources), [`app/frontend/views.py`](https://github.com/borgolov/webqueue2/blob/master/app/frontend/views.py) (Frontend Routes), [`instance/sqlite3.db`](https://github.com/borgolov/webqueue2/blob/master/instance/sqlite3.db) (SQLite Database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Queue Clients"]
  node_terminal["Service Terminal<br/>[terminalapp.js]"]
  node_display["Queue Display<br/>[screenapp.js]"]
  node_workerui["Worker Interface<br/>[mainapp.js]"]
end

subgraph group_server["Application Server"]
  node_web["Frontend Routes<br/>[views.py]"]
  node_api["API Resources<br/>[resources.py]"]
  node_schemas["API Schemas<br/>[shemes.py]"]
  node_socket["Socket Handlers<br/>[socket.py]"]
end

subgraph group_domain["Queue Domain"]
  node_queue["Ticket Queue<br/>[queue.py]"]
  node_models["Domain Models<br/>[models.py]"]
  node_database[("SQLite Database<br/>[sqlite3.db]")]
end

subgraph group_support["Supporting Features"]
  node_auth["Authentication<br/>[views.py]"]
  node_admin["Queue Admin<br/>[routes.py]"]
  node_api_test["Socket API Tester<br/>[app.c77a4a72.js]"]
  node_chat["Simple Chat<br/>[app.cb8765da.js]"]
end

node_operator(("Operator"))
node_http(("HTTP API"))
node_socket_service(("Socket.IO Service"))
node_browser(("Browser User"))

node_operator -->|"uses"| node_terminal
node_terminal -->|"requests settings"| node_http
node_http -->|"routes requests"| node_api
node_api -->|"serializes"| node_schemas
node_terminal -->|"emits ticket events"| node_socket_service
node_socket_service -->|"dispatches events"| node_socket
node_display -->|"loads settings"| node_http
node_display -->|"subscribes to updates"| node_socket_service
node_workerui -->|"connects"| node_socket_service
node_web -->|"queries locations"| node_database
node_web -->|"renders pages"| node_browser
node_auth -->|"loads users"| node_database
node_api -->|"queries records"| node_database
node_queue -->|"uses domain records"| node_models
node_browser -->|"tests socket API"| node_api_test
node_api_test -->|"emits messages"| node_socket_service
node_browser -->|"uses chat"| node_chat
node_chat -->|"emits chat events"| node_socket_service
node_browser -->|"requests pages"| node_web

click node_terminal "https://github.com/borgolov/webqueue2/blob/master/app/static/terminal_hybrid/js/terminalapp.js"
click node_display "https://github.com/borgolov/webqueue2/blob/master/app/static/screen_new/js/screenapp.js"
click node_workerui "https://github.com/borgolov/webqueue2/blob/master/app/static/worker_new/js/mainapp.js"
click node_web "https://github.com/borgolov/webqueue2/blob/master/app/frontend/views.py"
click node_api "https://github.com/borgolov/webqueue2/blob/master/app/api/resources.py"
click node_schemas "https://github.com/borgolov/webqueue2/blob/master/app/api/shemes.py"
click node_socket "https://github.com/borgolov/webqueue2/blob/master/app/socket.py"
click node_auth "https://github.com/borgolov/webqueue2/blob/master/app/auth/views.py"
click node_admin "https://github.com/borgolov/webqueue2/blob/master/app/admin_queue/routes.py"
click node_api_test "https://github.com/borgolov/webqueue2/blob/master/app/static/api_tester/js/app.c77a4a72.js"
click node_chat "https://github.com/borgolov/webqueue2/blob/master/app/static/vue_simple_chat/js/app.cb8765da.js"
click node_queue "https://github.com/borgolov/webqueue2/blob/master/app/queue.py"
click node_models "https://github.com/borgolov/webqueue2/blob/master/app/models.py"
click node_database "https://github.com/borgolov/webqueue2/blob/master/instance/sqlite3.db"

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_terminal,node_display,node_workerui,node_browser toneBlue
class node_web,node_api,node_schemas,node_socket toneAmber
class node_queue,node_models,node_database,node_http toneMint
class node_auth,node_admin,node_api_test,node_chat toneRose
class node_operator,node_socket_service toneIndigo
```

## Components

### Queue Clients

- [Service Terminal](https://github.com/borgolov/webqueue2/blob/master/app/static/terminal_hybrid/js/terminalapp.js): `app/static/terminal_hybrid/js/terminalapp.js`
- [Queue Display](https://github.com/borgolov/webqueue2/blob/master/app/static/screen_new/js/screenapp.js): `app/static/screen_new/js/screenapp.js`
- [Worker Interface](https://github.com/borgolov/webqueue2/blob/master/app/static/worker_new/js/mainapp.js): `app/static/worker_new/js/mainapp.js`

### Application Server

- [Frontend Routes](https://github.com/borgolov/webqueue2/blob/master/app/frontend/views.py): `app/frontend/views.py`
- [API Resources](https://github.com/borgolov/webqueue2/blob/master/app/api/resources.py): `app/api/resources.py`
- [API Schemas](https://github.com/borgolov/webqueue2/blob/master/app/api/shemes.py): `app/api/shemes.py`
- [Socket Handlers](https://github.com/borgolov/webqueue2/blob/master/app/socket.py): `app/socket.py`

### Queue Domain

- [Ticket Queue](https://github.com/borgolov/webqueue2/blob/master/app/queue.py): `app/queue.py`
- [Domain Models](https://github.com/borgolov/webqueue2/blob/master/app/models.py): `app/models.py`
- [SQLite Database](https://github.com/borgolov/webqueue2/blob/master/instance/sqlite3.db): `instance/sqlite3.db`

### Supporting Features

- [Authentication](https://github.com/borgolov/webqueue2/blob/master/app/auth/views.py): `app/auth/views.py`
- [Queue Admin](https://github.com/borgolov/webqueue2/blob/master/app/admin_queue/routes.py): `app/admin_queue/routes.py`
- [Socket API Tester](https://github.com/borgolov/webqueue2/blob/master/app/static/api_tester/js/app.c77a4a72.js): `app/static/api_tester/js/app.c77a4a72.js`
- [Simple Chat](https://github.com/borgolov/webqueue2/blob/master/app/static/vue_simple_chat/js/app.cb8765da.js): `app/static/vue_simple_chat/js/app.cb8765da.js`

### Other components

- **Operator**
- **HTTP API**
- **Socket.IO Service**
- **Browser User**

## Connections

- Operator → Service Terminal: uses
- Service Terminal → HTTP API: requests settings
- HTTP API → API Resources: routes requests
- API Resources → API Schemas: serializes
- Service Terminal → Socket.IO Service: emits ticket events
- Socket.IO Service → Socket Handlers: dispatches events
- Queue Display → HTTP API: loads settings
- Queue Display → Socket.IO Service: subscribes to updates
- Worker Interface → Socket.IO Service: connects
- Frontend Routes → SQLite Database: queries locations
- Frontend Routes → Browser User: renders pages
- Authentication → SQLite Database: loads users
- API Resources → SQLite Database: queries records
- Ticket Queue → Domain Models: uses domain records
- Browser User → Socket API Tester: tests socket API
- Socket API Tester → Socket.IO Service: emits messages
- Browser User → Simple Chat: uses chat
- Simple Chat → Socket.IO Service: emits chat events
- Browser User → Frontend Routes: requests pages
