# ansika-patti/secure-print-system architecture

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

- Interactive diagram: https://gitdiagram.com/ansika-patti/secure-print-system
- Repository: https://github.com/ansika-patti/secure-print-system

## Overview

Secure Print System is an under-development QR-based print-request application. Customers are intended to reach a printer page, submit PDFs and track a tokenized request; shopkeepers review pending jobs and approve or deny them. The sampled server implements printer registration and QR generation, printer lookup, session-ID responses, in-memory job creation/status, and shopkeeper actions. The README describes PDF handling and other customer features, but the sampled backend does not show upload or PDF-processing routes; the separate session and upload helpers are not wired into it.

Main entry points: [`public/index.html`](https://github.com/ansika-patti/secure-print-system/blob/main/public/index.html) (Customer pages), [`server.js`](https://github.com/ansika-patti/secure-print-system/blob/main/server.js) (Printer registration), [`public/shopkeeper.html`](https://github.com/ansika-patti/secure-print-system/blob/main/public/shopkeeper.html) (Shopkeeper dashboard), [`printerMap.json`](https://github.com/ansika-patti/secure-print-system/blob/main/printerMap.json) (Printer settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer experience"]
  node_customer_ui["Customer pages<br/>[index.html]"]
end

subgraph group_backend["Print service"]
  node_printer_setup["Printer registration<br/>[server.js]"]
  node_printer_config[("Printer settings<br/>[printerMap.json]")]
  node_qr_generation["QR generation<br/>[server.js]"]
  node_printer_lookup["Printer lookup<br/>[server.js]"]
  node_session_api["Session response<br/>[server.js]"]
  node_session_helper["Session helper<br/>[sessionStore.js]"]
  node_print_request["Print request API<br/>[server.js]"]
  node_job_state[("Job state<br/>[server.js]")]
  node_upload_helper["Upload middleware"]
end

subgraph group_shop["Shopkeeper operations"]
  node_shop_dashboard["Shopkeeper dashboard<br/>[shopkeeper.html]"]
  node_job_review["Job review API<br/>[server.js]"]
  node_job_store_helper["Job store helper<br/>[jobStore.js]"]
end

node_customer(("Customer"))
node_shopkeeper(("Shopkeeper"))

node_customer -->|"opens"| node_customer_ui
node_shopkeeper -->|"reviews jobs"| node_shop_dashboard
node_customer_ui -->|"registers printer"| node_printer_setup
node_printer_setup -->|"writes settings"| node_printer_config
node_printer_setup -->|"generates QR"| node_qr_generation
node_printer_lookup -->|"reads settings"| node_printer_config
node_customer_ui -.->|"requests printer"| node_printer_lookup
node_customer_ui -.->|"requests session"| node_session_api
node_session_api -->|"returns ID"| node_customer_ui
node_customer_ui -.->|"submits request"| node_print_request
node_print_request -->|"stores job"| node_job_state
node_job_review -->|"reads and updates"| node_job_state
node_shop_dashboard -.->|"reviews jobs"| node_job_review

click node_customer_ui "https://github.com/ansika-patti/secure-print-system/blob/main/public/index.html"
click node_printer_setup "https://github.com/ansika-patti/secure-print-system/blob/main/server.js"
click node_printer_config "https://github.com/ansika-patti/secure-print-system/blob/main/printerMap.json"
click node_qr_generation "https://github.com/ansika-patti/secure-print-system/blob/main/server.js"
click node_printer_lookup "https://github.com/ansika-patti/secure-print-system/blob/main/server.js"
click node_session_api "https://github.com/ansika-patti/secure-print-system/blob/main/server.js"
click node_session_helper "https://github.com/ansika-patti/secure-print-system/blob/main/sessionStore.js"
click node_print_request "https://github.com/ansika-patti/secure-print-system/blob/main/server.js"
click node_job_state "https://github.com/ansika-patti/secure-print-system/blob/main/server.js"
click node_upload_helper "https://github.com/ansika-patti/secure-print-system/blob/main/uploadMiddleware.js"
click node_shop_dashboard "https://github.com/ansika-patti/secure-print-system/blob/main/public/shopkeeper.html"
click node_job_review "https://github.com/ansika-patti/secure-print-system/blob/main/server.js"
click node_job_store_helper "https://github.com/ansika-patti/secure-print-system/blob/main/jobStore.js"

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_customer_ui toneBlue
class node_printer_setup,node_printer_config,node_qr_generation,node_printer_lookup,node_session_api,node_session_helper,node_print_request,node_job_state,node_upload_helper toneAmber
class node_shop_dashboard,node_job_review,node_job_store_helper toneMint
class node_customer,node_shopkeeper toneIndigo
```

## Components

### Customer experience

- [Customer pages](https://github.com/ansika-patti/secure-print-system/blob/main/public/index.html): `public/index.html`

### Print service

- [Printer registration](https://github.com/ansika-patti/secure-print-system/blob/main/server.js): `server.js`
- [Printer settings](https://github.com/ansika-patti/secure-print-system/blob/main/printerMap.json): `printerMap.json`
- [QR generation](https://github.com/ansika-patti/secure-print-system/blob/main/server.js): `server.js`
- [Printer lookup](https://github.com/ansika-patti/secure-print-system/blob/main/server.js): `server.js`
- [Session response](https://github.com/ansika-patti/secure-print-system/blob/main/server.js): `server.js`
- [Session helper](https://github.com/ansika-patti/secure-print-system/blob/main/sessionStore.js): `sessionStore.js`
- [Print request API](https://github.com/ansika-patti/secure-print-system/blob/main/server.js): `server.js`
- [Job state](https://github.com/ansika-patti/secure-print-system/blob/main/server.js): `server.js`
- [Upload middleware](https://github.com/ansika-patti/secure-print-system/blob/main/uploadMiddleware.js): `uploadMiddleware.js`

### Shopkeeper operations

- [Shopkeeper dashboard](https://github.com/ansika-patti/secure-print-system/blob/main/public/shopkeeper.html): `public/shopkeeper.html`
- [Job review API](https://github.com/ansika-patti/secure-print-system/blob/main/server.js): `server.js`
- [Job store helper](https://github.com/ansika-patti/secure-print-system/blob/main/jobStore.js): `jobStore.js`

### Other components

- **Customer**
- **Shopkeeper**

## Connections

- Customer → Customer pages: opens (evidence: `README.md`)
- Shopkeeper → Shopkeeper dashboard: reviews jobs (evidence: `README.md`)
- Customer pages → Printer registration: registers printer (evidence: `server.js`)
- Printer registration → Printer settings: writes settings (evidence: `server.js`)
- Printer registration → QR generation: generates QR (evidence: `server.js`)
- Printer lookup → Printer settings: reads settings (evidence: `server.js`)
- Customer pages → Printer lookup: requests printer
- Customer pages → Session response: requests session
- Session response → Customer pages: returns ID (evidence: `server.js`)
- Customer pages → Print request API: submits request (evidence: `README.md`)
- Print request API → Job state: stores job (evidence: `server.js`)
- Job review API → Job state: reads and updates (evidence: `server.js`)
- Shopkeeper dashboard → Job review API: reviews jobs
