# joashcasino/ccc181 architecture

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

- Interactive diagram: https://gitdiagram.com/joashcasino/ccc181
- Repository: https://github.com/joashcasino/ccc181

## Overview

KopyaQ is a printing-shop queue app: students choose a service and join, then view their position and estimated wait; staff call and update tickets from a dashboard and manage services. Flask routes in `app.py` coordinate these workflows, with SQLAlchemy domain models in `models.py` and PostgreSQL configured as the persistent store. The README documents the main user and staff capabilities. Some templates and frontend behavior are unsampled, so links to them are limited to render calls visible in `app.py`.

Main entry points: [`app.py`](https://github.com/joashcasino/ccc181/blob/main/app.py) (Flask routes), [`models.py`](https://github.com/joashcasino/ccc181/blob/main/models.py) (Queue records), [`templates/ticket.html`](https://github.com/joashcasino/ccc181/blob/main/templates/ticket.html) (Ticket page), [`templates/services.html`](https://github.com/joashcasino/ccc181/blob/main/templates/services.html) (Service pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer_flow["Customer queue"]
  node_join["Join queue<br/>[app.py]"]
  node_position["Queue position<br/>[app.py]"]
  node_ticket_view["Ticket page<br/>[ticket.html]"]
  node_ticket_lifecycle["Leave queue<br/>[app.py]"]
end

subgraph group_staff_ops["Staff operations"]
  node_dashboard["Staff dashboard<br/>[app.py]"]
  node_call_next["Call next<br/>[app.py]"]
  node_ticket_actions["Ticket actions<br/>[app.py]"]
  node_service_admin["Service management<br/>[app.py]"]
  node_service_views["Service pages<br/>[services.html]"]
end

subgraph group_runtime_data["Application and data"]
  node_flask_app["Flask routes<br/>[app.py]"]
  node_domain_models["Queue records<br/>[models.py]"]
  node_postgres[("PostgreSQL")]
end

node_customer(("Student"))
node_staff(("Staff member"))

node_customer -->|"joins"| node_join
node_join -->|"creates ticket"| node_domain_models
node_join -->|"submits to"| node_flask_app
node_flask_app -->|"renders"| node_ticket_view
node_customer -->|"checks place"| node_position
node_position -->|"counts waiting"| node_domain_models
node_position -->|"requests status"| node_flask_app
node_flask_app -->|"renders ticket"| node_ticket_view
node_customer -->|"leaves queue"| node_ticket_lifecycle
node_ticket_lifecycle -->|"updates status"| node_domain_models
node_staff -->|"manages line"| node_dashboard
node_dashboard -->|"loads queue"| node_domain_models
node_staff -->|"calls next"| node_call_next
node_call_next -->|"marks called"| node_domain_models
node_staff -->|"updates ticket"| node_ticket_actions
node_ticket_actions -->|"changes status"| node_domain_models
node_staff -->|"manages services"| node_service_admin
node_service_admin -->|"edits services"| node_domain_models
node_flask_app -->|"renders"| node_service_views
node_flask_app -->|"uses"| node_domain_models
node_flask_app -->|"persists records"| node_postgres

click node_join "https://github.com/joashcasino/ccc181/blob/main/app.py"
click node_position "https://github.com/joashcasino/ccc181/blob/main/app.py"
click node_ticket_view "https://github.com/joashcasino/ccc181/blob/main/templates/ticket.html"
click node_ticket_lifecycle "https://github.com/joashcasino/ccc181/blob/main/app.py"
click node_dashboard "https://github.com/joashcasino/ccc181/blob/main/app.py"
click node_call_next "https://github.com/joashcasino/ccc181/blob/main/app.py"
click node_ticket_actions "https://github.com/joashcasino/ccc181/blob/main/app.py"
click node_service_admin "https://github.com/joashcasino/ccc181/blob/main/app.py"
click node_service_views "https://github.com/joashcasino/ccc181/blob/main/templates/services.html"
click node_flask_app "https://github.com/joashcasino/ccc181/blob/main/app.py"
click node_domain_models "https://github.com/joashcasino/ccc181/blob/main/models.py"

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_join,node_position,node_ticket_view,node_ticket_lifecycle toneBlue
class node_dashboard,node_call_next,node_ticket_actions,node_service_admin,node_service_views toneAmber
class node_flask_app,node_domain_models,node_postgres toneMint
class node_customer,node_staff toneIndigo
```

## Components

### Customer queue

- [Join queue](https://github.com/joashcasino/ccc181/blob/main/app.py): `app.py`
- [Queue position](https://github.com/joashcasino/ccc181/blob/main/app.py): `app.py`
- [Ticket page](https://github.com/joashcasino/ccc181/blob/main/templates/ticket.html): `templates/ticket.html`
- [Leave queue](https://github.com/joashcasino/ccc181/blob/main/app.py): `app.py`

### Staff operations

- [Staff dashboard](https://github.com/joashcasino/ccc181/blob/main/app.py): `app.py`
- [Call next](https://github.com/joashcasino/ccc181/blob/main/app.py): `app.py`
- [Ticket actions](https://github.com/joashcasino/ccc181/blob/main/app.py): `app.py`
- [Service management](https://github.com/joashcasino/ccc181/blob/main/app.py): `app.py`
- [Service pages](https://github.com/joashcasino/ccc181/blob/main/templates/services.html): `templates/services.html`

### Application and data

- [Flask routes](https://github.com/joashcasino/ccc181/blob/main/app.py): `app.py`
- [Queue records](https://github.com/joashcasino/ccc181/blob/main/models.py): `models.py`
- **PostgreSQL**

### Other components

- **Student**
- **Staff member**

## Connections

- Student → Join queue: joins (evidence: `README.md`)
- Join queue → Queue records: creates ticket (evidence: `app.py`)
- Join queue → Flask routes: submits to (evidence: `app.py`)
- Flask routes → Ticket page: renders (evidence: `app.py`)
- Student → Queue position: checks place (evidence: `README.md`)
- Queue position → Queue records: counts waiting (evidence: `app.py`)
- Queue position → Flask routes: requests status (evidence: `app.py`)
- Flask routes → Ticket page: renders ticket (evidence: `app.py`)
- Student → Leave queue: leaves queue (evidence: `app.py`)
- Leave queue → Queue records: updates status (evidence: `app.py`)
- Staff member → Staff dashboard: manages line (evidence: `README.md`)
- Staff dashboard → Queue records: loads queue (evidence: `app.py`)
- Staff member → Call next: calls next (evidence: `README.md`)
- Call next → Queue records: marks called (evidence: `app.py`)
- Staff member → Ticket actions: updates ticket (evidence: `app.py`)
- Ticket actions → Queue records: changes status (evidence: `app.py`)
- Staff member → Service management: manages services (evidence: `app.py`)
- Service management → Queue records: edits services (evidence: `app.py`)
- Flask routes → Service pages: renders (evidence: `app.py`)
- Flask routes → Queue records: uses (evidence: `app.py`)
- Flask routes → PostgreSQL: persists records (evidence: `app.py`)
