# kundarwork-debug/side-quote-generator architecture

> Architecture diagram of the GitHub repository kundarwork-debug/side-quote-generator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kundarwork-debug/side-quote-generator
- Repository: https://github.com/kundarwork-debug/side-quote-generator

## Overview

APML Portal is a collection of logistics and operations tools. The main documented workflow is drafting a quotation, applying freight and insurance calculations, and exporting an A4 PDF. Separate capabilities cover volumetric and vehicle-rate calculations, media and branch lookup, file access, and operational notifications. Shared browser UI and offline caching support the tools; chat, alerts, and uploads use external services. Relationships are limited to README statements and sampled source; unsampled page wiring is not assumed.

Main entry points: [`editor.html`](https://github.com/kundarwork-debug/side-quote-generator/blob/main/editor.html) (Quotation studio), [`chat.js`](https://github.com/kundarwork-debug/side-quote-generator/blob/main/chat.js) (Assistant chat), [`notify.js`](https://github.com/kundarwork-debug/side-quote-generator/blob/main/notify.js) (Alerts and announcements), [`sw.js`](https://github.com/kundarwork-debug/side-quote-generator/blob/main/sw.js) (Offline caching)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_quoting["Quotations and rates"]
  node_editor["Quotation studio<br/>[editor.html]"]
  node_freight["Freight formulas<br/>[editor.html]"]
  node_pdf["A4 PDF export<br/>[editor.html]"]
  node_apml["APML Lite<br/>[APML-Lite.html]"]
  node_car["Car relocation rates<br/>[car-rate.html]"]
  node_local["Local rates<br/>[local-rate.html]"]
end

subgraph group_operations["Operations tools"]
  node_gallery["Packing media hub<br/>[gallery.html]"]
  node_directory["Branch directory<br/>[directory.html]"]
  node_drive["File drive<br/>[drive.html]"]
end

subgraph group_shared["Shared portal features"]
  node_chat["Assistant chat<br/>[chat.js]"]
  node_portal_ui["Shared UI and mascot<br/>[common.js]"]
  node_notify["Alerts and announcements<br/>[notify.js]"]
  node_offline[("Offline caching<br/>[sw.js]")]
end

subgraph group_services["External services"]
  node_upload["Upload proxy<br/>[upload.js]"]
  node_ai_worker{{"Chat and alert worker"}}
  node_telegram{{"Telegram"}}
  node_catbox{{"Catbox file host"}}
end

node_visitor(("Portal user"))

node_visitor -->|"drafts quote"| node_editor
node_editor -->|"calculates freight"| node_freight
node_editor -->|"exports PDF"| node_pdf
node_visitor -->|"calculates volume"| node_apml
node_visitor -->|"calculates car rate"| node_car
node_visitor -.->|"checks local rates"| node_local
node_visitor -->|"views media"| node_gallery
node_visitor -->|"looks up branches"| node_directory
node_visitor -.->|"accesses files"| node_drive
node_chat -->|"sends questions"| node_ai_worker
node_notify -->|"posts alerts"| node_ai_worker
node_ai_worker -.->|"delivers messages"| node_telegram
node_upload -->|"uploads files"| node_catbox
node_offline -->|"caches assets"| node_portal_ui

click node_editor "https://github.com/kundarwork-debug/side-quote-generator/blob/main/editor.html"
click node_freight "https://github.com/kundarwork-debug/side-quote-generator/blob/main/editor.html"
click node_pdf "https://github.com/kundarwork-debug/side-quote-generator/blob/main/editor.html"
click node_apml "https://github.com/kundarwork-debug/side-quote-generator/blob/main/APML-Lite.html"
click node_car "https://github.com/kundarwork-debug/side-quote-generator/blob/main/car-rate.html"
click node_local "https://github.com/kundarwork-debug/side-quote-generator/blob/main/local-rate.html"
click node_gallery "https://github.com/kundarwork-debug/side-quote-generator/blob/main/gallery.html"
click node_directory "https://github.com/kundarwork-debug/side-quote-generator/blob/main/directory.html"
click node_drive "https://github.com/kundarwork-debug/side-quote-generator/blob/main/drive.html"
click node_chat "https://github.com/kundarwork-debug/side-quote-generator/blob/main/chat.js"
click node_portal_ui "https://github.com/kundarwork-debug/side-quote-generator/blob/main/common.js"
click node_notify "https://github.com/kundarwork-debug/side-quote-generator/blob/main/notify.js"
click node_offline "https://github.com/kundarwork-debug/side-quote-generator/blob/main/sw.js"
click node_upload "https://github.com/kundarwork-debug/side-quote-generator/blob/main/api/upload.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_editor,node_freight,node_pdf,node_apml,node_car,node_local,node_visitor toneBlue
class node_gallery,node_directory,node_drive toneAmber
class node_chat,node_portal_ui,node_notify,node_offline toneMint
class node_upload,node_ai_worker,node_telegram,node_catbox toneRose
```

## Components

### Quotations and rates

- [Quotation studio](https://github.com/kundarwork-debug/side-quote-generator/blob/main/editor.html): `editor.html`
- [Freight formulas](https://github.com/kundarwork-debug/side-quote-generator/blob/main/editor.html): `editor.html`
- [A4 PDF export](https://github.com/kundarwork-debug/side-quote-generator/blob/main/editor.html): `editor.html`
- [APML Lite](https://github.com/kundarwork-debug/side-quote-generator/blob/main/APML-Lite.html): `APML-Lite.html`
- [Car relocation rates](https://github.com/kundarwork-debug/side-quote-generator/blob/main/car-rate.html): `car-rate.html`
- [Local rates](https://github.com/kundarwork-debug/side-quote-generator/blob/main/local-rate.html): `local-rate.html`

### Operations tools

- [Packing media hub](https://github.com/kundarwork-debug/side-quote-generator/blob/main/gallery.html): `gallery.html`
- [Branch directory](https://github.com/kundarwork-debug/side-quote-generator/blob/main/directory.html): `directory.html`
- [File drive](https://github.com/kundarwork-debug/side-quote-generator/blob/main/drive.html): `drive.html`

### Shared portal features

- [Assistant chat](https://github.com/kundarwork-debug/side-quote-generator/blob/main/chat.js): `chat.js`
- [Shared UI and mascot](https://github.com/kundarwork-debug/side-quote-generator/blob/main/common.js): `common.js`
- [Alerts and announcements](https://github.com/kundarwork-debug/side-quote-generator/blob/main/notify.js): `notify.js`
- [Offline caching](https://github.com/kundarwork-debug/side-quote-generator/blob/main/sw.js): `sw.js`

### External services

- [Upload proxy](https://github.com/kundarwork-debug/side-quote-generator/blob/main/api/upload.js): `api/upload.js`
- **Chat and alert worker**
- **Telegram**
- **Catbox file host**

### Other components

- **Portal user**

## Connections

- Portal user → Quotation studio: drafts quote (evidence: `readme.md`)
- Quotation studio → Freight formulas: calculates freight (evidence: `readme.md`)
- Quotation studio → A4 PDF export: exports PDF (evidence: `readme.md`)
- Portal user → APML Lite: calculates volume (evidence: `readme.md`)
- Portal user → Car relocation rates: calculates car rate (evidence: `readme.md`)
- Portal user → Local rates: checks local rates
- Portal user → Packing media hub: views media (evidence: `readme.md`)
- Portal user → Branch directory: looks up branches (evidence: `readme.md`)
- Portal user → File drive: accesses files
- Assistant chat → Chat and alert worker: sends questions (evidence: `chat.js`)
- Alerts and announcements → Chat and alert worker: posts alerts (evidence: `notify.js`)
- Chat and alert worker → Telegram: delivers messages
- Upload proxy → Catbox file host: uploads files (evidence: `api/upload.js`)
- Offline caching → Shared UI and mascot: caches assets (evidence: `sw.js`)
