# lachrymousee/print-kilat architecture

> Architecture diagram of the GitHub repository lachrymousee/print-kilat, 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/lachrymousee/print-kilat
- Repository: https://github.com/lachrymousee/print-kilat

## Overview

Print Kilat is a browser-only print pickup-and-delivery prototype. Customers configure a multi-file print order, review a dummy QRIS payment step, then track its progress; staff log in separately to manage orders or claim and advance delivery tasks. Shared runtime modules handle pricing, document previews, page ranges, order display, and localStorage persistence. The README documents several capabilities whose implementation was not sampled; those relationships are shown only where documented, and unsampled links are omitted.

Main entry points: [`js/order.js`](https://github.com/lachrymousee/print-kilat/blob/main/js/order.js) (Order workflow), [`js/db.js`](https://github.com/lachrymousee/print-kilat/blob/main/js/db.js) (Order status store), [`js/tracking.js`](https://github.com/lachrymousee/print-kilat/blob/main/js/tracking.js) (Customer tracking), [`js/admin.js`](https://github.com/lachrymousee/print-kilat/blob/main/js/admin.js) (Admin dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer journey"]
  node_landing["Landing page<br/>[index.html]"]
  node_orderform["Order form<br/>[order.html]"]
  node_orderflow["Order workflow<br/>[order.js]"]
  node_payment["Dummy QRIS<br/>[order.js]"]
  node_tracking["Customer tracking<br/>[tracking.js]"]
  node_security["Security information<br/>[keamanan.html]"]
end

subgraph group_operations["Order operations"]
  node_dispatch[("Order status store<br/>[db.js]")]
  node_courier["Courier tasks<br/>[courier.js]"]
  node_admin["Admin dashboard<br/>[admin.js]"]
end

subgraph group_staff["Staff tools"]
  node_loginpage["Staff login<br/>[login.html]"]
  node_login["Login workflow<br/>[login.js]"]
  node_auth["Session and role guard<br/>[auth.js]"]
end

subgraph group_shared["Shared runtime"]
  node_config["Runtime configuration<br/>[config.js]"]
  node_pricing["Pricing and promos<br/>[pricing.js]"]
  node_range["Page range parser<br/>[range.js]"]
  node_preview["Document preview<br/>[preview.js]"]
  node_orderview["Order display helpers<br/>[orderview.js]"]
  node_footer["Shared footer<br/>[footer.js]"]
end

node_customer(("Customer"))
node_staff(("Staff member"))
node_localstorage[("Browser localStorage")]
node_pdfjs["PDF.js"]
node_mammoth["Mammoth.js"]

node_customer -->|"opens"| node_landing
node_landing -->|"starts order"| node_orderform
node_customer -->|"configures order"| node_orderflow
node_orderform -->|"hosts workflow"| node_orderflow
node_orderflow -->|"previews files"| node_preview
node_orderflow -->|"validates pages"| node_range
node_orderflow -->|"calculates total"| node_pricing
node_orderflow -->|"reads settings"| node_config
node_orderflow -->|"opens payment"| node_payment
node_payment -->|"creates pending order"| node_dispatch
node_dispatch -->|"persists orders"| node_localstorage
node_customer -->|"tracks order"| node_tracking
node_tracking -->|"reads order status"| node_dispatch
node_staff -->|"opens login"| node_loginpage
node_loginpage -->|"hosts login"| node_login
node_login -->|"authenticates"| node_auth
node_auth -->|"checks staff accounts"| node_config
node_auth -->|"routes courier"| node_courier
node_auth -->|"routes admin"| node_admin
node_courier -->|"claims and advances"| node_dispatch
node_admin -->|"lists orders"| node_dispatch
node_admin -->|"calculates demo prices"| node_pricing
node_courier -->|"formats order details"| node_orderview
node_admin -->|"formats order details"| node_orderview
node_tracking -->|"formats order details"| node_orderview
node_config -->|"supplies price rules"| node_pricing
node_config -->|"supplies print labels"| node_orderview
node_preview -->|"renders PDFs"| node_pdfjs
node_preview -->|"converts DOCX"| node_mammoth
node_customer -->|"reads security notes"| node_security
node_landing -->|"uses shared footer"| node_footer
node_orderform -->|"uses shared footer"| node_footer
node_tracking -->|"uses shared footer"| node_footer
node_security -->|"uses shared footer"| node_footer

click node_landing "https://github.com/lachrymousee/print-kilat/blob/main/index.html"
click node_orderform "https://github.com/lachrymousee/print-kilat/blob/main/order.html"
click node_orderflow "https://github.com/lachrymousee/print-kilat/blob/main/js/order.js"
click node_payment "https://github.com/lachrymousee/print-kilat/blob/main/js/order.js"
click node_tracking "https://github.com/lachrymousee/print-kilat/blob/main/js/tracking.js"
click node_security "https://github.com/lachrymousee/print-kilat/blob/main/keamanan.html"
click node_dispatch "https://github.com/lachrymousee/print-kilat/blob/main/js/db.js"
click node_courier "https://github.com/lachrymousee/print-kilat/blob/main/js/courier.js"
click node_admin "https://github.com/lachrymousee/print-kilat/blob/main/js/admin.js"
click node_loginpage "https://github.com/lachrymousee/print-kilat/blob/main/login.html"
click node_login "https://github.com/lachrymousee/print-kilat/blob/main/js/login.js"
click node_auth "https://github.com/lachrymousee/print-kilat/blob/main/js/auth.js"
click node_config "https://github.com/lachrymousee/print-kilat/blob/main/js/config.js"
click node_pricing "https://github.com/lachrymousee/print-kilat/blob/main/js/pricing.js"
click node_range "https://github.com/lachrymousee/print-kilat/blob/main/js/range.js"
click node_preview "https://github.com/lachrymousee/print-kilat/blob/main/js/preview.js"
click node_orderview "https://github.com/lachrymousee/print-kilat/blob/main/js/orderview.js"
click node_footer "https://github.com/lachrymousee/print-kilat/blob/main/js/footer.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_landing,node_orderform,node_orderflow,node_payment,node_tracking,node_security toneBlue
class node_dispatch,node_courier,node_admin,node_localstorage toneAmber
class node_loginpage,node_login,node_auth toneMint
class node_config,node_pricing,node_range,node_preview,node_orderview,node_footer toneRose
class node_customer,node_staff,node_pdfjs,node_mammoth toneIndigo
```

## Components

### Customer journey

- [Landing page](https://github.com/lachrymousee/print-kilat/blob/main/index.html): `index.html`
- [Order form](https://github.com/lachrymousee/print-kilat/blob/main/order.html): `order.html`
- [Order workflow](https://github.com/lachrymousee/print-kilat/blob/main/js/order.js): `js/order.js`
- [Dummy QRIS](https://github.com/lachrymousee/print-kilat/blob/main/js/order.js): `js/order.js`
- [Customer tracking](https://github.com/lachrymousee/print-kilat/blob/main/js/tracking.js): `js/tracking.js`
- [Security information](https://github.com/lachrymousee/print-kilat/blob/main/keamanan.html): `keamanan.html`

### Order operations

- [Order status store](https://github.com/lachrymousee/print-kilat/blob/main/js/db.js): `js/db.js`
- [Courier tasks](https://github.com/lachrymousee/print-kilat/blob/main/js/courier.js): `js/courier.js`
- [Admin dashboard](https://github.com/lachrymousee/print-kilat/blob/main/js/admin.js): `js/admin.js`

### Staff tools

- [Staff login](https://github.com/lachrymousee/print-kilat/blob/main/login.html): `login.html`
- [Login workflow](https://github.com/lachrymousee/print-kilat/blob/main/js/login.js): `js/login.js`
- [Session and role guard](https://github.com/lachrymousee/print-kilat/blob/main/js/auth.js): `js/auth.js`

### Shared runtime

- [Runtime configuration](https://github.com/lachrymousee/print-kilat/blob/main/js/config.js): `js/config.js`
- [Pricing and promos](https://github.com/lachrymousee/print-kilat/blob/main/js/pricing.js): `js/pricing.js`
- [Page range parser](https://github.com/lachrymousee/print-kilat/blob/main/js/range.js): `js/range.js`
- [Document preview](https://github.com/lachrymousee/print-kilat/blob/main/js/preview.js): `js/preview.js`
- [Order display helpers](https://github.com/lachrymousee/print-kilat/blob/main/js/orderview.js): `js/orderview.js`
- [Shared footer](https://github.com/lachrymousee/print-kilat/blob/main/js/footer.js): `js/footer.js`

### Other components

- **Customer**
- **Staff member**
- **Browser localStorage**
- **PDF.js**
- **Mammoth.js**

## Connections

- Customer → Landing page: opens (evidence: `README.md`)
- Landing page → Order form: starts order (evidence: `README.md`)
- Customer → Order workflow: configures order (evidence: `README.md`)
- Order form → Order workflow: hosts workflow (evidence: `README.md`)
- Order workflow → Document preview: previews files (evidence: `README.md`)
- Order workflow → Page range parser: validates pages (evidence: `README.md`)
- Order workflow → Pricing and promos: calculates total (evidence: `README.md`)
- Order workflow → Runtime configuration: reads settings (evidence: `README.md`)
- Order workflow → Dummy QRIS: opens payment (evidence: `README.md`)
- Dummy QRIS → Order status store: creates pending order (evidence: `js/order.js`)
- Order status store → Browser localStorage: persists orders (evidence: `js/db.js`)
- Customer → Customer tracking: tracks order (evidence: `README.md`)
- Customer tracking → Order status store: reads order status (evidence: `js/tracking.js`)
- Staff member → Staff login: opens login (evidence: `README.md`)
- Staff login → Login workflow: hosts login (evidence: `README.md`)
- Login workflow → Session and role guard: authenticates (evidence: `js/login.js`)
- Session and role guard → Runtime configuration: checks staff accounts (evidence: `js/auth.js`)
- Session and role guard → Courier tasks: routes courier (evidence: `README.md`)
- Session and role guard → Admin dashboard: routes admin (evidence: `README.md`)
- Courier tasks → Order status store: claims and advances (evidence: `js/courier.js`)
- Admin dashboard → Order status store: lists orders (evidence: `js/admin.js`)
- Admin dashboard → Pricing and promos: calculates demo prices (evidence: `js/admin.js`)
- Courier tasks → Order display helpers: formats order details (evidence: `README.md`)
- Admin dashboard → Order display helpers: formats order details (evidence: `README.md`)
- Customer tracking → Order display helpers: formats order details (evidence: `js/tracking.js`)
- Runtime configuration → Pricing and promos: supplies price rules (evidence: `js/pricing.js`)
- Runtime configuration → Order display helpers: supplies print labels (evidence: `js/orderview.js`)
- Document preview → PDF.js: renders PDFs (evidence: `js/preview.js`)
- Document preview → Mammoth.js: converts DOCX (evidence: `js/preview.js`)
- Customer → Security information: reads security notes (evidence: `README.md`)
- Landing page → Shared footer: uses shared footer (evidence: `README.md`)
- Order form → Shared footer: uses shared footer (evidence: `README.md`)
- Customer tracking → Shared footer: uses shared footer (evidence: `README.md`)
- Security information → Shared footer: uses shared footer (evidence: `README.md`)
