# tejas-raskar/solarbipv architecture

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

- Interactive diagram: https://gitdiagram.com/tejas-raskar/solarbipv
- Repository: https://github.com/tejas-raskar/solarbipv

## Overview

SolarBIPV is an interactive 3D city viewer for estimating building rooftop solar potential. Users enter the model, adjust date and time, select a building, and receive rooftop area, shading, irradiance, and BIPV power estimates. The graph separates navigation and guidance, scene composition, rooftop analysis, and solar calculations. The README and excerpts establish the calculation stages; unsampled model details are represented only where the tree or explicit imports support them.

Main entry points: [`src/components/Scene.jsx`](https://github.com/tejas-raskar/solarbipv/blob/main/src/components/Scene.jsx) (Scene composition), [`src/components/CityModel.jsx`](https://github.com/tejas-raskar/solarbipv/blob/main/src/components/CityModel.jsx) (Interactive city), [`src/App.jsx`](https://github.com/tejas-raskar/solarbipv/blob/main/src/App.jsx) (App routing), [`src/utils/sunPosition.js`](https://github.com/tejas-raskar/solarbipv/blob/main/src/utils/sunPosition.js) (Sun position and controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["Navigation and guidance"]
  node_app["App routing<br/>[App.jsx]"]
  node_landing["Landing page<br/>[Landing.jsx]"]
  node_hero["Hero presentation<br/>[Hero.jsx]"]
  node_docs["Method documentation<br/>[Docs.jsx]"]
end

subgraph group_scene["3D city scene"]
  node_modelpage["Model page<br/>[Model.jsx]"]
  node_scene["Scene composition<br/>[Scene.jsx]"]
  node_city["Interactive city<br/>[CityModel.jsx]"]
  node_roads["Road geometry<br/>[RoadModel.jsx]"]
  node_vegetation["Vegetation<br/>[Vegetation.jsx]"]
  node_clouds["Cloud layer<br/>[Clouds.jsx]"]
  node_ground["Ground plane<br/>[Ground.jsx]"]
  node_cityasset["City model asset<br/>[ny_noDecimate.glb]"]
end

subgraph group_rooftop["Rooftop analysis"]
  node_rooftoparea["Rooftop detection and area<br/>[rooftopArea.js]"]
  node_highlight["Rooftop highlighting"]
end

subgraph group_solar["Solar calculations"]
  node_sun["Sun position and controls<br/>[sunPosition.js]"]
  node_shading["Shadow fraction<br/>[bipvCalculation.js]"]
  node_bipv["Irradiance and power<br/>[bipvCalculation.js]"]
end

node_user(("User"))
node_suncalc["SunCalc library"]

node_user -->|"opens"| node_app
node_app -->|"routes to"| node_landing
node_app -->|"routes to"| node_modelpage
node_app -->|"routes to"| node_docs
node_landing -->|"renders"| node_hero
node_modelpage -->|"renders"| node_scene
node_scene -->|"renders"| node_city
node_scene -->|"renders"| node_roads
node_scene -->|"renders"| node_vegetation
node_scene -->|"renders"| node_clouds
node_scene -->|"renders"| node_ground
node_city -->|"loads"| node_cityasset
node_city -->|"calculates area"| node_rooftoparea
node_city -->|"creates highlight"| node_highlight
node_city -->|"calculates power"| node_bipv
node_bipv -->|"gets sun data"| node_sun
node_sun -->|"gets position"| node_suncalc
node_scene -->|"updates light"| node_sun

click node_app "https://github.com/tejas-raskar/solarbipv/blob/main/src/App.jsx"
click node_landing "https://github.com/tejas-raskar/solarbipv/blob/main/src/pages/Landing.jsx"
click node_hero "https://github.com/tejas-raskar/solarbipv/blob/main/src/components/Hero.jsx"
click node_docs "https://github.com/tejas-raskar/solarbipv/blob/main/src/pages/Docs.jsx"
click node_modelpage "https://github.com/tejas-raskar/solarbipv/blob/main/src/pages/Model.jsx"
click node_scene "https://github.com/tejas-raskar/solarbipv/blob/main/src/components/Scene.jsx"
click node_city "https://github.com/tejas-raskar/solarbipv/blob/main/src/components/CityModel.jsx"
click node_roads "https://github.com/tejas-raskar/solarbipv/blob/main/src/components/RoadModel.jsx"
click node_vegetation "https://github.com/tejas-raskar/solarbipv/blob/main/src/components/Vegetation.jsx"
click node_clouds "https://github.com/tejas-raskar/solarbipv/blob/main/src/components/Clouds.jsx"
click node_ground "https://github.com/tejas-raskar/solarbipv/blob/main/src/components/Ground.jsx"
click node_cityasset "https://github.com/tejas-raskar/solarbipv/blob/main/public/assets/ny_noDecimate.glb"
click node_rooftoparea "https://github.com/tejas-raskar/solarbipv/blob/main/src/utils/rooftopArea.js"
click node_highlight "https://github.com/tejas-raskar/solarbipv/blob/main/src/utils/highlightRooftops.js"
click node_sun "https://github.com/tejas-raskar/solarbipv/blob/main/src/utils/sunPosition.js"
click node_shading "https://github.com/tejas-raskar/solarbipv/blob/main/src/utils/bipvCalculation.js"
click node_bipv "https://github.com/tejas-raskar/solarbipv/blob/main/src/utils/bipvCalculation.js"

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_landing,node_hero,node_docs,node_user toneBlue
class node_modelpage,node_scene,node_city,node_roads,node_vegetation,node_clouds,node_ground,node_cityasset toneAmber
class node_rooftoparea,node_highlight toneMint
class node_sun,node_shading,node_bipv toneRose
class node_suncalc toneIndigo
```

## Components

### Navigation and guidance

- [App routing](https://github.com/tejas-raskar/solarbipv/blob/main/src/App.jsx): `src/App.jsx`
- [Landing page](https://github.com/tejas-raskar/solarbipv/blob/main/src/pages/Landing.jsx): `src/pages/Landing.jsx`
- [Hero presentation](https://github.com/tejas-raskar/solarbipv/blob/main/src/components/Hero.jsx): `src/components/Hero.jsx`
- [Method documentation](https://github.com/tejas-raskar/solarbipv/blob/main/src/pages/Docs.jsx): `src/pages/Docs.jsx`

### 3D city scene

- [Model page](https://github.com/tejas-raskar/solarbipv/blob/main/src/pages/Model.jsx): `src/pages/Model.jsx`
- [Scene composition](https://github.com/tejas-raskar/solarbipv/blob/main/src/components/Scene.jsx): `src/components/Scene.jsx`
- [Interactive city](https://github.com/tejas-raskar/solarbipv/blob/main/src/components/CityModel.jsx): `src/components/CityModel.jsx`
- [Road geometry](https://github.com/tejas-raskar/solarbipv/blob/main/src/components/RoadModel.jsx): `src/components/RoadModel.jsx`
- [Vegetation](https://github.com/tejas-raskar/solarbipv/blob/main/src/components/Vegetation.jsx): `src/components/Vegetation.jsx`
- [Cloud layer](https://github.com/tejas-raskar/solarbipv/blob/main/src/components/Clouds.jsx): `src/components/Clouds.jsx`
- [Ground plane](https://github.com/tejas-raskar/solarbipv/blob/main/src/components/Ground.jsx): `src/components/Ground.jsx`
- [City model asset](https://github.com/tejas-raskar/solarbipv/blob/main/public/assets/ny_noDecimate.glb): `public/assets/ny_noDecimate.glb`

### Rooftop analysis

- [Rooftop detection and area](https://github.com/tejas-raskar/solarbipv/blob/main/src/utils/rooftopArea.js): `src/utils/rooftopArea.js`
- [Rooftop highlighting](https://github.com/tejas-raskar/solarbipv/blob/main/src/utils/highlightRooftops.js): `src/utils/highlightRooftops.js`

### Solar calculations

- [Sun position and controls](https://github.com/tejas-raskar/solarbipv/blob/main/src/utils/sunPosition.js): `src/utils/sunPosition.js`
- [Shadow fraction](https://github.com/tejas-raskar/solarbipv/blob/main/src/utils/bipvCalculation.js): `src/utils/bipvCalculation.js`
- [Irradiance and power](https://github.com/tejas-raskar/solarbipv/blob/main/src/utils/bipvCalculation.js): `src/utils/bipvCalculation.js`

### Other components

- **User**
- **SunCalc library**

## Connections

- User → App routing: opens
- App routing → Landing page: routes to (evidence: `src/App.jsx`)
- App routing → Model page: routes to (evidence: `src/App.jsx`)
- App routing → Method documentation: routes to (evidence: `src/App.jsx`)
- Landing page → Hero presentation: renders (evidence: `src/pages/Landing.jsx`)
- Model page → Scene composition: renders (evidence: `src/pages/Model.jsx`)
- Scene composition → Interactive city: renders (evidence: `src/components/Scene.jsx`)
- Scene composition → Road geometry: renders (evidence: `src/components/Scene.jsx`)
- Scene composition → Vegetation: renders (evidence: `src/components/Scene.jsx`)
- Scene composition → Cloud layer: renders (evidence: `src/components/Scene.jsx`)
- Scene composition → Ground plane: renders (evidence: `src/components/Scene.jsx`)
- Interactive city → City model asset: loads (evidence: `src/components/CityModel.jsx`)
- Interactive city → Rooftop detection and area: calculates area (evidence: `src/components/CityModel.jsx`)
- Interactive city → Rooftop highlighting: creates highlight (evidence: `src/components/CityModel.jsx`)
- Interactive city → Irradiance and power: calculates power (evidence: `src/components/CityModel.jsx`)
- Irradiance and power → Sun position and controls: gets sun data (evidence: `src/utils/bipvCalculation.js`)
- Sun position and controls → SunCalc library: gets position (evidence: `src/utils/sunPosition.js`)
- Scene composition → Sun position and controls: updates light (evidence: `src/components/Scene.jsx`)
