# readyboxsystems/quoin architecture

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

- Interactive diagram: https://gitdiagram.com/readyboxsystems/quoin
- Repository: https://github.com/readyboxsystems/quoin

## Overview

Quoin is a local-first spreadsheet workflow prototype. Authors create or import a workbook, verify its formulas, promote and configure important cells as Smart Cells, then test surfaced inputs and outputs in Runner Preview and save configurations in the browser. The UI coordinates workbook editing and calculation; the formula engine evaluates cell dependencies and reports results and issues. Import reading and conversion are distinct stages. The excerpts show the UI-to-engine call and engine-to-parser import; README statements support the documented Runner and local-storage capabilities. Other unsampled implementation details are not inferred.

Main entry points: [`components/variable-sheet.tsx`](https://github.com/readyboxsystems/quoin/blob/main/components/variable-sheet.tsx) (Sheet Editor), [`lib/engine/index.ts`](https://github.com/readyboxsystems/quoin/blob/main/lib/engine/index.ts) (Formula Engine), [`lib/import/convert.ts`](https://github.com/readyboxsystems/quoin/blob/main/lib/import/convert.ts) (Workbook Converter), [`app/page.tsx`](https://github.com/readyboxsystems/quoin/blob/main/app/page.tsx) (App Entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Workspace UI"]
  node_app["App Entry<br/>[page.tsx]"]
  node_sheet_ui["Sheet Editor<br/>[variable-sheet.tsx]"]
  node_smart_runner["Smart Cells &amp; Runner<br/>[variable-sheet.tsx]"]
  node_sheet_strip["Sheet Navigation<br/>[sheet-strip.tsx]"]
  node_command_menu["Command Menus<br/>[command-menu.tsx]"]
end

subgraph group_calculation["Workbook Calculation"]
  node_engine["Formula Engine<br/>[index.ts]"]
  node_formula["Formula Parser<br/>[model.ts]"]
  node_engine_types["Engine Models<br/>[types.ts]"]
end

subgraph group_importing["Workbook Import"]
  node_import_read["XLSX Reader<br/>[read.ts]"]
  node_import_convert["Workbook Converter<br/>[convert.ts]"]
  node_import_types["Import Models<br/>[types.ts]"]
end

subgraph group_state["Workbook State"]
  node_workbook_state["Workbook State &amp; History<br/>[state.ts]"]
  node_sheet_models["Sheet Models<br/>[types.ts]"]
  node_browser_storage[("Browser Local Storage")]
end

node_author(("Workbook Author"))
node_xlsx_file["Local XLSX File"]

node_author -->|"opens"| node_app
node_app -->|"renders"| node_sheet_ui
node_sheet_ui -->|"renders"| node_command_menu
node_sheet_ui -->|"renders"| node_sheet_strip
node_sheet_ui -->|"creates and updates"| node_workbook_state
node_sheet_ui -->|"executes workbook"| node_engine
node_engine -->|"rewrites formulas"| node_formula
node_smart_runner -->|"evaluates runner values"| node_engine
node_engine -->|"returns results"| node_smart_runner
node_author -->|"selects for import"| node_xlsx_file
node_sheet_ui -->|"reads workbook"| node_import_read
node_sheet_ui -->|"converts workbook"| node_import_convert
node_import_read -->|"produces imported model"| node_import_types
node_import_convert -->|"parses formulas"| node_formula
node_import_convert -->|"creates grid cells"| node_sheet_models
node_sheet_ui -->|"saves configurations"| node_browser_storage
node_workbook_state -->|"uses sheet types"| node_sheet_models
node_engine -->|"uses engine models"| node_engine_types

click node_app "https://github.com/readyboxsystems/quoin/blob/main/app/page.tsx"
click node_sheet_ui "https://github.com/readyboxsystems/quoin/blob/main/components/variable-sheet.tsx"
click node_smart_runner "https://github.com/readyboxsystems/quoin/blob/main/components/variable-sheet.tsx"
click node_sheet_strip "https://github.com/readyboxsystems/quoin/blob/main/components/sheet-strip.tsx"
click node_command_menu "https://github.com/readyboxsystems/quoin/blob/main/components/command-menu.tsx"
click node_engine "https://github.com/readyboxsystems/quoin/blob/main/lib/engine/index.ts"
click node_formula "https://github.com/readyboxsystems/quoin/blob/main/lib/formula/model.ts"
click node_engine_types "https://github.com/readyboxsystems/quoin/blob/main/lib/engine/types.ts"
click node_import_read "https://github.com/readyboxsystems/quoin/blob/main/lib/import/read.ts"
click node_import_convert "https://github.com/readyboxsystems/quoin/blob/main/lib/import/convert.ts"
click node_import_types "https://github.com/readyboxsystems/quoin/blob/main/lib/import/types.ts"
click node_workbook_state "https://github.com/readyboxsystems/quoin/blob/main/lib/workbook/state.ts"
click node_sheet_models "https://github.com/readyboxsystems/quoin/blob/main/lib/sheet/types.ts"

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_app,node_sheet_ui,node_smart_runner,node_sheet_strip,node_command_menu toneBlue
class node_engine,node_formula,node_engine_types toneAmber
class node_import_read,node_import_convert,node_import_types toneMint
class node_workbook_state,node_sheet_models,node_browser_storage toneRose
class node_author,node_xlsx_file toneIndigo
```

## Components

### Workspace UI

- [App Entry](https://github.com/readyboxsystems/quoin/blob/main/app/page.tsx): `app/page.tsx`
- [Sheet Editor](https://github.com/readyboxsystems/quoin/blob/main/components/variable-sheet.tsx): `components/variable-sheet.tsx`
- [Smart Cells & Runner](https://github.com/readyboxsystems/quoin/blob/main/components/variable-sheet.tsx): `components/variable-sheet.tsx`
- [Sheet Navigation](https://github.com/readyboxsystems/quoin/blob/main/components/sheet-strip.tsx): `components/sheet-strip.tsx`
- [Command Menus](https://github.com/readyboxsystems/quoin/blob/main/components/command-menu.tsx): `components/command-menu.tsx`

### Workbook Calculation

- [Formula Engine](https://github.com/readyboxsystems/quoin/blob/main/lib/engine/index.ts): `lib/engine/index.ts`
- [Formula Parser](https://github.com/readyboxsystems/quoin/blob/main/lib/formula/model.ts): `lib/formula/model.ts`
- [Engine Models](https://github.com/readyboxsystems/quoin/blob/main/lib/engine/types.ts): `lib/engine/types.ts`

### Workbook Import

- [XLSX Reader](https://github.com/readyboxsystems/quoin/blob/main/lib/import/read.ts): `lib/import/read.ts`
- [Workbook Converter](https://github.com/readyboxsystems/quoin/blob/main/lib/import/convert.ts): `lib/import/convert.ts`
- [Import Models](https://github.com/readyboxsystems/quoin/blob/main/lib/import/types.ts): `lib/import/types.ts`

### Workbook State

- [Workbook State & History](https://github.com/readyboxsystems/quoin/blob/main/lib/workbook/state.ts): `lib/workbook/state.ts`
- [Sheet Models](https://github.com/readyboxsystems/quoin/blob/main/lib/sheet/types.ts): `lib/sheet/types.ts`
- **Browser Local Storage**

### Other components

- **Workbook Author**
- **Local XLSX File**

## Connections

- Workbook Author → App Entry: opens (evidence: `README.md`)
- App Entry → Sheet Editor: renders (evidence: `app/page.tsx`)
- Sheet Editor → Command Menus: renders (evidence: `components/variable-sheet.tsx`)
- Sheet Editor → Sheet Navigation: renders (evidence: `components/variable-sheet.tsx`)
- Sheet Editor → Workbook State & History: creates and updates (evidence: `components/variable-sheet.tsx`)
- Sheet Editor → Formula Engine: executes workbook (evidence: `components/variable-sheet.tsx`)
- Formula Engine → Formula Parser: rewrites formulas (evidence: `lib/engine/index.ts`)
- Smart Cells & Runner → Formula Engine: evaluates runner values (evidence: `README.md`)
- Formula Engine → Smart Cells & Runner: returns results (evidence: `README.md`)
- Workbook Author → Local XLSX File: selects for import (evidence: `README.md`)
- Sheet Editor → XLSX Reader: reads workbook (evidence: `components/variable-sheet.tsx`)
- Sheet Editor → Workbook Converter: converts workbook (evidence: `components/variable-sheet.tsx`)
- XLSX Reader → Import Models: produces imported model (evidence: `lib/import/read.ts`)
- Workbook Converter → Formula Parser: parses formulas (evidence: `lib/import/convert.ts`)
- Workbook Converter → Sheet Models: creates grid cells (evidence: `lib/import/convert.ts`)
- Sheet Editor → Browser Local Storage: saves configurations (evidence: `README.md`)
- Workbook State & History → Sheet Models: uses sheet types (evidence: `lib/workbook/state.ts`)
- Formula Engine → Engine Models: uses engine models (evidence: `lib/engine/index.ts`)
