# barathiraja242005/thermoooo architecture

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

- Interactive diagram: https://gitdiagram.com/barathiraja242005/thermoooo
- Repository: https://github.com/barathiraja242005/thermoooo

## Overview

ThermaBuild is a browser-based passive-solar building design studio for cold regions of India. Its main workflow combines site climate and a building plan, searches and filters candidate designs, simulates room temperatures, then produces reports and design outputs. The README also documents plan import, 3D viewing, tuning, drawings, retrofit analysis, and non-house building types. A separate legacy Python API remains in the repository but is explicitly no longer used by the studio; its workflow is shown separately. Browser relationships are based on README documentation because browser source was not excerpted.

Main entry points: [`scripts/server.py`](https://github.com/barathiraja242005/thermoooo/blob/main/scripts/server.py) (Flask API), [`demo/js/engine/optimise.js`](https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/engine/optimise.js) (Design search), [`demo/js/engine/climate.js`](https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/engine/climate.js) (Site climate), [`demo/js/engine/thermal.js`](https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/engine/thermal.js) (Room heat balance)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_studio["Design studio"]
  node_studio["Browser studio<br/>[app-core.js]"]
  node_site["Site climate<br/>[climate.js]"]
  node_plan["Plan input<br/>[plan-import.js]"]
  node_building["Building types<br/>[design.js]"]
end

subgraph group_engine["Simulation engine"]
  node_materials["Materials<br/>[materials.js]"]
  node_weather["Design weather<br/>[climate.js]"]
  node_search["Design search<br/>[optimise.js]"]
  node_worker["Search worker<br/>[optimise.worker.js]"]
  node_safety["Safety checks<br/>[safety.js]"]
  node_thermal["Room heat balance<br/>[thermal.js]"]
  node_analysis["Report analysis<br/>[analyse.js]"]
end

subgraph group_outputs["Design outputs"]
  node_report["Night report<br/>[report.js]"]
  node_tuning["Design tuning<br/>[tune.js]"]
  node_drawings["Building drawings<br/>[drawings.js]"]
  node_viewer["3D house viewer<br/>[house3d.js]"]
end

subgraph group_legacy["Legacy Python API"]
  node_legacy_server["Flask API<br/>[server.py]"]
  node_legacy_climate["Climate profiles<br/>[climate.py]"]
  node_legacy_layout["Parametric layout"]
  node_vastu["Vastu analysis<br/>[vastu_analyzer.py]"]
  node_legacy_materials["Envelope model<br/>[material_model.py]"]
  node_legacy_thermal["Preliminary thermal<br/>[thermal_engine.py]"]
  node_cad["FreeCAD geometry"]
  node_cfd["CFD pipeline<br/>[pyfluent_engine.py]"]
  node_dossier["Executive dossier"]
  node_livestock["Livestock engine"]
end

node_designer(("Designer"))
node_climate_api["Live climate service"]
node_legacy_user(("Legacy API client"))
node_legacy_climate_api(("Legacy climate client"))

node_designer -->|"uses"| node_studio
node_studio -->|"selects site"| node_site
node_site -->|"synthesizes weather"| node_weather
node_designer -->|"imports plan"| node_plan
node_plan -->|"defines rooms"| node_building
node_building -->|"sets requirements"| node_search
node_weather -->|"supplies weather"| node_search
node_materials -->|"offers assemblies"| node_search
node_search -->|"dispatches search"| node_worker
node_worker -->|"filters designs"| node_safety
node_safety -->|"passes designs"| node_thermal
node_thermal -->|"provides simulation"| node_analysis
node_analysis -->|"feeds report"| node_report
node_designer -->|"adjusts design"| node_tuning
node_tuning -->|"reruns simulation"| node_thermal
node_designer -->|"requests drawings"| node_drawings
node_designer -->|"views design"| node_viewer
node_climate_api -.->|"provides live data"| node_site
node_legacy_user -->|"calls API"| node_legacy_server
node_legacy_server -->|"requests weather"| node_legacy_climate
node_legacy_server -->|"generates layout"| node_legacy_layout
node_legacy_layout -->|"analyzes placement"| node_vastu
node_legacy_server -->|"recommends envelope"| node_legacy_materials
node_legacy_server -->|"runs thermal model"| node_legacy_thermal
node_legacy_server -->|"generates CAD"| node_cad
node_legacy_server -->|"runs CFD"| node_cfd
node_legacy_server -->|"builds dossier"| node_dossier
node_legacy_climate_api -->|"requests climate"| node_legacy_server

click node_studio "https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/app-core.js"
click node_site "https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/engine/climate.js"
click node_plan "https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/plan-import.js"
click node_building "https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/engine/design.js"
click node_materials "https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/engine/materials.js"
click node_weather "https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/engine/climate.js"
click node_search "https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/engine/optimise.js"
click node_worker "https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/engine/optimise.worker.js"
click node_safety "https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/engine/safety.js"
click node_thermal "https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/engine/thermal.js"
click node_analysis "https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/engine/analyse.js"
click node_report "https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/report.js"
click node_tuning "https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/tune.js"
click node_drawings "https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/drawings.js"
click node_viewer "https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/house3d.js"
click node_legacy_server "https://github.com/barathiraja242005/thermoooo/blob/main/scripts/server.py"
click node_legacy_climate "https://github.com/barathiraja242005/thermoooo/blob/main/scripts/climate.py"
click node_legacy_layout "https://github.com/barathiraja242005/thermoooo/blob/main/scripts/layout_generator.py"
click node_vastu "https://github.com/barathiraja242005/thermoooo/blob/main/scripts/vastu_analyzer.py"
click node_legacy_materials "https://github.com/barathiraja242005/thermoooo/blob/main/scripts/material_model.py"
click node_legacy_thermal "https://github.com/barathiraja242005/thermoooo/blob/main/scripts/thermal_engine.py"
click node_cad "https://github.com/barathiraja242005/thermoooo/blob/main/scripts/freecad_generator.py"
click node_cfd "https://github.com/barathiraja242005/thermoooo/blob/main/scripts/pyfluent_engine.py"
click node_dossier "https://github.com/barathiraja242005/thermoooo/blob/main/scripts/report_generator.py"
click node_livestock "https://github.com/barathiraja242005/thermoooo/blob/main/scripts/animal_shelter_engine.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_studio,node_site,node_plan,node_building,node_legacy_user,node_legacy_climate_api toneBlue
class node_materials,node_weather,node_search,node_worker,node_safety,node_thermal,node_analysis toneAmber
class node_report,node_tuning,node_drawings,node_viewer toneMint
class node_legacy_server,node_legacy_climate,node_legacy_layout,node_vastu,node_legacy_materials,node_legacy_thermal,node_cad,node_cfd,node_dossier,node_livestock toneRose
class node_designer,node_climate_api toneIndigo
```

## Components

### Design studio

- [Browser studio](https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/app-core.js): `demo/js/app-core.js`
- [Site climate](https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/engine/climate.js): `demo/js/engine/climate.js`
- [Plan input](https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/plan-import.js): `demo/js/plan-import.js`
- [Building types](https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/engine/design.js): `demo/js/engine/design.js`

### Simulation engine

- [Materials](https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/engine/materials.js): `demo/js/engine/materials.js`
- [Design weather](https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/engine/climate.js): `demo/js/engine/climate.js`
- [Design search](https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/engine/optimise.js): `demo/js/engine/optimise.js`
- [Search worker](https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/engine/optimise.worker.js): `demo/js/engine/optimise.worker.js`
- [Safety checks](https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/engine/safety.js): `demo/js/engine/safety.js`
- [Room heat balance](https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/engine/thermal.js): `demo/js/engine/thermal.js`
- [Report analysis](https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/engine/analyse.js): `demo/js/engine/analyse.js`

### Design outputs

- [Night report](https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/report.js): `demo/js/report.js`
- [Design tuning](https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/tune.js): `demo/js/tune.js`
- [Building drawings](https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/drawings.js): `demo/js/drawings.js`
- [3D house viewer](https://github.com/barathiraja242005/thermoooo/blob/main/demo/js/house3d.js): `demo/js/house3d.js`

### Legacy Python API

- [Flask API](https://github.com/barathiraja242005/thermoooo/blob/main/scripts/server.py): `scripts/server.py`
- [Climate profiles](https://github.com/barathiraja242005/thermoooo/blob/main/scripts/climate.py): `scripts/climate.py`
- [Parametric layout](https://github.com/barathiraja242005/thermoooo/blob/main/scripts/layout_generator.py): `scripts/layout_generator.py`
- [Vastu analysis](https://github.com/barathiraja242005/thermoooo/blob/main/scripts/vastu_analyzer.py): `scripts/vastu_analyzer.py`
- [Envelope model](https://github.com/barathiraja242005/thermoooo/blob/main/scripts/material_model.py): `scripts/material_model.py`
- [Preliminary thermal](https://github.com/barathiraja242005/thermoooo/blob/main/scripts/thermal_engine.py): `scripts/thermal_engine.py`
- [FreeCAD geometry](https://github.com/barathiraja242005/thermoooo/blob/main/scripts/freecad_generator.py): `scripts/freecad_generator.py`
- [CFD pipeline](https://github.com/barathiraja242005/thermoooo/blob/main/scripts/pyfluent_engine.py): `scripts/pyfluent_engine.py`
- [Executive dossier](https://github.com/barathiraja242005/thermoooo/blob/main/scripts/report_generator.py): `scripts/report_generator.py`
- [Livestock engine](https://github.com/barathiraja242005/thermoooo/blob/main/scripts/animal_shelter_engine.py): `scripts/animal_shelter_engine.py`

### Other components

- **Designer**
- **Live climate service**
- **Legacy API client**
- **Legacy climate client**

## Connections

- Designer → Browser studio: uses (evidence: `README.md`)
- Browser studio → Site climate: selects site (evidence: `README.md`)
- Site climate → Design weather: synthesizes weather (evidence: `README.md`)
- Designer → Plan input: imports plan (evidence: `README.md`)
- Plan input → Building types: defines rooms (evidence: `README.md`)
- Building types → Design search: sets requirements (evidence: `README.md`)
- Design weather → Design search: supplies weather (evidence: `README.md`)
- Materials → Design search: offers assemblies (evidence: `README.md`)
- Design search → Search worker: dispatches search (evidence: `README.md`)
- Search worker → Safety checks: filters designs (evidence: `README.md`)
- Safety checks → Room heat balance: passes designs (evidence: `README.md`)
- Room heat balance → Report analysis: provides simulation (evidence: `README.md`)
- Report analysis → Night report: feeds report (evidence: `README.md`)
- Designer → Design tuning: adjusts design (evidence: `README.md`)
- Design tuning → Room heat balance: reruns simulation (evidence: `README.md`)
- Designer → Building drawings: requests drawings (evidence: `README.md`)
- Designer → 3D house viewer: views design (evidence: `README.md`)
- Live climate service → Site climate: provides live data (evidence: `README.md`)
- Legacy API client → Flask API: calls API (evidence: `README.md`)
- Flask API → Climate profiles: requests weather (evidence: `scripts/server.py`)
- Flask API → Parametric layout: generates layout (evidence: `scripts/server.py`)
- Parametric layout → Vastu analysis: analyzes placement (evidence: `scripts/layout_generator.py`)
- Flask API → Envelope model: recommends envelope (evidence: `scripts/server.py`)
- Flask API → Preliminary thermal: runs thermal model (evidence: `scripts/server.py`)
- Flask API → FreeCAD geometry: generates CAD (evidence: `scripts/server.py`)
- Flask API → CFD pipeline: runs CFD (evidence: `scripts/server.py`)
- Flask API → Executive dossier: builds dossier (evidence: `scripts/server.py`)
- Legacy climate client → Flask API: requests climate (evidence: `README.md`)
