# pm-ntshn/sale-tool architecture

> Architecture diagram of the GitHub repository pm-ntshn/sale-tool, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pm-ntshn/sale-tool
- Repository: https://github.com/pm-ntshn/sale-tool

## Overview

NTS Hà Nội’s Sale/Presale knowledge repository combines a desktop solution directory and original HTML guides/quizzes with NTS Learn, a mobile-friendly PWA. The main learner workflow is to browse or search solution material, study flashcards with spaced repetition, take quizzes, and track or export progress. A separate scheduled reminder sends rotating quiz questions through Telegram; the PWA also caches app assets and data for offline use. The graph reflects README capabilities and sampled code; unsampled UI wiring is represented only where documented.

Main entry points: [`app/app.js`](https://github.com/pm-ntshn/sale-tool/blob/main/app/app.js) (Learning logic), [`tools/send-reminder.js`](https://github.com/pm-ntshn/sale-tool/blob/main/tools/send-reminder.js) (Telegram reminder sender), [`index.html`](https://github.com/pm-ntshn/sale-tool/blob/main/index.html) (Solution directory), [`app/sw.js`](https://github.com/pm-ntshn/sale-tool/blob/main/app/sw.js) (Offline service worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_content["Solution knowledge"]
  node_directory["Solution directory<br/>[index.html]"]
  node_guides["Sale guides"]
  node_quizzes["Solution quizzes"]
end

subgraph group_learning["NTS Learn"]
  node_mobile["NTS Learn interface<br/>[index.html]"]
  node_app["Learning logic<br/>[app.js]"]
  node_catalog["Guide catalog<br/>[catalog.json]"]
  node_questionbank["Question bank<br/>[questions.json]"]
  node_progress[("On-device progress<br/>[app.js]")]
end

subgraph group_delivery["Offline and reminders"]
  node_sw["Offline service worker<br/>[sw.js]"]
  node_reminder["Telegram reminder sender<br/>[send-reminder.js]"]
end

node_learner(("Learner"))
node_telegram{{"Telegram"}}

node_learner -->|"browses"| node_directory
node_directory -->|"opens guide"| node_guides
node_directory -->|"opens quiz"| node_quizzes
node_learner -->|"uses"| node_mobile
node_mobile -->|"runs"| node_app
node_app -->|"reads"| node_catalog
node_app -->|"reads"| node_questionbank
node_app -->|"links to source"| node_guides
node_app -->|"reads and writes"| node_progress
node_app -->|"registers"| node_sw
node_sw -->|"caches and refreshes"| node_catalog
node_sw -->|"caches and refreshes"| node_questionbank
node_reminder -->|"reads questions"| node_questionbank
node_reminder -->|"reads solution names"| node_catalog
node_reminder -->|"sends quiz"| node_telegram

click node_directory "https://github.com/pm-ntshn/sale-tool/blob/main/index.html"
click node_guides "https://github.com/pm-ntshn/sale-tool/blob/main/Delinea/Delinea_Sale%20playbook.html"
click node_quizzes "https://github.com/pm-ntshn/sale-tool/blob/main/Delinea/Delinea_Sale_quiz.html"
click node_mobile "https://github.com/pm-ntshn/sale-tool/blob/main/app/index.html"
click node_app "https://github.com/pm-ntshn/sale-tool/blob/main/app/app.js"
click node_catalog "https://github.com/pm-ntshn/sale-tool/blob/main/app/data/catalog.json"
click node_questionbank "https://github.com/pm-ntshn/sale-tool/blob/main/app/data/questions.json"
click node_progress "https://github.com/pm-ntshn/sale-tool/blob/main/app/app.js"
click node_sw "https://github.com/pm-ntshn/sale-tool/blob/main/app/sw.js"
click node_reminder "https://github.com/pm-ntshn/sale-tool/blob/main/tools/send-reminder.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_directory,node_guides,node_quizzes toneBlue
class node_mobile,node_app,node_catalog,node_questionbank,node_progress toneAmber
class node_sw,node_reminder toneMint
class node_learner,node_telegram toneIndigo
```

## Components

### Solution knowledge

- [Solution directory](https://github.com/pm-ntshn/sale-tool/blob/main/index.html): `index.html`
- [Sale guides](https://github.com/pm-ntshn/sale-tool/blob/main/Delinea/Delinea_Sale%20playbook.html): `Delinea/Delinea_Sale playbook.html`
- [Solution quizzes](https://github.com/pm-ntshn/sale-tool/blob/main/Delinea/Delinea_Sale_quiz.html): `Delinea/Delinea_Sale_quiz.html`

### NTS Learn

- [NTS Learn interface](https://github.com/pm-ntshn/sale-tool/blob/main/app/index.html): `app/index.html`
- [Learning logic](https://github.com/pm-ntshn/sale-tool/blob/main/app/app.js): `app/app.js`
- [Guide catalog](https://github.com/pm-ntshn/sale-tool/blob/main/app/data/catalog.json): `app/data/catalog.json`
- [Question bank](https://github.com/pm-ntshn/sale-tool/blob/main/app/data/questions.json): `app/data/questions.json`
- [On-device progress](https://github.com/pm-ntshn/sale-tool/blob/main/app/app.js): `app/app.js`

### Offline and reminders

- [Offline service worker](https://github.com/pm-ntshn/sale-tool/blob/main/app/sw.js): `app/sw.js`
- [Telegram reminder sender](https://github.com/pm-ntshn/sale-tool/blob/main/tools/send-reminder.js): `tools/send-reminder.js`

### Other components

- **Learner**
- **Telegram**

## Connections

- Learner → Solution directory: browses
- Solution directory → Sale guides: opens guide
- Solution directory → Solution quizzes: opens quiz
- Learner → NTS Learn interface: uses
- NTS Learn interface → Learning logic: runs
- Learning logic → Guide catalog: reads
- Learning logic → Question bank: reads
- Learning logic → Sale guides: links to source
- Learning logic → On-device progress: reads and writes
- Learning logic → Offline service worker: registers
- Offline service worker → Guide catalog: caches and refreshes
- Offline service worker → Question bank: caches and refreshes
- Telegram reminder sender → Question bank: reads questions
- Telegram reminder sender → Guide catalog: reads solution names
- Telegram reminder sender → Telegram: sends quiz
