# risvey-hasan/azzain-print-kiosk architecture

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

- Interactive diagram: https://gitdiagram.com/risvey-hasan/azzain-print-kiosk
- Repository: https://github.com/risvey-hasan/azzain-print-kiosk

## Overview

Azzain Ink is a self-service printing-kiosk controller. A student submits print choices through the web page; the kiosk detects the payment page, retrieves the job, waits for a matching bank notification, prints after payment, then records completion and clears the server job. Licensing gates startup, and cancellation is checked while payment is pending. The README documents the overall workflow; the shown source establishes the main calls and local printing behavior, but does not expose backend implementation details.

Main entry points: [`main.py`](https://github.com/risvey-hasan/azzain-print-kiosk/blob/main/main.py) (Kiosk controller), [`SheetUpdate.py`](https://github.com/risvey-hasan/azzain-print-kiosk/blob/main/SheetUpdate.py) (Google Sheets client), [`printFile.py`](https://github.com/risvey-hasan/azzain-print-kiosk/blob/main/printFile.py) (Print preparation), [`browser.py`](https://github.com/risvey-hasan/azzain-print-kiosk/blob/main/browser.py) (Kiosk browser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Kiosk interaction"]
  node_browser["Kiosk browser<br/>[browser.py]"]
end

subgraph group_jobs["Job orchestration"]
  node_controller["Kiosk controller<br/>[main.py]"]
  node_web_backend["Web job backend"]
  node_local_job_files[("Local job files<br/>[main.py]")]
end

subgraph group_payment["Payment verification"]
  node_imap_session["IMAP session<br/>[imapConnection.py]"]
  node_payment_inbox[("Payment inbox")]
  node_payment_matcher["Payment matcher"]
end

subgraph group_printing["Printing"]
  node_print_pipeline["Print preparation<br/>[printFile.py]"]
  node_print_queue["Windows print queue<br/>[printFile.py]"]
  node_printer["Printer"]
end

subgraph group_operations["Licensing and dashboard"]
  node_license_check["App license check<br/>[validateApp.py]"]
  node_sheets_client["Google Sheets client<br/>[SheetUpdate.py]"]
  node_license_sheet[("License sheet")]
  node_dashboard[("Job dashboard")]
  node_google_sheets["Google Sheets"]
end

node_student(("Student"))

node_student -->|"submits job"| node_browser
node_browser -->|"opens kiosk page"| node_web_backend
node_controller -->|"waits for payment page"| node_browser
node_controller -->|"fetches job and settings"| node_web_backend
node_web_backend -->|"provides job files"| node_local_job_files
node_controller -->|"checks cancellation"| node_web_backend
node_controller -->|"opens inbox session"| node_imap_session
node_imap_session -->|"reads mail"| node_payment_inbox
node_controller -->|"checks amount and time"| node_payment_matcher
node_payment_matcher -->|"searches messages"| node_imap_session
node_controller -->|"starts paid job"| node_print_pipeline
node_print_pipeline -->|"converts job files"| node_local_job_files
node_print_pipeline -->|"submits print jobs"| node_print_queue
node_print_queue -->|"prints jobs"| node_printer
node_controller -->|"checks queue"| node_print_pipeline
node_controller -->|"confirms and clears job"| node_web_backend
node_controller -->|"validates before startup"| node_license_check
node_license_check -->|"reads license records"| node_sheets_client
node_sheets_client -->|"checks license data"| node_license_sheet
node_controller -->|"records job outcome"| node_sheets_client
node_sheets_client -->|"appends job record"| node_dashboard
node_sheets_client -->|"updates sheets"| node_google_sheets

click node_browser "https://github.com/risvey-hasan/azzain-print-kiosk/blob/main/browser.py"
click node_controller "https://github.com/risvey-hasan/azzain-print-kiosk/blob/main/main.py"
click node_local_job_files "https://github.com/risvey-hasan/azzain-print-kiosk/blob/main/main.py"
click node_imap_session "https://github.com/risvey-hasan/azzain-print-kiosk/blob/main/imapConnection.py"
click node_payment_matcher "https://github.com/risvey-hasan/azzain-print-kiosk/blob/main/paymentConfirmation.py"
click node_print_pipeline "https://github.com/risvey-hasan/azzain-print-kiosk/blob/main/printFile.py"
click node_print_queue "https://github.com/risvey-hasan/azzain-print-kiosk/blob/main/printFile.py"
click node_license_check "https://github.com/risvey-hasan/azzain-print-kiosk/blob/main/validateApp.py"
click node_sheets_client "https://github.com/risvey-hasan/azzain-print-kiosk/blob/main/SheetUpdate.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_browser toneBlue
class node_controller,node_web_backend,node_local_job_files toneAmber
class node_imap_session,node_payment_inbox,node_payment_matcher toneMint
class node_print_pipeline,node_print_queue,node_printer toneRose
class node_license_check,node_sheets_client,node_license_sheet,node_dashboard,node_google_sheets,node_student toneIndigo
```

## Components

### Kiosk interaction

- [Kiosk browser](https://github.com/risvey-hasan/azzain-print-kiosk/blob/main/browser.py): `browser.py`

### Job orchestration

- [Kiosk controller](https://github.com/risvey-hasan/azzain-print-kiosk/blob/main/main.py): `main.py`
- **Web job backend**
- [Local job files](https://github.com/risvey-hasan/azzain-print-kiosk/blob/main/main.py): `main.py`

### Payment verification

- [IMAP session](https://github.com/risvey-hasan/azzain-print-kiosk/blob/main/imapConnection.py): `imapConnection.py`
- **Payment inbox**
- [Payment matcher](https://github.com/risvey-hasan/azzain-print-kiosk/blob/main/paymentConfirmation.py): `paymentConfirmation.py`

### Printing

- [Print preparation](https://github.com/risvey-hasan/azzain-print-kiosk/blob/main/printFile.py): `printFile.py`
- [Windows print queue](https://github.com/risvey-hasan/azzain-print-kiosk/blob/main/printFile.py): `printFile.py`
- **Printer**

### Licensing and dashboard

- [App license check](https://github.com/risvey-hasan/azzain-print-kiosk/blob/main/validateApp.py): `validateApp.py`
- [Google Sheets client](https://github.com/risvey-hasan/azzain-print-kiosk/blob/main/SheetUpdate.py): `SheetUpdate.py`
- **License sheet**
- **Job dashboard**
- **Google Sheets**

### Other components

- **Student**

## Connections

- Student → Kiosk browser: submits job (evidence: `README.md`)
- Kiosk browser → Web job backend: opens kiosk page (evidence: `browser.py`)
- Kiosk controller → Kiosk browser: waits for payment page (evidence: `main.py`)
- Kiosk controller → Web job backend: fetches job and settings (evidence: `main.py`)
- Web job backend → Local job files: provides job files (evidence: `main.py`)
- Kiosk controller → Web job backend: checks cancellation (evidence: `main.py`)
- Kiosk controller → IMAP session: opens inbox session (evidence: `main.py`)
- IMAP session → Payment inbox: reads mail (evidence: `imapConnection.py`)
- Kiosk controller → Payment matcher: checks amount and time (evidence: `main.py`)
- Payment matcher → IMAP session: searches messages (evidence: `paymentConfirmation.py`)
- Kiosk controller → Print preparation: starts paid job (evidence: `main.py`)
- Print preparation → Local job files: converts job files (evidence: `printFile.py`)
- Print preparation → Windows print queue: submits print jobs (evidence: `printFile.py`)
- Windows print queue → Printer: prints jobs (evidence: `README.md`)
- Kiosk controller → Print preparation: checks queue (evidence: `main.py`)
- Kiosk controller → Web job backend: confirms and clears job (evidence: `main.py`)
- Kiosk controller → App license check: validates before startup (evidence: `main.py`)
- App license check → Google Sheets client: reads license records (evidence: `validateApp.py`)
- Google Sheets client → License sheet: checks license data (evidence: `README.md`)
- Kiosk controller → Google Sheets client: records job outcome (evidence: `main.py`)
- Google Sheets client → Job dashboard: appends job record
- Google Sheets client → Google Sheets: updates sheets (evidence: `SheetUpdate.py`)
