# schliz/ippweb architecture

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

- Interactive diagram: https://gitdiagram.com/schliz/ippweb
- Repository: https://github.com/schliz/ippweb

## Overview

ippweb is a Flask web printing service. Users authenticate, select a CUPS printer, upload and configure a PDF, then track or cancel its job and review page-count reports. The graph follows the sampled route, synchronization, and model ownership; README-documented monitoring, printer options, and reporting are included. Some route and sync implementation is unsampled, so uncertain internal wiring is omitted.

Main entry points: [`app/models.py`](https://github.com/schliz/ippweb/blob/master/app/models.py) (User and jobs), [`app/__init__.py`](https://github.com/schliz/ippweb/blob/master/app/__init__.py) (Flask app), [`app/routes/print.py`](https://github.com/schliz/ippweb/blob/master/app/routes/print.py) (Print routes), [`app/services/job_sync.py`](https://github.com/schliz/ippweb/blob/master/app/services/job_sync.py) (Job sync service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web workflows"]
  node_app["Flask app<br/>[__init__.py]"]
  node_print_routes["Print routes<br/>[print.py]"]
  node_job_routes["Job routes<br/>[jobs.py]"]
  node_job_ui["Job pages<br/>[jobs.html]"]
  node_print_ui["Print pages<br/>[print.html]"]
end

subgraph group_printing["Print operations"]
  node_uploads["PDF uploads<br/>[print.py]"]
  node_cups["CUPS client<br/>[cups_client.py]"]
end

subgraph group_identity["Identity"]
  node_auth_routes["Auth routes<br/>[auth.py]"]
  node_auth["OIDC auth<br/>[auth.py]"]
end

subgraph group_state["Job state"]
  node_users_jobs["User and jobs<br/>[models.py]"]
  node_database[("Application database")]
  node_job_sync["Job sync service<br/>[job_sync.py]"]
end

node_user(("User"))
node_cups_service[("CUPS print service")]
node_oidc_provider["Keycloak OIDC"]

node_user -->|"uses"| node_app
node_app -->|"registers"| node_print_routes
node_app -->|"registers"| node_job_routes
node_app -->|"registers"| node_auth_routes
node_app -->|"initializes"| node_auth
node_app -->|"starts"| node_job_sync
node_auth_routes -->|"uses"| node_auth
node_auth_routes -->|"exchanges tokens"| node_oidc_provider
node_auth_routes -->|"upserts user"| node_users_jobs
node_auth -->|"loads user"| node_users_jobs
node_users_jobs -->|"reads/writes"| node_database
node_print_routes -->|"lists printers/options"| node_cups
node_print_routes -->|"validates and saves PDF"| node_uploads
node_print_routes -->|"creates job record"| node_users_jobs
node_print_routes -->|"submits or cancels job"| node_cups
node_cups -->|"queries/submits"| node_cups_service
node_job_sync -->|"loads and updates jobs"| node_users_jobs
node_job_sync -->|"checks job status"| node_cups
node_job_sync -->|"commits status"| node_users_jobs
node_job_routes -->|"queries and reports"| node_users_jobs
node_job_routes -->|"syncs/subscribes"| node_job_sync
node_job_routes -->|"streams updates"| node_user
node_user -->|"configures print"| node_print_ui
node_user -->|"views job history"| node_job_ui

click node_app "https://github.com/schliz/ippweb/blob/master/app/__init__.py"
click node_print_routes "https://github.com/schliz/ippweb/blob/master/app/routes/print.py"
click node_job_routes "https://github.com/schliz/ippweb/blob/master/app/routes/jobs.py"
click node_auth_routes "https://github.com/schliz/ippweb/blob/master/app/routes/auth.py"
click node_auth "https://github.com/schliz/ippweb/blob/master/app/auth.py"
click node_users_jobs "https://github.com/schliz/ippweb/blob/master/app/models.py"
click node_uploads "https://github.com/schliz/ippweb/blob/master/app/routes/print.py"
click node_cups "https://github.com/schliz/ippweb/blob/master/app/cups_client.py"
click node_job_sync "https://github.com/schliz/ippweb/blob/master/app/services/job_sync.py"
click node_job_ui "https://github.com/schliz/ippweb/blob/master/app/templates/jobs.html"
click node_print_ui "https://github.com/schliz/ippweb/blob/master/app/templates/print.html"

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_app,node_print_routes,node_job_routes,node_job_ui,node_print_ui,node_user toneBlue
class node_uploads,node_cups,node_cups_service toneAmber
class node_auth_routes,node_auth toneMint
class node_users_jobs,node_database,node_job_sync toneRose
class node_oidc_provider toneIndigo
```

## Components

### Web workflows

- [Flask app](https://github.com/schliz/ippweb/blob/master/app/__init__.py): `app/__init__.py`
- [Print routes](https://github.com/schliz/ippweb/blob/master/app/routes/print.py): `app/routes/print.py`
- [Job routes](https://github.com/schliz/ippweb/blob/master/app/routes/jobs.py): `app/routes/jobs.py`
- [Job pages](https://github.com/schliz/ippweb/blob/master/app/templates/jobs.html): `app/templates/jobs.html`
- [Print pages](https://github.com/schliz/ippweb/blob/master/app/templates/print.html): `app/templates/print.html`

### Print operations

- [PDF uploads](https://github.com/schliz/ippweb/blob/master/app/routes/print.py): `app/routes/print.py`
- [CUPS client](https://github.com/schliz/ippweb/blob/master/app/cups_client.py): `app/cups_client.py`

### Identity

- [Auth routes](https://github.com/schliz/ippweb/blob/master/app/routes/auth.py): `app/routes/auth.py`
- [OIDC auth](https://github.com/schliz/ippweb/blob/master/app/auth.py): `app/auth.py`

### Job state

- [User and jobs](https://github.com/schliz/ippweb/blob/master/app/models.py): `app/models.py`
- **Application database**
- [Job sync service](https://github.com/schliz/ippweb/blob/master/app/services/job_sync.py): `app/services/job_sync.py`

### Other components

- **User**
- **CUPS print service**
- **Keycloak OIDC**

## Connections

- User → Flask app: uses
- Flask app → Print routes: registers
- Flask app → Job routes: registers
- Flask app → Auth routes: registers
- Flask app → OIDC auth: initializes
- Flask app → Job sync service: starts
- Auth routes → OIDC auth: uses
- Auth routes → Keycloak OIDC: exchanges tokens
- Auth routes → User and jobs: upserts user
- OIDC auth → User and jobs: loads user
- User and jobs → Application database: reads/writes
- Print routes → CUPS client: lists printers/options
- Print routes → PDF uploads: validates and saves PDF
- Print routes → User and jobs: creates job record
- Print routes → CUPS client: submits or cancels job
- CUPS client → CUPS print service: queries/submits
- Job sync service → User and jobs: loads and updates jobs
- Job sync service → CUPS client: checks job status
- Job sync service → User and jobs: commits status
- Job routes → User and jobs: queries and reports
- Job routes → Job sync service: syncs/subscribes
- Job routes → User: streams updates
- User → Print pages: configures print
- User → Job pages: views job history
