# diamonddavesibs/thermoform-pwa architecture

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

- Interactive diagram: https://gitdiagram.com/diamonddavesibs/thermoform-pwa
- Repository: https://github.com/diamonddavesibs/thermoform-pwa

## Overview

Thermoform Layout Optimizer is a browser-based PWA for planning thermoforming mold cavities and estimating material use and part costs. Users enter part, mold, material, and spacing parameters; the app produces a cavity layout, SVG visualization, weight and scrap figures, and optional per-part cost analysis. DXF dimension extraction and embedded FRED PPI trends are documented capabilities, but their implementation details are not shown in the excerpts. The sampled code is concentrated in App.jsx, so several domain responsibilities share that path; no frontend-to-FRED endpoint call is evidenced.

Main entry points: [`src/App.jsx`](https://github.com/diamonddavesibs/thermoform-pwa/blob/main/src/App.jsx) (Optimizer UI), [`api/fred.js`](https://github.com/diamonddavesibs/thermoform-pwa/blob/main/api/fred.js) (FRED proxy), [`src/main.jsx`](https://github.com/diamonddavesibs/thermoform-pwa/blob/main/src/main.jsx) (React entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Layout workflow"]
  node_app["Optimizer UI<br/>[App.jsx]"]
  node_parameters["Part parameters<br/>[App.jsx]"]
  node_dxf["DXF dimensions<br/>[App.jsx]"]
  node_layout["Cavity optimizer<br/>[App.jsx]"]
  node_visual["Layout visualization<br/>[App.jsx]"]
end

subgraph group_analysis["Material analysis"]
  node_materials["Material database<br/>[App.jsx]"]
  node_weights["Weight and scrap<br/>[App.jsx]"]
  node_cost["Part cost analysis<br/>[App.jsx]"]
end

subgraph group_integrations["Data integrations"]
  node_ppi["Embedded PPI trends<br/>[App.jsx]"]
  node_fred_handler["FRED proxy<br/>[fred.js]"]
end

subgraph group_runtime["App runtime"]
  node_entry["React entry<br/>[main.jsx]"]
end

node_user(("Planner"))
node_fred["FRED service"]

node_user -->|"enters inputs"| node_app
node_app -->|"collects"| node_parameters
node_app -->|"extracts dimensions"| node_dxf
node_app -->|"optimizes cavities"| node_layout
node_app -->|"shows layout"| node_visual
node_app -->|"selects material"| node_materials
node_app -->|"calculates weights"| node_weights
node_app -->|"estimates cost"| node_cost
node_app -->|"displays trends"| node_ppi
node_entry -->|"renders"| node_app
node_fred_handler -->|"fetches observations"| node_fred

click node_app "https://github.com/diamonddavesibs/thermoform-pwa/blob/main/src/App.jsx"
click node_parameters "https://github.com/diamonddavesibs/thermoform-pwa/blob/main/src/App.jsx"
click node_dxf "https://github.com/diamonddavesibs/thermoform-pwa/blob/main/src/App.jsx"
click node_layout "https://github.com/diamonddavesibs/thermoform-pwa/blob/main/src/App.jsx"
click node_visual "https://github.com/diamonddavesibs/thermoform-pwa/blob/main/src/App.jsx"
click node_materials "https://github.com/diamonddavesibs/thermoform-pwa/blob/main/src/App.jsx"
click node_weights "https://github.com/diamonddavesibs/thermoform-pwa/blob/main/src/App.jsx"
click node_cost "https://github.com/diamonddavesibs/thermoform-pwa/blob/main/src/App.jsx"
click node_ppi "https://github.com/diamonddavesibs/thermoform-pwa/blob/main/src/App.jsx"
click node_fred_handler "https://github.com/diamonddavesibs/thermoform-pwa/blob/main/api/fred.js"
click node_entry "https://github.com/diamonddavesibs/thermoform-pwa/blob/main/src/main.jsx"

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_parameters,node_dxf,node_layout,node_visual toneBlue
class node_materials,node_weights,node_cost toneAmber
class node_ppi,node_fred_handler toneMint
class node_entry toneRose
class node_user,node_fred toneIndigo
```

## Components

### Layout workflow

- [Optimizer UI](https://github.com/diamonddavesibs/thermoform-pwa/blob/main/src/App.jsx): `src/App.jsx`
- [Part parameters](https://github.com/diamonddavesibs/thermoform-pwa/blob/main/src/App.jsx): `src/App.jsx`
- [DXF dimensions](https://github.com/diamonddavesibs/thermoform-pwa/blob/main/src/App.jsx): `src/App.jsx`
- [Cavity optimizer](https://github.com/diamonddavesibs/thermoform-pwa/blob/main/src/App.jsx): `src/App.jsx`
- [Layout visualization](https://github.com/diamonddavesibs/thermoform-pwa/blob/main/src/App.jsx): `src/App.jsx`

### Material analysis

- [Material database](https://github.com/diamonddavesibs/thermoform-pwa/blob/main/src/App.jsx): `src/App.jsx`
- [Weight and scrap](https://github.com/diamonddavesibs/thermoform-pwa/blob/main/src/App.jsx): `src/App.jsx`
- [Part cost analysis](https://github.com/diamonddavesibs/thermoform-pwa/blob/main/src/App.jsx): `src/App.jsx`

### Data integrations

- [Embedded PPI trends](https://github.com/diamonddavesibs/thermoform-pwa/blob/main/src/App.jsx): `src/App.jsx`
- [FRED proxy](https://github.com/diamonddavesibs/thermoform-pwa/blob/main/api/fred.js): `api/fred.js`

### App runtime

- [React entry](https://github.com/diamonddavesibs/thermoform-pwa/blob/main/src/main.jsx): `src/main.jsx`

### Other components

- **Planner**
- **FRED service**

## Connections

- Planner → Optimizer UI: enters inputs (evidence: `README.md`)
- Optimizer UI → Part parameters: collects (evidence: `README.md`)
- Optimizer UI → DXF dimensions: extracts dimensions (evidence: `README.md`)
- Optimizer UI → Cavity optimizer: optimizes cavities (evidence: `README.md`)
- Optimizer UI → Layout visualization: shows layout (evidence: `README.md`)
- Optimizer UI → Material database: selects material (evidence: `README.md`)
- Optimizer UI → Weight and scrap: calculates weights (evidence: `README.md`)
- Optimizer UI → Part cost analysis: estimates cost (evidence: `README.md`)
- Optimizer UI → Embedded PPI trends: displays trends (evidence: `README.md`)
- React entry → Optimizer UI: renders (evidence: `src/main.jsx`)
- FRED proxy → FRED service: fetches observations (evidence: `api/fred.js`)
