# redhoven/tectum architecture

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

- Interactive diagram: https://gitdiagram.com/redhoven/tectum
- Repository: https://github.com/redhoven/tectum

## Overview

Tectum is an installer-facing solar planning and offer platform. Its main workflow runs from installer login and customer/site intake through 3D roof and panel planning, proposal generation, and a branded PDF offer; the Python API computes offer options and BOMs. The repository also contains a separate Next.js planner prototype and a datasheet-enrichment utility. Edges reflect shown imports/calls or README-documented workflow; some integration details are not visible in the excerpts.

Main entry points: [`tectum-pro/src/App.tsx`](https://github.com/redhoven/tectum/blob/main/tectum-pro/src/App.tsx) (App Router), [`tectum-pro/src/taim/components/SolarPlanner.jsx`](https://github.com/redhoven/tectum/blob/main/tectum-pro/src/taim/components/SolarPlanner.jsx) (Solar Planner), [`tectum-pro/src/pages/Proposals.tsx`](https://github.com/redhoven/tectum/blob/main/tectum-pro/src/pages/Proposals.tsx) (Offer Proposals), [`tectum-pro/src/pages/Dashboard.tsx`](https://github.com/redhoven/tectum/blob/main/tectum-pro/src/pages/Dashboard.tsx) (Project Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Installer Web App"]
  node_app["App Router<br/>[App.tsx]"]
  node_login["Installer Login<br/>[Login.tsx]"]
  node_dashboard["Project Dashboard<br/>[Dashboard.tsx]"]
  node_intake["Customer Intake<br/>[IntakePro.tsx]"]
  node_auth[("Local Auth<br/>[auth.js]")]
  node_projects[("Project Persistence<br/>[projects.js]")]
end

subgraph group_planning["Roof Planning"]
  node_planner["Solar Planner<br/>[SolarPlanner.jsx]"]
  node_scene["3D Roof Scene<br/>[Scene.jsx]"]
  node_roof["Roof Geometry<br/>[roof.js]"]
  node_state[("Planner State<br/>[store.js]")]
  node_templates["Roof Templates<br/>[TemplatesPanel.jsx]"]
end

subgraph group_offers["Offers and Reports"]
  node_proposal["Offer Proposals<br/>[Proposals.tsx]"]
  node_panelcatalog["Panel Catalogue"]
  node_solarcalc["Solar Calculations<br/>[solar.ts]"]
  node_pdf["PDF Report<br/>[SolarReportPDF.jsx]"]
  node_pipelineclient["Pipeline Client<br/>[pipelineClient.js]"]
end

subgraph group_backend["Offer Backend"]
  node_api["Pipeline API<br/>[server.py]"]
  node_engine["Offer Engine<br/>[pipeline.py]"]
  node_salescopy["AI Sales Explanation<br/>[ai_salesperson.py]"]
end

subgraph group_catalogue["Catalogue Enrichment"]
  node_enricher["Datasheet Enricher"]
end

node_installer(("Solar Installer"))

node_installer -->|"uses"| node_app
node_app -->|"shows"| node_login
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_intake
node_app -->|"opens"| node_planner
node_app -->|"shows"| node_proposal
node_app -->|"signs in"| node_auth
node_app -->|"loads"| node_projects
node_intake -->|"uses"| node_solarcalc
node_dashboard -->|"lists projects"| node_projects
node_dashboard -->|"reads installer"| node_auth
node_planner -->|"renders"| node_scene
node_planner -->|"renders"| node_templates
node_planner -->|"updates"| node_state
node_planner -->|"saves projects"| node_projects
node_scene -->|"layouts panels"| node_roof
node_scene -->|"reads and writes"| node_state
node_proposal -->|"reads planner state"| node_state
node_proposal -->|"reads catalogue"| node_panelcatalog
node_proposal -->|"generates report"| node_pdf
node_proposal -.->|"requests offers"| node_pipelineclient
node_pipelineclient -.->|"calls API"| node_api
node_api -->|"invokes"| node_engine
node_engine -.->|"produces explanation"| node_salescopy
node_installer -.->|"enriches datasheets"| node_enricher

click node_app "https://github.com/redhoven/tectum/blob/main/tectum-pro/src/App.tsx"
click node_login "https://github.com/redhoven/tectum/blob/main/tectum-pro/src/pages/Login.tsx"
click node_dashboard "https://github.com/redhoven/tectum/blob/main/tectum-pro/src/pages/Dashboard.tsx"
click node_intake "https://github.com/redhoven/tectum/blob/main/tectum-pro/src/components/IntakePro.tsx"
click node_auth "https://github.com/redhoven/tectum/blob/main/tectum-pro/src/taim/lib/auth.js"
click node_projects "https://github.com/redhoven/tectum/blob/main/tectum-pro/src/taim/lib/projects.js"
click node_planner "https://github.com/redhoven/tectum/blob/main/tectum-pro/src/taim/components/SolarPlanner.jsx"
click node_scene "https://github.com/redhoven/tectum/blob/main/tectum-pro/src/taim/components/Scene.jsx"
click node_roof "https://github.com/redhoven/tectum/blob/main/tectum-pro/src/taim/lib/roof.js"
click node_state "https://github.com/redhoven/tectum/blob/main/tectum-pro/src/taim/lib/store.js"
click node_templates "https://github.com/redhoven/tectum/blob/main/tectum-pro/src/taim/components/TemplatesPanel.jsx"
click node_proposal "https://github.com/redhoven/tectum/blob/main/tectum-pro/src/pages/Proposals.tsx"
click node_panelcatalog "https://github.com/redhoven/tectum/blob/main/tectum-pro/src/taim/lib/catalogue-panels.js"
click node_solarcalc "https://github.com/redhoven/tectum/blob/main/tectum-pro/src/lib/solar.ts"
click node_pdf "https://github.com/redhoven/tectum/blob/main/tectum-pro/src/taim/components/SolarReportPDF.jsx"
click node_pipelineclient "https://github.com/redhoven/tectum/blob/main/tectum-pro/src/taim/lib/pipelineClient.js"
click node_api "https://github.com/redhoven/tectum/blob/main/solar-pipeline/server.py"
click node_engine "https://github.com/redhoven/tectum/blob/main/solar-pipeline/pipeline.py"
click node_salescopy "https://github.com/redhoven/tectum/blob/main/solar-pipeline/ai_salesperson.py"
click node_enricher "https://github.com/redhoven/tectum/blob/main/extractor/datasheet_enricher.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_app,node_login,node_dashboard,node_intake,node_auth,node_projects toneBlue
class node_planner,node_scene,node_roof,node_state,node_templates toneAmber
class node_proposal,node_panelcatalog,node_solarcalc,node_pdf,node_pipelineclient toneMint
class node_api,node_engine,node_salescopy toneRose
class node_enricher,node_installer toneIndigo
```

## Components

### Installer Web App

- [App Router](https://github.com/redhoven/tectum/blob/main/tectum-pro/src/App.tsx): `tectum-pro/src/App.tsx`
- [Installer Login](https://github.com/redhoven/tectum/blob/main/tectum-pro/src/pages/Login.tsx): `tectum-pro/src/pages/Login.tsx`
- [Project Dashboard](https://github.com/redhoven/tectum/blob/main/tectum-pro/src/pages/Dashboard.tsx): `tectum-pro/src/pages/Dashboard.tsx`
- [Customer Intake](https://github.com/redhoven/tectum/blob/main/tectum-pro/src/components/IntakePro.tsx): `tectum-pro/src/components/IntakePro.tsx`
- [Local Auth](https://github.com/redhoven/tectum/blob/main/tectum-pro/src/taim/lib/auth.js): `tectum-pro/src/taim/lib/auth.js`
- [Project Persistence](https://github.com/redhoven/tectum/blob/main/tectum-pro/src/taim/lib/projects.js): `tectum-pro/src/taim/lib/projects.js`

### Roof Planning

- [Solar Planner](https://github.com/redhoven/tectum/blob/main/tectum-pro/src/taim/components/SolarPlanner.jsx): `tectum-pro/src/taim/components/SolarPlanner.jsx`
- [3D Roof Scene](https://github.com/redhoven/tectum/blob/main/tectum-pro/src/taim/components/Scene.jsx): `tectum-pro/src/taim/components/Scene.jsx`
- [Roof Geometry](https://github.com/redhoven/tectum/blob/main/tectum-pro/src/taim/lib/roof.js): `tectum-pro/src/taim/lib/roof.js`
- [Planner State](https://github.com/redhoven/tectum/blob/main/tectum-pro/src/taim/lib/store.js): `tectum-pro/src/taim/lib/store.js`
- [Roof Templates](https://github.com/redhoven/tectum/blob/main/tectum-pro/src/taim/components/TemplatesPanel.jsx): `tectum-pro/src/taim/components/TemplatesPanel.jsx`

### Offers and Reports

- [Offer Proposals](https://github.com/redhoven/tectum/blob/main/tectum-pro/src/pages/Proposals.tsx): `tectum-pro/src/pages/Proposals.tsx`
- [Panel Catalogue](https://github.com/redhoven/tectum/blob/main/tectum-pro/src/taim/lib/catalogue-panels.js): `tectum-pro/src/taim/lib/catalogue-panels.js`
- [Solar Calculations](https://github.com/redhoven/tectum/blob/main/tectum-pro/src/lib/solar.ts): `tectum-pro/src/lib/solar.ts`
- [PDF Report](https://github.com/redhoven/tectum/blob/main/tectum-pro/src/taim/components/SolarReportPDF.jsx): `tectum-pro/src/taim/components/SolarReportPDF.jsx`
- [Pipeline Client](https://github.com/redhoven/tectum/blob/main/tectum-pro/src/taim/lib/pipelineClient.js): `tectum-pro/src/taim/lib/pipelineClient.js`

### Offer Backend

- [Pipeline API](https://github.com/redhoven/tectum/blob/main/solar-pipeline/server.py): `solar-pipeline/server.py`
- [Offer Engine](https://github.com/redhoven/tectum/blob/main/solar-pipeline/pipeline.py): `solar-pipeline/pipeline.py`
- [AI Sales Explanation](https://github.com/redhoven/tectum/blob/main/solar-pipeline/ai_salesperson.py): `solar-pipeline/ai_salesperson.py`

### Catalogue Enrichment

- [Datasheet Enricher](https://github.com/redhoven/tectum/blob/main/extractor/datasheet_enricher.py): `extractor/datasheet_enricher.py`

### Other components

- **Solar Installer**

## Connections

- Solar Installer → App Router: uses (evidence: `README.md`)
- App Router → Installer Login: shows (evidence: `tectum-pro/src/App.tsx`)
- App Router → Project Dashboard: routes to (evidence: `tectum-pro/src/App.tsx`)
- App Router → Customer Intake: routes to (evidence: `tectum-pro/src/App.tsx`)
- App Router → Solar Planner: opens (evidence: `tectum-pro/src/App.tsx`)
- App Router → Offer Proposals: shows (evidence: `tectum-pro/src/App.tsx`)
- App Router → Local Auth: signs in (evidence: `tectum-pro/src/App.tsx`)
- App Router → Project Persistence: loads (evidence: `tectum-pro/src/App.tsx`)
- Customer Intake → Solar Calculations: uses (evidence: `tectum-pro/src/components/IntakePro.tsx`)
- Project Dashboard → Project Persistence: lists projects (evidence: `tectum-pro/src/pages/Dashboard.tsx`)
- Project Dashboard → Local Auth: reads installer (evidence: `tectum-pro/src/pages/Dashboard.tsx`)
- Solar Planner → 3D Roof Scene: renders (evidence: `tectum-pro/src/taim/components/SolarPlanner.jsx`)
- Solar Planner → Roof Templates: renders (evidence: `tectum-pro/src/taim/components/SolarPlanner.jsx`)
- Solar Planner → Planner State: updates (evidence: `tectum-pro/src/taim/components/SolarPlanner.jsx`)
- Solar Planner → Project Persistence: saves projects (evidence: `tectum-pro/src/taim/components/SolarPlanner.jsx`)
- 3D Roof Scene → Roof Geometry: layouts panels (evidence: `tectum-pro/src/taim/components/Scene.jsx`)
- 3D Roof Scene → Planner State: reads and writes (evidence: `tectum-pro/src/taim/components/Scene.jsx`)
- Offer Proposals → Planner State: reads planner state (evidence: `tectum-pro/src/pages/Proposals.tsx`)
- Offer Proposals → Panel Catalogue: reads catalogue (evidence: `tectum-pro/src/pages/Proposals.tsx`)
- Offer Proposals → PDF Report: generates report (evidence: `tectum-pro/src/pages/Proposals.tsx`)
- Offer Proposals → Pipeline Client: requests offers (evidence: `README.md`)
- Pipeline Client → Pipeline API: calls API (evidence: `README.md`)
- Pipeline API → Offer Engine: invokes (evidence: `solar-pipeline/server.py`)
- Offer Engine → AI Sales Explanation: produces explanation (evidence: `solar-pipeline/ai_salesperson.py`)
- Solar Installer → Datasheet Enricher: enriches datasheets (evidence: `README.md`)
