# aliuly/xlpricer architecture

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

- Interactive diagram: https://gitdiagram.com/aliuly/xlpricer
- Repository: https://github.com/aliuly/xlpricer

## Overview

XLpricer generates T-Cloud pricing workbooks: users configure assumptions, components, and deal details, then fetch pricing data and download an XLSX/XLSM projection; the current SPA also inspects, converts, trims, and reprices uploaded workbooks. Its workbook-generation pipeline enriches pricing inputs and writes pricing, volume, ESA, BOM, overview, and related workbook content. The legacy Python application offers a separate build/reprice workflow. The graph emphasizes documented capabilities and sampled call ownership; some feature links are omitted where implementation wiring was not sampled.

Main entry points: [`v2/src/mainApp/App.tsx`](https://github.com/aliuly/xlpricer/blob/main/v2/src/mainApp/App.tsx) (Mode and tabs), [`v2/src/homeTab/loadPricing.ts`](https://github.com/aliuly/xlpricer/blob/main/v2/src/homeTab/loadPricing.ts) (Load pricing), [`v2/src/homeTab/xlsxWorker.ts`](https://github.com/aliuly/xlpricer/blob/main/v2/src/homeTab/xlsxWorker.ts) (Generation worker), [`v1/xlpricer/wiz.py`](https://github.com/aliuly/xlpricer/blob/main/v1/xlpricer/wiz.py) (Python wizard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Current SPA"]
  node_entry["App entry<br/>[main.tsx]"]
  node_app["Mode and tabs<br/>[App.tsx]"]
  node_basic["Basic view<br/>[BasicView.tsx]"]
  node_home["Pricing home<br/>[HomeTab.tsx]"]
  node_assumptions["Assumption editor<br/>[AssumptionsTab.tsx]"]
  node_components["Component editor<br/>[ComponentsTab.tsx]"]
  node_includes["Includes editor<br/>[IncludesTab.tsx]"]
  node_deal["Deal details<br/>[useDealInfo.ts]"]
  node_generator["Generation hook"]
  node_include_payload["Include payload"]
end

subgraph group_pricing["Pricing Pipeline"]
  node_pricing_loader["Load pricing<br/>[loadPricing.ts]"]
  node_price_enrich["Enrich pricing<br/>[enrich.ts]"]
  node_price_normalize["Normalize pricing<br/>[normalize.ts]"]
  node_price_patch["Patch pricing<br/>[patching.ts]"]
end

subgraph group_workbooks["Workbook Operations"]
  node_xlsx_worker["Generation worker<br/>[xlsxWorker.ts]"]
  node_writer["Workbook writer<br/>[writer.ts]"]
  node_xlsx_sheets["Workbook features"]
  node_vba["Macro merge<br/>[vba.ts]"]
  node_workbook_ops["Workbook operations<br/>[useWorkbookOps.ts]"]
  node_workbook_ui["Conversion interface<br/>[WorkbookMode.tsx]"]
  node_workbook_worker["Workbook worker<br/>[workbookWorker.ts]"]
  node_convert["Convert and trim<br/>[convert.ts]"]
  node_reprice["Refresh workbook<br/>[reprice.ts]"]
end

subgraph group_legacy["Legacy Python"]
  node_legacy_ui["Python wizard<br/>[wiz.py]"]
  node_legacy_api["Price API<br/>[price_api.py]"]
  node_legacy_includes["Include prices<br/>[includes.py]"]
  node_legacy_filter["Pricing transforms<br/>[normalize.py]"]
  node_legacy_writer["Python workbook writer<br/>[xlsw.py]"]
end

node_user(("User"))
node_pricing_input(("Pricing sources"))
node_download(("Workbook download"))

node_user -->|"opens app"| node_entry
node_entry -->|"renders"| node_app
node_app -->|"selects basic"| node_basic
node_app -->|"selects pricing"| node_home
node_app -->|"shows editor"| node_assumptions
node_app -->|"shows editor"| node_components
node_app -->|"shows editor"| node_includes
node_app -->|"owns operations"| node_workbook_ops
node_home -->|"requests generation"| node_generator
node_basic -->|"requests generation"| node_generator
node_generator -->|"collects inputs"| node_include_payload
node_generator -->|"loads filename data"| node_deal
node_generator -->|"dispatches request"| node_xlsx_worker
node_xlsx_worker -->|"loads inputs"| node_pricing_loader
node_pricing_input -->|"fetches data"| node_pricing_loader
node_include_payload -->|"supplies includes"| node_pricing_loader
node_pricing_loader -->|"enriches records"| node_price_enrich
node_pricing_loader -->|"normalizes data"| node_price_normalize
node_pricing_loader -->|"applies patches"| node_price_patch
node_xlsx_worker -->|"builds workbook"| node_writer
node_writer -->|"writes sections"| node_xlsx_sheets
node_xlsx_worker -->|"merges macros"| node_vba
node_xlsx_worker -->|"returns workbook"| node_download
node_user -->|"uploads workbook"| node_workbook_ui
node_workbook_ui -->|"selects operation"| node_workbook_ops
node_workbook_ops -->|"dispatches request"| node_workbook_worker
node_workbook_worker -->|"converts or trims"| node_convert
node_workbook_worker -->|"loads refresh data"| node_pricing_loader
node_workbook_worker -->|"refreshes workbook"| node_reprice
node_workbook_ops -->|"downloads result"| node_download
node_user -->|"runs legacy tool"| node_legacy_ui
node_legacy_ui -->|"fetches prices"| node_legacy_api
node_legacy_ui -->|"loads includes"| node_legacy_includes
node_legacy_ui -->|"transforms prices"| node_legacy_filter
node_legacy_ui -->|"writes workbook"| node_legacy_writer

click node_entry "https://github.com/aliuly/xlpricer/blob/main/v2/src/main.tsx"
click node_app "https://github.com/aliuly/xlpricer/blob/main/v2/src/mainApp/App.tsx"
click node_basic "https://github.com/aliuly/xlpricer/blob/main/v2/src/mainApp/BasicView.tsx"
click node_home "https://github.com/aliuly/xlpricer/blob/main/v2/src/homeTab/HomeTab.tsx"
click node_assumptions "https://github.com/aliuly/xlpricer/blob/main/v2/src/editorTab/AssumptionsTab.tsx"
click node_components "https://github.com/aliuly/xlpricer/blob/main/v2/src/editorTab/ComponentsTab.tsx"
click node_includes "https://github.com/aliuly/xlpricer/blob/main/v2/src/editorTab/IncludesTab.tsx"
click node_deal "https://github.com/aliuly/xlpricer/blob/main/v2/src/mainApp/useDealInfo.ts"
click node_generator "https://github.com/aliuly/xlpricer/blob/main/v2/src/mainApp/useXlsxGenerator.ts"
click node_include_payload "https://github.com/aliuly/xlpricer/blob/main/v2/src/homeTab/xlsxWorkerProtocol.ts"
click node_pricing_loader "https://github.com/aliuly/xlpricer/blob/main/v2/src/homeTab/loadPricing.ts"
click node_price_enrich "https://github.com/aliuly/xlpricer/blob/main/v2/src/prices/enrich.ts"
click node_price_normalize "https://github.com/aliuly/xlpricer/blob/main/v2/src/prices/normalize.ts"
click node_price_patch "https://github.com/aliuly/xlpricer/blob/main/v2/src/prices/patching.ts"
click node_xlsx_worker "https://github.com/aliuly/xlpricer/blob/main/v2/src/homeTab/xlsxWorker.ts"
click node_writer "https://github.com/aliuly/xlpricer/blob/main/v2/src/xlsx/writer.ts"
click node_xlsx_sheets "https://github.com/aliuly/xlpricer/tree/main/v2/src/xlsx"
click node_vba "https://github.com/aliuly/xlpricer/blob/main/v2/src/xlsx/vba.ts"
click node_workbook_ops "https://github.com/aliuly/xlpricer/blob/main/v2/src/workbookTab/useWorkbookOps.ts"
click node_workbook_ui "https://github.com/aliuly/xlpricer/blob/main/v2/src/workbookTab/WorkbookMode.tsx"
click node_workbook_worker "https://github.com/aliuly/xlpricer/blob/main/v2/src/workbookTab/workbookWorker.ts"
click node_convert "https://github.com/aliuly/xlpricer/blob/main/v2/src/xlsx/convert.ts"
click node_reprice "https://github.com/aliuly/xlpricer/blob/main/v2/src/xlsx/reprice.ts"
click node_legacy_ui "https://github.com/aliuly/xlpricer/blob/main/v1/xlpricer/wiz.py"
click node_legacy_api "https://github.com/aliuly/xlpricer/blob/main/v1/xlpricer/price_api.py"
click node_legacy_includes "https://github.com/aliuly/xlpricer/blob/main/v1/xlpricer/includes.py"
click node_legacy_filter "https://github.com/aliuly/xlpricer/blob/main/v1/xlpricer/normalize.py"
click node_legacy_writer "https://github.com/aliuly/xlpricer/blob/main/v1/xlpricer/xlsw.py"

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_entry,node_app,node_basic,node_home,node_assumptions,node_components,node_includes,node_deal,node_generator,node_include_payload,node_user toneBlue
class node_pricing_loader,node_price_enrich,node_price_normalize,node_price_patch toneAmber
class node_xlsx_worker,node_writer,node_xlsx_sheets,node_vba,node_workbook_ops,node_workbook_ui,node_workbook_worker,node_convert,node_reprice toneMint
class node_legacy_ui,node_legacy_api,node_legacy_includes,node_legacy_filter,node_legacy_writer toneRose
class node_pricing_input,node_download toneIndigo
```

## Components

### Current SPA

- [App entry](https://github.com/aliuly/xlpricer/blob/main/v2/src/main.tsx): `v2/src/main.tsx`
- [Mode and tabs](https://github.com/aliuly/xlpricer/blob/main/v2/src/mainApp/App.tsx): `v2/src/mainApp/App.tsx`
- [Basic view](https://github.com/aliuly/xlpricer/blob/main/v2/src/mainApp/BasicView.tsx): `v2/src/mainApp/BasicView.tsx`
- [Pricing home](https://github.com/aliuly/xlpricer/blob/main/v2/src/homeTab/HomeTab.tsx): `v2/src/homeTab/HomeTab.tsx`
- [Assumption editor](https://github.com/aliuly/xlpricer/blob/main/v2/src/editorTab/AssumptionsTab.tsx): `v2/src/editorTab/AssumptionsTab.tsx`
- [Component editor](https://github.com/aliuly/xlpricer/blob/main/v2/src/editorTab/ComponentsTab.tsx): `v2/src/editorTab/ComponentsTab.tsx`
- [Includes editor](https://github.com/aliuly/xlpricer/blob/main/v2/src/editorTab/IncludesTab.tsx): `v2/src/editorTab/IncludesTab.tsx`
- [Deal details](https://github.com/aliuly/xlpricer/blob/main/v2/src/mainApp/useDealInfo.ts): `v2/src/mainApp/useDealInfo.ts`
- [Generation hook](https://github.com/aliuly/xlpricer/blob/main/v2/src/mainApp/useXlsxGenerator.ts): `v2/src/mainApp/useXlsxGenerator.ts`
- [Include payload](https://github.com/aliuly/xlpricer/blob/main/v2/src/homeTab/xlsxWorkerProtocol.ts): `v2/src/homeTab/xlsxWorkerProtocol.ts`

### Pricing Pipeline

- [Load pricing](https://github.com/aliuly/xlpricer/blob/main/v2/src/homeTab/loadPricing.ts): `v2/src/homeTab/loadPricing.ts`
- [Enrich pricing](https://github.com/aliuly/xlpricer/blob/main/v2/src/prices/enrich.ts): `v2/src/prices/enrich.ts`
- [Normalize pricing](https://github.com/aliuly/xlpricer/blob/main/v2/src/prices/normalize.ts): `v2/src/prices/normalize.ts`
- [Patch pricing](https://github.com/aliuly/xlpricer/blob/main/v2/src/prices/patching.ts): `v2/src/prices/patching.ts`

### Workbook Operations

- [Generation worker](https://github.com/aliuly/xlpricer/blob/main/v2/src/homeTab/xlsxWorker.ts): `v2/src/homeTab/xlsxWorker.ts`
- [Workbook writer](https://github.com/aliuly/xlpricer/blob/main/v2/src/xlsx/writer.ts): `v2/src/xlsx/writer.ts`
- [Workbook features](https://github.com/aliuly/xlpricer/tree/main/v2/src/xlsx): `v2/src/xlsx`
- [Macro merge](https://github.com/aliuly/xlpricer/blob/main/v2/src/xlsx/vba.ts): `v2/src/xlsx/vba.ts`
- [Workbook operations](https://github.com/aliuly/xlpricer/blob/main/v2/src/workbookTab/useWorkbookOps.ts): `v2/src/workbookTab/useWorkbookOps.ts`
- [Conversion interface](https://github.com/aliuly/xlpricer/blob/main/v2/src/workbookTab/WorkbookMode.tsx): `v2/src/workbookTab/WorkbookMode.tsx`
- [Workbook worker](https://github.com/aliuly/xlpricer/blob/main/v2/src/workbookTab/workbookWorker.ts): `v2/src/workbookTab/workbookWorker.ts`
- [Convert and trim](https://github.com/aliuly/xlpricer/blob/main/v2/src/xlsx/convert.ts): `v2/src/xlsx/convert.ts`
- [Refresh workbook](https://github.com/aliuly/xlpricer/blob/main/v2/src/xlsx/reprice.ts): `v2/src/xlsx/reprice.ts`

### Legacy Python

- [Python wizard](https://github.com/aliuly/xlpricer/blob/main/v1/xlpricer/wiz.py): `v1/xlpricer/wiz.py`
- [Price API](https://github.com/aliuly/xlpricer/blob/main/v1/xlpricer/price_api.py): `v1/xlpricer/price_api.py`
- [Include prices](https://github.com/aliuly/xlpricer/blob/main/v1/xlpricer/includes.py): `v1/xlpricer/includes.py`
- [Pricing transforms](https://github.com/aliuly/xlpricer/blob/main/v1/xlpricer/normalize.py): `v1/xlpricer/normalize.py`
- [Python workbook writer](https://github.com/aliuly/xlpricer/blob/main/v1/xlpricer/xlsw.py): `v1/xlpricer/xlsw.py`

### Other components

- **User**
- **Pricing sources**
- **Workbook download**

## Connections

- User → App entry: opens app
- App entry → Mode and tabs: renders
- Mode and tabs → Basic view: selects basic
- Mode and tabs → Pricing home: selects pricing
- Mode and tabs → Assumption editor: shows editor
- Mode and tabs → Component editor: shows editor
- Mode and tabs → Includes editor: shows editor
- Mode and tabs → Workbook operations: owns operations
- Pricing home → Generation hook: requests generation
- Basic view → Generation hook: requests generation
- Generation hook → Include payload: collects inputs
- Generation hook → Deal details: loads filename data
- Generation hook → Generation worker: dispatches request
- Generation worker → Load pricing: loads inputs
- Pricing sources → Load pricing: fetches data
- Include payload → Load pricing: supplies includes
- Load pricing → Enrich pricing: enriches records
- Load pricing → Normalize pricing: normalizes data
- Load pricing → Patch pricing: applies patches
- Generation worker → Workbook writer: builds workbook
- Workbook writer → Workbook features: writes sections
- Generation worker → Macro merge: merges macros
- Generation worker → Workbook download: returns workbook
- User → Conversion interface: uploads workbook
- Conversion interface → Workbook operations: selects operation
- Workbook operations → Workbook worker: dispatches request
- Workbook worker → Convert and trim: converts or trims
- Workbook worker → Load pricing: loads refresh data
- Workbook worker → Refresh workbook: refreshes workbook
- Workbook operations → Workbook download: downloads result
- User → Python wizard: runs legacy tool
- Python wizard → Price API: fetches prices
- Python wizard → Include prices: loads includes
- Python wizard → Pricing transforms: transforms prices
- Python wizard → Python workbook writer: writes workbook
