# 4silvertooth/qwiktape architecture

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

- Interactive diagram: https://gitdiagram.com/4silvertooth/qwiktape
- Repository: https://github.com/4silvertooth/qwiktape

## Overview

QwikTape is a Sciter desktop calculator/notebook for annotated calculation tapes. A user edits a tape in the editor; the editor lexes, parses, evaluates, formats, and highlights expressions, then emits updates for autosave. Tapes are persisted and can be revisited through tabs or the storage browser. Settings control locale, precision, indentation, colors, and keyboard behavior. The editor can also render the evaluated tape as PDF. The sampled source confirms these core boundaries; some event-handling orchestration in main.htm was not sampled.

Main entry points: [`src/components/editor.js`](https://github.com/4silvertooth/qwiktape/blob/main/src/components/editor.js) (Tape Editor), [`src/storage/storage.js`](https://github.com/4silvertooth/qwiktape/blob/main/src/storage/storage.js) (Tape State), [`src/main.htm`](https://github.com/4silvertooth/qwiktape/blob/main/src/main.htm) (Application Entry), [`src/util/pdf.js`](https://github.com/4silvertooth/qwiktape/blob/main/src/util/pdf.js) (PDF Export)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["Desktop Shell"]
  node_native_shell["Native Shell<br/>[qwiktape.cpp]"]
  node_app_entry["Application Entry<br/>[main.htm]"]
end

subgraph group_workspace["Tape Workspace"]
  node_tabs["Tape Tabs<br/>[tabs.js]"]
  node_editor["Tape Editor<br/>[editor.js]"]
  node_tape_browser["Tape Browser<br/>[browse-storage.js]"]
  node_settings_ui["Settings Form<br/>[settings.js]"]
end

subgraph group_engine["Calculation Engine"]
  node_parser["Tape Parser<br/>[tape-embedded.js]"]
  node_numeric_engine["Big Number Engine<br/>[bignum.js]"]
  node_locale_format["Locale Formatting<br/>[bignum.js]"]
end

subgraph group_persistence["Persistence And Export"]
  node_tape_state["Tape State<br/>[storage.js]"]
  node_tape_database[("Tape Database<br/>[storage.js]")]
  node_seed_tapes["Seed Tapes<br/>[seeds.js]"]
  node_pdf_export["PDF Export<br/>[pdf.js]"]
end

node_user(("User"))
node_pdf_library["PDF Library"]

node_user -->|"launches"| node_native_shell
node_native_shell -->|"loads"| node_app_entry
node_user -->|"edits tape"| node_editor
node_app_entry -->|"mounts"| node_tabs
node_app_entry -->|"mounts"| node_editor
node_app_entry -->|"mounts"| node_tape_browser
node_app_entry -->|"mounts"| node_settings_ui
node_editor -->|"parses tape"| node_parser
node_parser -->|"evaluates values"| node_numeric_engine
node_editor -->|"formats tokens"| node_locale_format
node_editor -->|"emits updates"| node_tape_state
node_tape_state -->|"commits tapes"| node_tape_database
node_tape_state -->|"loads seeds"| node_seed_tapes
node_tape_browser -->|"manages tapes"| node_tape_state
node_tabs -->|"selects tapes"| node_tape_state
node_settings_ui -->|"saves settings"| node_tape_state
node_user -.->|"requests export"| node_pdf_export
node_editor -.->|"renders tape"| node_pdf_export
node_pdf_export -.->|"uses library"| node_pdf_library

click node_native_shell "https://github.com/4silvertooth/qwiktape/blob/main/main/qwiktape.cpp"
click node_app_entry "https://github.com/4silvertooth/qwiktape/blob/main/src/main.htm"
click node_tabs "https://github.com/4silvertooth/qwiktape/blob/main/src/components/tabs.js"
click node_editor "https://github.com/4silvertooth/qwiktape/blob/main/src/components/editor.js"
click node_tape_browser "https://github.com/4silvertooth/qwiktape/blob/main/src/components/browse-storage.js"
click node_settings_ui "https://github.com/4silvertooth/qwiktape/blob/main/src/components/settings.js"
click node_parser "https://github.com/4silvertooth/qwiktape/blob/main/src/parser/tape-embedded.js"
click node_numeric_engine "https://github.com/4silvertooth/qwiktape/blob/main/src/parser/bignum.js"
click node_locale_format "https://github.com/4silvertooth/qwiktape/blob/main/src/parser/bignum.js"
click node_tape_state "https://github.com/4silvertooth/qwiktape/blob/main/src/storage/storage.js"
click node_tape_database "https://github.com/4silvertooth/qwiktape/blob/main/src/storage/storage.js"
click node_seed_tapes "https://github.com/4silvertooth/qwiktape/blob/main/src/storage/seeds.js"
click node_pdf_export "https://github.com/4silvertooth/qwiktape/blob/main/src/util/pdf.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_native_shell,node_app_entry,node_user toneBlue
class node_tabs,node_editor,node_tape_browser,node_settings_ui toneAmber
class node_parser,node_numeric_engine,node_locale_format toneMint
class node_tape_state,node_tape_database,node_seed_tapes,node_pdf_export toneRose
class node_pdf_library toneIndigo
```

## Components

### Desktop Shell

- [Native Shell](https://github.com/4silvertooth/qwiktape/blob/main/main/qwiktape.cpp): `main/qwiktape.cpp`
- [Application Entry](https://github.com/4silvertooth/qwiktape/blob/main/src/main.htm): `src/main.htm`

### Tape Workspace

- [Tape Tabs](https://github.com/4silvertooth/qwiktape/blob/main/src/components/tabs.js): `src/components/tabs.js`
- [Tape Editor](https://github.com/4silvertooth/qwiktape/blob/main/src/components/editor.js): `src/components/editor.js`
- [Tape Browser](https://github.com/4silvertooth/qwiktape/blob/main/src/components/browse-storage.js): `src/components/browse-storage.js`
- [Settings Form](https://github.com/4silvertooth/qwiktape/blob/main/src/components/settings.js): `src/components/settings.js`

### Calculation Engine

- [Tape Parser](https://github.com/4silvertooth/qwiktape/blob/main/src/parser/tape-embedded.js): `src/parser/tape-embedded.js`
- [Big Number Engine](https://github.com/4silvertooth/qwiktape/blob/main/src/parser/bignum.js): `src/parser/bignum.js`
- [Locale Formatting](https://github.com/4silvertooth/qwiktape/blob/main/src/parser/bignum.js): `src/parser/bignum.js`

### Persistence And Export

- [Tape State](https://github.com/4silvertooth/qwiktape/blob/main/src/storage/storage.js): `src/storage/storage.js`
- [Tape Database](https://github.com/4silvertooth/qwiktape/blob/main/src/storage/storage.js): `src/storage/storage.js`
- [Seed Tapes](https://github.com/4silvertooth/qwiktape/blob/main/src/storage/seeds.js): `src/storage/seeds.js`
- [PDF Export](https://github.com/4silvertooth/qwiktape/blob/main/src/util/pdf.js): `src/util/pdf.js`

### Other components

- **User**
- **PDF Library**

## Connections

- User → Native Shell: launches
- Native Shell → Application Entry: loads
- User → Tape Editor: edits tape
- Application Entry → Tape Tabs: mounts
- Application Entry → Tape Editor: mounts
- Application Entry → Tape Browser: mounts
- Application Entry → Settings Form: mounts
- Tape Editor → Tape Parser: parses tape
- Tape Parser → Big Number Engine: evaluates values
- Tape Editor → Locale Formatting: formats tokens
- Tape Editor → Tape State: emits updates
- Tape State → Tape Database: commits tapes
- Tape State → Seed Tapes: loads seeds
- Tape Browser → Tape State: manages tapes
- Tape Tabs → Tape State: selects tapes
- Settings Form → Tape State: saves settings
- User → PDF Export: requests export
- Tape Editor → PDF Export: renders tape
- PDF Export → PDF Library: uses library
