# thistlelonious/dashboard architecture

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

## Overview

coinvoice is an offline-capable craft-business app for pricing projects, tracking stock, and handling customer documents. The main workflow starts at Home, where a user creates a project, then uses Price to calculate its labor and price; Stock records purchases and adjustments. App parses hash routes and dispatches screens. Sampled code confirms project and inventory screens read or write through the store; invoice, document, print, item, and setup screens are present in the tree but their internal workflows were not sampled. The README is empty, so those branches are limited to documented-by-route capabilities.

Main entry points: [`src/App.tsx`](https://github.com/thistlelonious/dashboard/blob/main/src/App.tsx) (App shell), [`src/screens/Price/PriceScreen.tsx`](https://github.com/thistlelonious/dashboard/blob/main/src/screens/Price/PriceScreen.tsx) (Price calculator screen), [`src/main.tsx`](https://github.com/thistlelonious/dashboard/blob/main/src/main.tsx) (Application entry), [`src/screens/Stock/StockScreen.tsx`](https://github.com/thistlelonious/dashboard/blob/main/src/screens/Stock/StockScreen.tsx) (Stock screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["App screens"]
  node_app["App shell<br/>[App.tsx]"]
  node_routes["Hash routes<br/>[routes.ts]"]
  node_home["Home and projects<br/>[HomeScreen.tsx]"]
  node_price["Price calculator screen<br/>[PriceScreen.tsx]"]
  node_build["Project build"]
  node_stock["Stock screen<br/>[StockScreen.tsx]"]
  node_item["Inventory item<br/>[ItemScreen.tsx]"]
  node_invoices["Invoices screen<br/>[InvoicesScreen.tsx]"]
  node_document["Customer document<br/>[DocumentScreen.tsx]"]
  node_print["Document printing<br/>[PrintScreen.tsx]"]
  node_setup["Setup screen<br/>[SetupScreen.tsx]"]
end

subgraph group_domain["Business logic"]
  node_calculator["Calculator logic<br/>[calculator.ts]"]
  node_pricing["Pricing engine<br/>[pricing.ts]"]
  node_domains["Craft domains<br/>[index.ts]"]
  node_fees["Fee presets<br/>[fees.ts]"]
  node_ledger["Stock ledger<br/>[ledger.ts]"]
  node_units["Unit conversion<br/>[units.ts]"]
end

subgraph group_data["Local data"]
  node_store["Application store<br/>[store.ts]"]
  node_db[("IndexedDB schema<br/>[db.ts]")]
  node_backup["Backup handling<br/>[backup.ts]"]
  node_persistence["Storage persistence<br/>[persistence.ts]"]
end

subgraph group_runtime["Offline runtime"]
  node_entry["Application entry<br/>[main.tsx]"]
  node_offline["Offline support<br/>[offline.ts]"]
  node_design["Theme and controls<br/>[bundle.js]"]
end

node_maker(("Craft business user"))

node_maker -->|"uses"| node_app
node_app -->|"parses route"| node_routes
node_app -->|"dispatches"| node_home
node_app -->|"dispatches"| node_price
node_app -->|"dispatches"| node_build
node_app -->|"dispatches"| node_stock
node_app -->|"dispatches"| node_item
node_app -->|"dispatches"| node_invoices
node_app -->|"dispatches"| node_document
node_app -->|"dispatches"| node_print
node_app -->|"dispatches"| node_setup
node_home -->|"reads and creates projects"| node_store
node_price -->|"reads and updates projects"| node_store
node_price -->|"calculates"| node_calculator
node_price -->|"selects craft"| node_domains
node_price -->|"selects fees"| node_fees
node_stock -->|"reads and records stock"| node_store
node_stock -->|"replays inventory"| node_ledger
node_stock -->|"uses units"| node_units
node_app -->|"checks reminder"| node_backup
node_entry -->|"renders"| node_app
node_entry -->|"enables offline"| node_offline
node_entry -->|"keeps storage"| node_persistence
node_entry -->|"restores theme"| node_design
node_app -->|"hydrates controls"| node_design

click node_app "https://github.com/thistlelonious/dashboard/blob/main/src/App.tsx"
click node_routes "https://github.com/thistlelonious/dashboard/blob/main/src/routes.ts"
click node_home "https://github.com/thistlelonious/dashboard/blob/main/src/screens/Home/HomeScreen.tsx"
click node_price "https://github.com/thistlelonious/dashboard/blob/main/src/screens/Price/PriceScreen.tsx"
click node_stock "https://github.com/thistlelonious/dashboard/blob/main/src/screens/Stock/StockScreen.tsx"
click node_item "https://github.com/thistlelonious/dashboard/blob/main/src/screens/Item/ItemScreen.tsx"
click node_invoices "https://github.com/thistlelonious/dashboard/blob/main/src/screens/Invoices/InvoicesScreen.tsx"
click node_document "https://github.com/thistlelonious/dashboard/blob/main/src/screens/Document/DocumentScreen.tsx"
click node_print "https://github.com/thistlelonious/dashboard/blob/main/src/screens/Print/PrintScreen.tsx"
click node_setup "https://github.com/thistlelonious/dashboard/blob/main/src/screens/Setup/SetupScreen.tsx"
click node_calculator "https://github.com/thistlelonious/dashboard/blob/main/src/screens/Price/calculator.ts"
click node_pricing "https://github.com/thistlelonious/dashboard/blob/main/src/pricing/pricing.ts"
click node_domains "https://github.com/thistlelonious/dashboard/blob/main/src/pricing/domains/index.ts"
click node_fees "https://github.com/thistlelonious/dashboard/blob/main/src/pricing/fees.ts"
click node_ledger "https://github.com/thistlelonious/dashboard/blob/main/src/inventory/ledger.ts"
click node_units "https://github.com/thistlelonious/dashboard/blob/main/src/inventory/units.ts"
click node_store "https://github.com/thistlelonious/dashboard/blob/main/src/storage/store.ts"
click node_db "https://github.com/thistlelonious/dashboard/blob/main/src/storage/db.ts"
click node_backup "https://github.com/thistlelonious/dashboard/blob/main/src/storage/backup.ts"
click node_persistence "https://github.com/thistlelonious/dashboard/blob/main/src/storage/persistence.ts"
click node_entry "https://github.com/thistlelonious/dashboard/blob/main/src/main.tsx"
click node_offline "https://github.com/thistlelonious/dashboard/blob/main/src/offline.ts"
click node_design "https://github.com/thistlelonious/dashboard/blob/main/src/design/sewandso/bundle.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_app,node_routes,node_home,node_price,node_build,node_stock,node_item,node_invoices,node_document,node_print,node_setup,node_maker toneBlue
class node_calculator,node_pricing,node_domains,node_fees,node_ledger,node_units toneAmber
class node_store,node_db,node_backup,node_persistence toneMint
class node_entry,node_offline,node_design toneRose
```

## Components

### App screens

- [App shell](https://github.com/thistlelonious/dashboard/blob/main/src/App.tsx): `src/App.tsx`
- [Hash routes](https://github.com/thistlelonious/dashboard/blob/main/src/routes.ts): `src/routes.ts`
- [Home and projects](https://github.com/thistlelonious/dashboard/blob/main/src/screens/Home/HomeScreen.tsx): `src/screens/Home/HomeScreen.tsx`
- [Price calculator screen](https://github.com/thistlelonious/dashboard/blob/main/src/screens/Price/PriceScreen.tsx): `src/screens/Price/PriceScreen.tsx`
- **Project build**
- [Stock screen](https://github.com/thistlelonious/dashboard/blob/main/src/screens/Stock/StockScreen.tsx): `src/screens/Stock/StockScreen.tsx`
- [Inventory item](https://github.com/thistlelonious/dashboard/blob/main/src/screens/Item/ItemScreen.tsx): `src/screens/Item/ItemScreen.tsx`
- [Invoices screen](https://github.com/thistlelonious/dashboard/blob/main/src/screens/Invoices/InvoicesScreen.tsx): `src/screens/Invoices/InvoicesScreen.tsx`
- [Customer document](https://github.com/thistlelonious/dashboard/blob/main/src/screens/Document/DocumentScreen.tsx): `src/screens/Document/DocumentScreen.tsx`
- [Document printing](https://github.com/thistlelonious/dashboard/blob/main/src/screens/Print/PrintScreen.tsx): `src/screens/Print/PrintScreen.tsx`
- [Setup screen](https://github.com/thistlelonious/dashboard/blob/main/src/screens/Setup/SetupScreen.tsx): `src/screens/Setup/SetupScreen.tsx`

### Business logic

- [Calculator logic](https://github.com/thistlelonious/dashboard/blob/main/src/screens/Price/calculator.ts): `src/screens/Price/calculator.ts`
- [Pricing engine](https://github.com/thistlelonious/dashboard/blob/main/src/pricing/pricing.ts): `src/pricing/pricing.ts`
- [Craft domains](https://github.com/thistlelonious/dashboard/blob/main/src/pricing/domains/index.ts): `src/pricing/domains/index.ts`
- [Fee presets](https://github.com/thistlelonious/dashboard/blob/main/src/pricing/fees.ts): `src/pricing/fees.ts`
- [Stock ledger](https://github.com/thistlelonious/dashboard/blob/main/src/inventory/ledger.ts): `src/inventory/ledger.ts`
- [Unit conversion](https://github.com/thistlelonious/dashboard/blob/main/src/inventory/units.ts): `src/inventory/units.ts`

### Local data

- [Application store](https://github.com/thistlelonious/dashboard/blob/main/src/storage/store.ts): `src/storage/store.ts`
- [IndexedDB schema](https://github.com/thistlelonious/dashboard/blob/main/src/storage/db.ts): `src/storage/db.ts`
- [Backup handling](https://github.com/thistlelonious/dashboard/blob/main/src/storage/backup.ts): `src/storage/backup.ts`
- [Storage persistence](https://github.com/thistlelonious/dashboard/blob/main/src/storage/persistence.ts): `src/storage/persistence.ts`

### Offline runtime

- [Application entry](https://github.com/thistlelonious/dashboard/blob/main/src/main.tsx): `src/main.tsx`
- [Offline support](https://github.com/thistlelonious/dashboard/blob/main/src/offline.ts): `src/offline.ts`
- [Theme and controls](https://github.com/thistlelonious/dashboard/blob/main/src/design/sewandso/bundle.js): `src/design/sewandso/bundle.js`

### Other components

- **Craft business user**

## Connections

- Craft business user → App shell: uses
- App shell → Hash routes: parses route
- App shell → Home and projects: dispatches
- App shell → Price calculator screen: dispatches
- App shell → Project build: dispatches
- App shell → Stock screen: dispatches
- App shell → Inventory item: dispatches
- App shell → Invoices screen: dispatches
- App shell → Customer document: dispatches
- App shell → Document printing: dispatches
- App shell → Setup screen: dispatches
- Home and projects → Application store: reads and creates projects
- Price calculator screen → Application store: reads and updates projects
- Price calculator screen → Calculator logic: calculates
- Price calculator screen → Craft domains: selects craft
- Price calculator screen → Fee presets: selects fees
- Stock screen → Application store: reads and records stock
- Stock screen → Stock ledger: replays inventory
- Stock screen → Unit conversion: uses units
- App shell → Backup handling: checks reminder
- Application entry → App shell: renders
- Application entry → Offline support: enables offline
- Application entry → Storage persistence: keeps storage
- Application entry → Theme and controls: restores theme
- App shell → Theme and controls: hydrates controls
