# smt12000/sale-report-dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/smt12000/sale-report-dashboard
- Repository: https://github.com/smt12000/sale-report-dashboard

## Overview

Sales Studio is a local THB sales dashboard. Its main workflow is to import sales and target spreadsheets, review the detected records, save them in a browser workspace, and view forecasts and historical evaluation. The README also documents workspace recovery and preferences, currency lookup, and optional text translation. The excerpts do not include the dashboard or domain module implementations, so some internal wiring is omitted; the documented capabilities and sampled local API behavior guide this map.

Main entry points: [`dist/app.js`](https://github.com/smt12000/sale-report-dashboard/blob/main/dist/app.js) (Application runtime), [`dist/import-worker.js`](https://github.com/smt12000/sale-report-dashboard/blob/main/dist/import-worker.js) (Spreadsheet import), [`scripts/api.mjs`](https://github.com/smt12000/sale-report-dashboard/blob/main/scripts/api.mjs) (Local API routes), [`dist/index.html`](https://github.com/smt12000/sale-report-dashboard/blob/main/dist/index.html) (Dashboard interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard workflow"]
  node_ui["Dashboard interface<br/>[index.html]"]
  node_app["Application runtime<br/>[app.js]"]
end

subgraph group_sales["Sales processing"]
  node_import["Spreadsheet import<br/>[import-worker.js]"]
  node_flexible["Flexible periods<br/>[flexible.js]"]
  node_io["CSV and records<br/>[io.js]"]
  node_domain["Sales domain<br/>[domain.js]"]
  node_analysis["Forecast evaluation<br/>[analysis-worker.js]"]
end

subgraph group_workspace["Workspace state"]
  node_storage["Workspace persistence<br/>[storage.js]"]
  node_browserdb[("Browser workspace")]
  node_language["Interface languages<br/>[i18n.js]"]
end

subgraph group_integrations["External integrations"]
  node_server["Local web server<br/>[serve.mjs]"]
  node_api["Local API routes<br/>[api.mjs]"]
end

node_person(("Dashboard user"))
node_frankfurter["Frankfurter rates"]
node_google["Google Translation"]

node_person -->|"uses"| node_ui
node_ui -->|"loads"| node_app
node_app -->|"dispatches import"| node_import
node_import -->|"detects periods"| node_flexible
node_import -->|"parses records"| node_io
node_app -->|"uses sales rules"| node_domain
node_app -->|"dispatches evaluation"| node_analysis
node_app -->|"reads and saves"| node_storage
node_storage -->|"persists workspace"| node_browserdb
node_app -->|"uses translations"| node_language
node_app -->|"requests local APIs"| node_server
node_server -->|"dispatches API routes"| node_api
node_api -.->|"fetches rates"| node_frankfurter
node_api -.->|"sends requested text"| node_google

click node_ui "https://github.com/smt12000/sale-report-dashboard/blob/main/dist/index.html"
click node_app "https://github.com/smt12000/sale-report-dashboard/blob/main/dist/app.js"
click node_import "https://github.com/smt12000/sale-report-dashboard/blob/main/dist/import-worker.js"
click node_flexible "https://github.com/smt12000/sale-report-dashboard/blob/main/dist/flexible.js"
click node_io "https://github.com/smt12000/sale-report-dashboard/blob/main/dist/io.js"
click node_domain "https://github.com/smt12000/sale-report-dashboard/blob/main/dist/domain.js"
click node_analysis "https://github.com/smt12000/sale-report-dashboard/blob/main/dist/analysis-worker.js"
click node_storage "https://github.com/smt12000/sale-report-dashboard/blob/main/dist/storage.js"
click node_language "https://github.com/smt12000/sale-report-dashboard/blob/main/dist/i18n.js"
click node_server "https://github.com/smt12000/sale-report-dashboard/blob/main/scripts/serve.mjs"
click node_api "https://github.com/smt12000/sale-report-dashboard/blob/main/scripts/api.mjs"

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_ui,node_app,node_person toneBlue
class node_import,node_flexible,node_io,node_domain,node_analysis toneAmber
class node_storage,node_browserdb,node_language toneMint
class node_server,node_api toneRose
class node_frankfurter,node_google toneIndigo
```

## Components

### Dashboard workflow

- [Dashboard interface](https://github.com/smt12000/sale-report-dashboard/blob/main/dist/index.html): `dist/index.html`
- [Application runtime](https://github.com/smt12000/sale-report-dashboard/blob/main/dist/app.js): `dist/app.js`

### Sales processing

- [Spreadsheet import](https://github.com/smt12000/sale-report-dashboard/blob/main/dist/import-worker.js): `dist/import-worker.js`
- [Flexible periods](https://github.com/smt12000/sale-report-dashboard/blob/main/dist/flexible.js): `dist/flexible.js`
- [CSV and records](https://github.com/smt12000/sale-report-dashboard/blob/main/dist/io.js): `dist/io.js`
- [Sales domain](https://github.com/smt12000/sale-report-dashboard/blob/main/dist/domain.js): `dist/domain.js`
- [Forecast evaluation](https://github.com/smt12000/sale-report-dashboard/blob/main/dist/analysis-worker.js): `dist/analysis-worker.js`

### Workspace state

- [Workspace persistence](https://github.com/smt12000/sale-report-dashboard/blob/main/dist/storage.js): `dist/storage.js`
- **Browser workspace**
- [Interface languages](https://github.com/smt12000/sale-report-dashboard/blob/main/dist/i18n.js): `dist/i18n.js`

### External integrations

- [Local web server](https://github.com/smt12000/sale-report-dashboard/blob/main/scripts/serve.mjs): `scripts/serve.mjs`
- [Local API routes](https://github.com/smt12000/sale-report-dashboard/blob/main/scripts/api.mjs): `scripts/api.mjs`

### Other components

- **Dashboard user**
- **Frankfurter rates**
- **Google Translation**

## Connections

- Dashboard user → Dashboard interface: uses
- Dashboard interface → Application runtime: loads
- Application runtime → Spreadsheet import: dispatches import
- Spreadsheet import → Flexible periods: detects periods
- Spreadsheet import → CSV and records: parses records
- Application runtime → Sales domain: uses sales rules
- Application runtime → Forecast evaluation: dispatches evaluation
- Application runtime → Workspace persistence: reads and saves
- Workspace persistence → Browser workspace: persists workspace
- Application runtime → Interface languages: uses translations
- Application runtime → Local web server: requests local APIs
- Local web server → Local API routes: dispatches API routes
- Local API routes → Frankfurter rates: fetches rates
- Local API routes → Google Translation: sends requested text
