# bluehorizon65/solar_scope architecture

> Architecture diagram of the GitHub repository bluehorizon65/solar_scope, 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/bluehorizon65/solar_scope
- Repository: https://github.com/bluehorizon65/solar_scope

## Overview

This repository is a solar-planning web application backed by separate services for PV analysis, satellite imagery, rooftop detection, and 3D modeling. The principal workflow is: select a location and system options, submit them through the proxy, gather solar and imagery results, detect and measure the roof, and return results for display. The README also documents standalone simulation and model-viewer entry points. Some frontend and service internals were not sampled, so links between those components are included only where the excerpts or README support them.

Main entry points: [`frontend/src/App.jsx`](https://github.com/bluehorizon65/solar_scope/blob/main/frontend/src/App.jsx) (Planning app), [`backend/index.js`](https://github.com/bluehorizon65/solar_scope/blob/main/backend/index.js) (API proxy), [`frontend/src/components/FormPanel.jsx`](https://github.com/bluehorizon65/solar_scope/blob/main/frontend/src/components/FormPanel.jsx) (System form), [`pv_simulation/main_v2.py`](https://github.com/bluehorizon65/solar_scope/blob/main/pv_simulation/main_v2.py) (PV calculator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Planning interface"]
  node_app["Planning app<br/>[App.jsx]"]
  node_map["Location picker<br/>[MapPicker.jsx]"]
  node_form["System form<br/>[FormPanel.jsx]"]
  node_results["Solar results<br/>[SolarResults.jsx]"]
  node_preview["Invoice preview<br/>[Preview.jsx]"]
end

subgraph group_proxy["Request orchestration"]
  node_backend["API proxy<br/>[index.js]"]
end

subgraph group_analysis["Solar and roof analysis"]
  node_pv["PV calculator<br/>[main_v2.py]"]
  node_datasets[("Component datasets")]
  node_satellite["Satellite imagery"]
  node_roof["Rooftop detection<br/>[rooftop_fastapi.py]"]
end

subgraph group_modeling["Area and 3D modeling"]
  node_area["Area calculation<br/>[area_pipeline.py]"]
  node_stlapi["Model generation API<br/>[api.py]"]
  node_modelcreate["Model creation<br/>[create.py]"]
  node_viewer["3D model viewer<br/>[web.py]"]
end

node_user(("Planner"))
node_weather["NASA POWER"]
node_tiles["Tile provider"]

node_user -->|"selects location"| node_map
node_map -->|"reports location"| node_app
node_user -->|"enters options"| node_form
node_form -->|"submits request"| node_backend
node_backend -->|"requests calculation"| node_pv
node_pv -.->|"loads components"| node_datasets
node_pv -->|"fetches weather"| node_weather
node_backend -->|"requests imagery"| node_satellite
node_satellite -->|"downloads tiles"| node_tiles
node_backend -->|"sends roof image"| node_roof
node_backend -->|"requests model"| node_stlapi
node_app -->|"renders form"| node_form
node_app -->|"renders picker"| node_map
node_form -->|"returns results"| node_app
node_app -->|"renders results"| node_results
node_app -->|"opens preview"| node_preview
node_stlapi -.->|"delegates generation"| node_modelcreate
node_user -->|"views model"| node_viewer

click node_app "https://github.com/bluehorizon65/solar_scope/blob/main/frontend/src/App.jsx"
click node_map "https://github.com/bluehorizon65/solar_scope/blob/main/frontend/src/components/MapPicker.jsx"
click node_form "https://github.com/bluehorizon65/solar_scope/blob/main/frontend/src/components/FormPanel.jsx"
click node_results "https://github.com/bluehorizon65/solar_scope/blob/main/frontend/src/components/SolarResults.jsx"
click node_preview "https://github.com/bluehorizon65/solar_scope/blob/main/frontend/src/preview/Preview.jsx"
click node_backend "https://github.com/bluehorizon65/solar_scope/blob/main/backend/index.js"
click node_pv "https://github.com/bluehorizon65/solar_scope/blob/main/pv_simulation/main_v2.py"
click node_datasets "https://github.com/bluehorizon65/solar_scope/tree/main/pv_simulation"
click node_satellite "https://github.com/bluehorizon65/solar_scope/blob/main/satellite/satellite_zoom_server.py"
click node_roof "https://github.com/bluehorizon65/solar_scope/blob/main/AI/rooftop_fastapi.py"
click node_area "https://github.com/bluehorizon65/solar_scope/blob/main/stl/area_pipeline.py"
click node_stlapi "https://github.com/bluehorizon65/solar_scope/blob/main/stl/stl/api.py"
click node_modelcreate "https://github.com/bluehorizon65/solar_scope/blob/main/stl/stl/create.py"
click node_viewer "https://github.com/bluehorizon65/solar_scope/blob/main/stl/stl/web.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_map,node_form,node_results,node_preview toneBlue
class node_backend toneAmber
class node_pv,node_datasets,node_satellite,node_roof toneMint
class node_area,node_stlapi,node_modelcreate,node_viewer toneRose
class node_user,node_weather,node_tiles toneIndigo
```

## Components

### Planning interface

- [Planning app](https://github.com/bluehorizon65/solar_scope/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Location picker](https://github.com/bluehorizon65/solar_scope/blob/main/frontend/src/components/MapPicker.jsx): `frontend/src/components/MapPicker.jsx`
- [System form](https://github.com/bluehorizon65/solar_scope/blob/main/frontend/src/components/FormPanel.jsx): `frontend/src/components/FormPanel.jsx`
- [Solar results](https://github.com/bluehorizon65/solar_scope/blob/main/frontend/src/components/SolarResults.jsx): `frontend/src/components/SolarResults.jsx`
- [Invoice preview](https://github.com/bluehorizon65/solar_scope/blob/main/frontend/src/preview/Preview.jsx): `frontend/src/preview/Preview.jsx`

### Request orchestration

- [API proxy](https://github.com/bluehorizon65/solar_scope/blob/main/backend/index.js): `backend/index.js`

### Solar and roof analysis

- [PV calculator](https://github.com/bluehorizon65/solar_scope/blob/main/pv_simulation/main_v2.py): `pv_simulation/main_v2.py`
- [Component datasets](https://github.com/bluehorizon65/solar_scope/tree/main/pv_simulation): `pv_simulation`
- [Satellite imagery](https://github.com/bluehorizon65/solar_scope/blob/main/satellite/satellite_zoom_server.py): `satellite/satellite_zoom_server.py`
- [Rooftop detection](https://github.com/bluehorizon65/solar_scope/blob/main/AI/rooftop_fastapi.py): `AI/rooftop_fastapi.py`

### Area and 3D modeling

- [Area calculation](https://github.com/bluehorizon65/solar_scope/blob/main/stl/area_pipeline.py): `stl/area_pipeline.py`
- [Model generation API](https://github.com/bluehorizon65/solar_scope/blob/main/stl/stl/api.py): `stl/stl/api.py`
- [Model creation](https://github.com/bluehorizon65/solar_scope/blob/main/stl/stl/create.py): `stl/stl/create.py`
- [3D model viewer](https://github.com/bluehorizon65/solar_scope/blob/main/stl/stl/web.py): `stl/stl/web.py`

### Other components

- **Planner**
- **NASA POWER**
- **Tile provider**

## Connections

- Planner → Location picker: selects location
- Location picker → Planning app: reports location (evidence: `frontend/src/App.jsx`)
- Planner → System form: enters options (evidence: `frontend/src/components/FormPanel.jsx`)
- System form → API proxy: submits request (evidence: `frontend/src/components/FormPanel.jsx`)
- API proxy → PV calculator: requests calculation (evidence: `backend/index.js`)
- PV calculator → Component datasets: loads components
- PV calculator → NASA POWER: fetches weather (evidence: `pv_simulation/main_v2.py`)
- API proxy → Satellite imagery: requests imagery (evidence: `backend/index.js`)
- Satellite imagery → Tile provider: downloads tiles (evidence: `satellite/satellite_zoom_server.py`)
- API proxy → Rooftop detection: sends roof image (evidence: `backend/index.js`)
- API proxy → Model generation API: requests model (evidence: `backend/index.js`)
- Planning app → System form: renders form (evidence: `frontend/src/App.jsx`)
- Planning app → Location picker: renders picker (evidence: `frontend/src/App.jsx`)
- System form → Planning app: returns results (evidence: `frontend/src/App.jsx`)
- Planning app → Solar results: renders results (evidence: `frontend/src/App.jsx`)
- Planning app → Invoice preview: opens preview (evidence: `frontend/src/App.jsx`)
- Model generation API → Model creation: delegates generation
- Planner → 3D model viewer: views model (evidence: `stl/stl/web.py`)
