# njwacky/internetcafe architecture

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

- Interactive diagram: https://gitdiagram.com/njwacky/internetcafe
- Repository: https://github.com/njwacky/internetcafe

## Overview

Café Desk is a local-first CustomTkinter desktop studio for walk-in document services. Staff or customers use the shared workspace to create or process documents, preview and export files; saved customer work can also be priced into a receipt and local sales history. Staff-only settings, sales administration, recovery, licensing, and optional cloud or AI features extend that core workflow. UI-to-module links are supported by the app’s import index; other links below rely on README-described behavior, since many implementations were not sampled.

Main entry points: [`app.py`](https://github.com/njwacky/internetcafe/blob/main/app.py) (Workspace UI), [`services.py`](https://github.com/njwacky/internetcafe/blob/main/services.py) (Document operations), [`sales_ui.py`](https://github.com/njwacky/internetcafe/blob/main/sales_ui.py) (Sales administration), [`license_ui.py`](https://github.com/njwacky/internetcafe/blob/main/license_ui.py) (License interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Desktop workspace"]
  node_app["Workspace UI<br/>[app.py]"]
  node_workers["Background workers<br/>[workers.py]"]
end

subgraph group_documents["Document tools"]
  node_services["Document operations<br/>[services.py]"]
  node_cv["Career documents<br/>[cv_renderer.py]"]
  node_templates["Career templates<br/>[templates.py]"]
  node_cardsui["Cards editor<br/>[cards_ui.py]"]
  node_cards["Cards renderer<br/>[cards_renderer.py]"]
  node_formsui["Forms editor<br/>[forms_ui.py]"]
  node_forms["Forms renderer<br/>[forms_renderer.py]"]
  node_collageui["Picture-sheet editor<br/>[collage_ui.py]"]
  node_collage["Picture-sheet layout<br/>[collage.py]"]
  node_scanner["Scanner workflow<br/>[scanner_ui.py]"]
  node_ocr["Image OCR<br/>[ocr_ui.py]"]
  node_pdfpicker["PDF page picker<br/>[pdf_picker_ui.py]"]
  node_pdfpreview["PDF preview<br/>[pdf_preview.py]"]
  node_onlineui["Online templates UI"]
  node_online["Online templates"]
end

subgraph group_business["Shop operations"]
  node_prices["Price list<br/>[price_list.py]"]
  node_salesui["Sales administration<br/>[sales_ui.py]"]
  node_saved["Saved-work accounting<br/>[saved_services.py]"]
  node_outbox["Sales retry queue<br/>[sales_outbox.py]"]
  node_sales[("Sales ledger<br/>[sales_store.py]")]
end

subgraph group_platform["Local platform"]
  node_settings[("Settings and PIN<br/>[settings_store.py]")]
  node_recovery[("Project recovery<br/>[recovery_store.py]")]
  node_fonts["PDF fonts<br/>[pdf_fonts.py]"]
  node_licenseui["License interface<br/>[license_ui.py]"]
  node_license["License verification<br/>[license_guard.py]"]
end

subgraph group_remote["Optional services"]
  node_cloud["Cloud synchronization<br/>[cloud_sync.py]"]
end

node_staff(("Staff or customer"))
node_tesseract["Tesseract OCR"]
node_supabase[("Supabase service")]

node_staff -->|"uses"| node_app
node_app -->|"requests operations"| node_services
node_app -->|"dispatches jobs"| node_workers
node_app -->|"exports career PDFs"| node_cv
node_app -->|"builds career drafts"| node_templates
node_app -->|"opens editor"| node_cardsui
node_cardsui -->|"renders cards"| node_cards
node_app -->|"opens editor"| node_formsui
node_formsui -->|"renders forms"| node_forms
node_app -->|"opens editor"| node_collageui
node_collageui -->|"uses layout"| node_collage
node_app -->|"opens scanner"| node_scanner
node_app -->|"opens OCR"| node_ocr
node_ocr -->|"extracts text"| node_services
node_services -.->|"runs engine"| node_tesseract
node_app -->|"opens picker"| node_pdfpicker
node_pdfpicker -->|"requests previews"| node_pdfpreview
node_app -->|"opens templates"| node_onlineui
node_onlineui -->|"uses catalog"| node_online
node_app -->|"opens sales tools"| node_salesui
node_salesui -->|"manages records"| node_sales
node_salesui -->|"retries pending sales"| node_outbox
node_saved -->|"submits completed work"| node_outbox
node_outbox -->|"records sale"| node_sales
node_saved -->|"looks up prices"| node_prices
node_app -->|"reads settings"| node_settings
node_app -->|"stores recovery copies"| node_recovery
node_services -->|"uses fonts"| node_fonts
node_cards -->|"uses fonts"| node_fonts
node_forms -->|"uses fonts"| node_fonts
node_app -->|"opens licensing"| node_licenseui
node_licenseui -->|"checks keys"| node_license
node_licenseui -->|"syncs entitlements"| node_cloud
node_workers -->|"runs cloud jobs"| node_cloud
node_cloud -.->|"syncs remotely"| node_supabase

click node_app "https://github.com/njwacky/internetcafe/blob/main/app.py"
click node_workers "https://github.com/njwacky/internetcafe/blob/main/workers.py"
click node_services "https://github.com/njwacky/internetcafe/blob/main/services.py"
click node_cv "https://github.com/njwacky/internetcafe/blob/main/cv_renderer.py"
click node_templates "https://github.com/njwacky/internetcafe/blob/main/templates.py"
click node_cardsui "https://github.com/njwacky/internetcafe/blob/main/cards_ui.py"
click node_cards "https://github.com/njwacky/internetcafe/blob/main/cards_renderer.py"
click node_formsui "https://github.com/njwacky/internetcafe/blob/main/forms_ui.py"
click node_forms "https://github.com/njwacky/internetcafe/blob/main/forms_renderer.py"
click node_collageui "https://github.com/njwacky/internetcafe/blob/main/collage_ui.py"
click node_collage "https://github.com/njwacky/internetcafe/blob/main/collage.py"
click node_scanner "https://github.com/njwacky/internetcafe/blob/main/scanner_ui.py"
click node_ocr "https://github.com/njwacky/internetcafe/blob/main/ocr_ui.py"
click node_pdfpicker "https://github.com/njwacky/internetcafe/blob/main/pdf_picker_ui.py"
click node_pdfpreview "https://github.com/njwacky/internetcafe/blob/main/pdf_preview.py"
click node_onlineui "https://github.com/njwacky/internetcafe/blob/main/online_templates_ui.py"
click node_online "https://github.com/njwacky/internetcafe/blob/main/online_templates.py"
click node_prices "https://github.com/njwacky/internetcafe/blob/main/price_list.py"
click node_salesui "https://github.com/njwacky/internetcafe/blob/main/sales_ui.py"
click node_saved "https://github.com/njwacky/internetcafe/blob/main/saved_services.py"
click node_outbox "https://github.com/njwacky/internetcafe/blob/main/sales_outbox.py"
click node_sales "https://github.com/njwacky/internetcafe/blob/main/sales_store.py"
click node_settings "https://github.com/njwacky/internetcafe/blob/main/settings_store.py"
click node_recovery "https://github.com/njwacky/internetcafe/blob/main/recovery_store.py"
click node_fonts "https://github.com/njwacky/internetcafe/blob/main/pdf_fonts.py"
click node_licenseui "https://github.com/njwacky/internetcafe/blob/main/license_ui.py"
click node_license "https://github.com/njwacky/internetcafe/blob/main/license_guard.py"
click node_cloud "https://github.com/njwacky/internetcafe/blob/main/cloud_sync.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_app,node_workers toneBlue
class node_services,node_cv,node_templates,node_cardsui,node_cards,node_formsui,node_forms,node_collageui,node_collage,node_scanner,node_ocr,node_pdfpicker,node_pdfpreview,node_onlineui,node_online,node_supabase toneAmber
class node_prices,node_salesui,node_saved,node_outbox,node_sales toneMint
class node_settings,node_recovery,node_fonts,node_licenseui,node_license toneRose
class node_cloud,node_staff,node_tesseract toneIndigo
```

## Components

### Desktop workspace

- [Workspace UI](https://github.com/njwacky/internetcafe/blob/main/app.py): `app.py`
- [Background workers](https://github.com/njwacky/internetcafe/blob/main/workers.py): `workers.py`

### Document tools

- [Document operations](https://github.com/njwacky/internetcafe/blob/main/services.py): `services.py`
- [Career documents](https://github.com/njwacky/internetcafe/blob/main/cv_renderer.py): `cv_renderer.py`
- [Career templates](https://github.com/njwacky/internetcafe/blob/main/templates.py): `templates.py`
- [Cards editor](https://github.com/njwacky/internetcafe/blob/main/cards_ui.py): `cards_ui.py`
- [Cards renderer](https://github.com/njwacky/internetcafe/blob/main/cards_renderer.py): `cards_renderer.py`
- [Forms editor](https://github.com/njwacky/internetcafe/blob/main/forms_ui.py): `forms_ui.py`
- [Forms renderer](https://github.com/njwacky/internetcafe/blob/main/forms_renderer.py): `forms_renderer.py`
- [Picture-sheet editor](https://github.com/njwacky/internetcafe/blob/main/collage_ui.py): `collage_ui.py`
- [Picture-sheet layout](https://github.com/njwacky/internetcafe/blob/main/collage.py): `collage.py`
- [Scanner workflow](https://github.com/njwacky/internetcafe/blob/main/scanner_ui.py): `scanner_ui.py`
- [Image OCR](https://github.com/njwacky/internetcafe/blob/main/ocr_ui.py): `ocr_ui.py`
- [PDF page picker](https://github.com/njwacky/internetcafe/blob/main/pdf_picker_ui.py): `pdf_picker_ui.py`
- [PDF preview](https://github.com/njwacky/internetcafe/blob/main/pdf_preview.py): `pdf_preview.py`
- [Online templates UI](https://github.com/njwacky/internetcafe/blob/main/online_templates_ui.py): `online_templates_ui.py`
- [Online templates](https://github.com/njwacky/internetcafe/blob/main/online_templates.py): `online_templates.py`

### Shop operations

- [Price list](https://github.com/njwacky/internetcafe/blob/main/price_list.py): `price_list.py`
- [Sales administration](https://github.com/njwacky/internetcafe/blob/main/sales_ui.py): `sales_ui.py`
- [Saved-work accounting](https://github.com/njwacky/internetcafe/blob/main/saved_services.py): `saved_services.py`
- [Sales retry queue](https://github.com/njwacky/internetcafe/blob/main/sales_outbox.py): `sales_outbox.py`
- [Sales ledger](https://github.com/njwacky/internetcafe/blob/main/sales_store.py): `sales_store.py`

### Local platform

- [Settings and PIN](https://github.com/njwacky/internetcafe/blob/main/settings_store.py): `settings_store.py`
- [Project recovery](https://github.com/njwacky/internetcafe/blob/main/recovery_store.py): `recovery_store.py`
- [PDF fonts](https://github.com/njwacky/internetcafe/blob/main/pdf_fonts.py): `pdf_fonts.py`
- [License interface](https://github.com/njwacky/internetcafe/blob/main/license_ui.py): `license_ui.py`
- [License verification](https://github.com/njwacky/internetcafe/blob/main/license_guard.py): `license_guard.py`

### Optional services

- [Cloud synchronization](https://github.com/njwacky/internetcafe/blob/main/cloud_sync.py): `cloud_sync.py`

### Other components

- **Staff or customer**
- **Tesseract OCR**
- **Supabase service**

## Connections

- Staff or customer → Workspace UI: uses (evidence: `README.md`)
- Workspace UI → Document operations: requests operations (evidence: `app.py`)
- Workspace UI → Background workers: dispatches jobs (evidence: `app.py`)
- Workspace UI → Career documents: exports career PDFs (evidence: `README.md`)
- Workspace UI → Career templates: builds career drafts (evidence: `app.py`)
- Workspace UI → Cards editor: opens editor (evidence: `app.py`)
- Cards editor → Cards renderer: renders cards (evidence: `cards_ui.py`)
- Workspace UI → Forms editor: opens editor (evidence: `app.py`)
- Forms editor → Forms renderer: renders forms (evidence: `forms_ui.py`)
- Workspace UI → Picture-sheet editor: opens editor (evidence: `app.py`)
- Picture-sheet editor → Picture-sheet layout: uses layout (evidence: `collage_ui.py`)
- Workspace UI → Scanner workflow: opens scanner (evidence: `app.py`)
- Workspace UI → Image OCR: opens OCR (evidence: `app.py`)
- Image OCR → Document operations: extracts text (evidence: `README.md`)
- Document operations → Tesseract OCR: runs engine (evidence: `services.py`)
- Workspace UI → PDF page picker: opens picker (evidence: `app.py`)
- PDF page picker → PDF preview: requests previews (evidence: `pdf_picker_ui.py`)
- Workspace UI → Online templates UI: opens templates (evidence: `app.py`)
- Online templates UI → Online templates: uses catalog (evidence: `online_templates_ui.py`)
- Workspace UI → Sales administration: opens sales tools (evidence: `app.py`)
- Sales administration → Sales ledger: manages records (evidence: `sales_ui.py`)
- Sales administration → Sales retry queue: retries pending sales (evidence: `sales_ui.py`)
- Saved-work accounting → Sales retry queue: submits completed work (evidence: `saved_services.py`)
- Sales retry queue → Sales ledger: records sale (evidence: `sales_outbox.py`)
- Saved-work accounting → Price list: looks up prices (evidence: `saved_services.py`)
- Workspace UI → Settings and PIN: reads settings (evidence: `app.py`)
- Workspace UI → Project recovery: stores recovery copies (evidence: `app.py`)
- Document operations → PDF fonts: uses fonts (evidence: `services.py`)
- Cards renderer → PDF fonts: uses fonts (evidence: `cards_renderer.py`)
- Forms renderer → PDF fonts: uses fonts (evidence: `forms_renderer.py`)
- Workspace UI → License interface: opens licensing (evidence: `app.py`)
- License interface → License verification: checks keys (evidence: `license_ui.py`)
- License interface → Cloud synchronization: syncs entitlements (evidence: `license_ui.py`)
- Background workers → Cloud synchronization: runs cloud jobs (evidence: `workers.py`)
- Cloud synchronization → Supabase service: syncs remotely (evidence: `README.md`)
