# spandandey961-max/regrow architecture

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

- Interactive diagram: https://gitdiagram.com/spandandey961-max/regrow
- Repository: https://github.com/spandandey961-max/regrow

## Overview

ReGrow is a browser-based land-observation dashboard for Amaravati. Users choose an observation date and study sector, inspect mapped cover and paired changes over comparable usable cells, review vegetation and water histories, and explore a conditional restoration scenario. The repository also includes a reproducible HLS/WorldCover reference-model workflow and optional NISAR catalogue inspection; radar measurements are not used in dashboard classifications. The graph separates documented product behavior from sampled runtime wiring; unsampled connections are omitted rather than inferred.

Main entry points: [`web/inference-worker.js`](https://github.com/spandandey961-max/regrow/blob/main/web/inference-worker.js) (Browser inference), [`scripts/select_data.py`](https://github.com/spandandey961-max/regrow/blob/main/scripts/select_data.py) (HLS selection), [`scripts/prepare_train.py`](https://github.com/spandandey961-max/regrow/blob/main/scripts/prepare_train.py) (Reference model training), [`web/app.js`](https://github.com/spandandey961-max/regrow/blob/main/web/app.js) (Land dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Dashboard experience"]
  node_dashboard["Land dashboard<br/>[app.js]"]
  node_sector_report["Sector analysis<br/>[area-analysis.js]"]
  node_planning["Planning outlook<br/>[outlook.js]"]
  node_model_evidence["Model evidence view<br/>[design.js]"]
end

subgraph group_runtime["Inference runtime"]
  node_hosting_adapter["Hosting API adapter<br/>[hosting-api.js]"]
  node_browser_inference["Browser inference"]
end

subgraph group_model["Observation and model workflow"]
  node_observations["Observation snapshots<br/>[dashboard.json]"]
  node_fitted_forest["Fitted forest<br/>[forest.json]"]
  node_hls_discovery["HLS selection<br/>[select_data.py]"]
  node_catalog_discovery["Source discovery<br/>[discover.py]"]
  node_model_training["Reference model training<br/>[prepare_train.py]"]
  node_training_report["Training evaluation"]
end

subgraph group_radar["Radar exploration"]
  node_nisar_discovery["NISAR discovery<br/>[discover_sar.py]"]
  node_nisar_inspection["NISAR subset inspection<br/>[nisar_subset.py]"]
  node_nisar_catalog["NISAR catalogue records"]
end

node_visitor(("Dashboard visitor"))
node_hls_service{{"HLS catalogue service"}}
node_worldcover_service{{"WorldCover data"}}

node_visitor -->|"explores"| node_dashboard
node_dashboard -->|"opens sector report"| node_sector_report
node_sector_report -->|"renders scenario"| node_planning
node_hosting_adapter -->|"dispatches prediction"| node_browser_inference
node_browser_inference -->|"loads scenes"| node_observations
node_browser_inference -->|"loads model"| node_fitted_forest
node_hls_discovery -->|"imports search helper"| node_catalog_discovery
node_hls_discovery -->|"searches catalogue"| node_hls_service
node_model_training -->|"reads HLS assets"| node_hls_service
node_model_training -->|"reads reference labels"| node_worldcover_service
node_nisar_discovery -.->|"records catalogue"| node_nisar_catalog
node_nisar_inspection -.->|"selects products"| node_nisar_catalog

click node_dashboard "https://github.com/spandandey961-max/regrow/blob/main/web/app.js"
click node_sector_report "https://github.com/spandandey961-max/regrow/blob/main/web/area-analysis.js"
click node_planning "https://github.com/spandandey961-max/regrow/blob/main/web/outlook.js"
click node_model_evidence "https://github.com/spandandey961-max/regrow/blob/main/web/design.js"
click node_hosting_adapter "https://github.com/spandandey961-max/regrow/blob/main/web/hosting-api.js"
click node_browser_inference "https://github.com/spandandey961-max/regrow/blob/main/web/inference-worker.js"
click node_observations "https://github.com/spandandey961-max/regrow/blob/main/data/dashboard.json"
click node_fitted_forest "https://github.com/spandandey961-max/regrow/blob/main/data/forest.json"
click node_hls_discovery "https://github.com/spandandey961-max/regrow/blob/main/scripts/select_data.py"
click node_catalog_discovery "https://github.com/spandandey961-max/regrow/blob/main/scripts/discover.py"
click node_model_training "https://github.com/spandandey961-max/regrow/blob/main/scripts/prepare_train.py"
click node_training_report "https://github.com/spandandey961-max/regrow/blob/main/data/training-report.json"
click node_nisar_discovery "https://github.com/spandandey961-max/regrow/blob/main/scripts/discover_sar.py"
click node_nisar_inspection "https://github.com/spandandey961-max/regrow/blob/main/scripts/nisar_subset.py"
click node_nisar_catalog "https://github.com/spandandey961-max/regrow/blob/main/data/sar/selected-nisar.json"

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_dashboard,node_sector_report,node_planning,node_model_evidence toneBlue
class node_hosting_adapter,node_browser_inference toneAmber
class node_observations,node_fitted_forest,node_hls_discovery,node_catalog_discovery,node_model_training,node_training_report toneMint
class node_nisar_discovery,node_nisar_inspection,node_nisar_catalog toneRose
class node_visitor,node_hls_service,node_worldcover_service toneIndigo
```

## Components

### Dashboard experience

- [Land dashboard](https://github.com/spandandey961-max/regrow/blob/main/web/app.js): `web/app.js`
- [Sector analysis](https://github.com/spandandey961-max/regrow/blob/main/web/area-analysis.js): `web/area-analysis.js`
- [Planning outlook](https://github.com/spandandey961-max/regrow/blob/main/web/outlook.js): `web/outlook.js`
- [Model evidence view](https://github.com/spandandey961-max/regrow/blob/main/web/design.js): `web/design.js`

### Inference runtime

- [Hosting API adapter](https://github.com/spandandey961-max/regrow/blob/main/web/hosting-api.js): `web/hosting-api.js`
- [Browser inference](https://github.com/spandandey961-max/regrow/blob/main/web/inference-worker.js): `web/inference-worker.js`

### Observation and model workflow

- [Observation snapshots](https://github.com/spandandey961-max/regrow/blob/main/data/dashboard.json): `data/dashboard.json`
- [Fitted forest](https://github.com/spandandey961-max/regrow/blob/main/data/forest.json): `data/forest.json`
- [HLS selection](https://github.com/spandandey961-max/regrow/blob/main/scripts/select_data.py): `scripts/select_data.py`
- [Source discovery](https://github.com/spandandey961-max/regrow/blob/main/scripts/discover.py): `scripts/discover.py`
- [Reference model training](https://github.com/spandandey961-max/regrow/blob/main/scripts/prepare_train.py): `scripts/prepare_train.py`
- [Training evaluation](https://github.com/spandandey961-max/regrow/blob/main/data/training-report.json): `data/training-report.json`

### Radar exploration

- [NISAR discovery](https://github.com/spandandey961-max/regrow/blob/main/scripts/discover_sar.py): `scripts/discover_sar.py`
- [NISAR subset inspection](https://github.com/spandandey961-max/regrow/blob/main/scripts/nisar_subset.py): `scripts/nisar_subset.py`
- [NISAR catalogue records](https://github.com/spandandey961-max/regrow/blob/main/data/sar/selected-nisar.json): `data/sar/selected-nisar.json`

### Other components

- **Dashboard visitor**
- **HLS catalogue service**
- **WorldCover data**

## Connections

- Dashboard visitor → Land dashboard: explores (evidence: `README.md`)
- Land dashboard → Sector analysis: opens sector report (evidence: `README.md`)
- Sector analysis → Planning outlook: renders scenario (evidence: `web/area-analysis.js`)
- Hosting API adapter → Browser inference: dispatches prediction (evidence: `web/hosting-api.js`)
- Browser inference → Observation snapshots: loads scenes (evidence: `web/inference-worker.js`)
- Browser inference → Fitted forest: loads model (evidence: `web/inference-worker.js`)
- HLS selection → Source discovery: imports search helper (evidence: `scripts/select_data.py`)
- HLS selection → HLS catalogue service: searches catalogue (evidence: `scripts/select_data.py`)
- Reference model training → HLS catalogue service: reads HLS assets (evidence: `scripts/prepare_train.py`)
- Reference model training → WorldCover data: reads reference labels (evidence: `scripts/prepare_train.py`)
- NISAR discovery → NISAR catalogue records: records catalogue
- NISAR subset inspection → NISAR catalogue records: selects products
