# shashank-d404/satellite-based-deforestation-monitoring architecture

> Architecture diagram of the GitHub repository shashank-d404/satellite-based-deforestation-monitoring, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shashank-d404/satellite-based-deforestation-monitoring
- Repository: https://github.com/shashank-d404/satellite-based-deforestation-monitoring

## Overview

This is a Flask-backed satellite change-screening dashboard. Users choose a year pair, request Sentinel-2 analysis, and explore NDVI layers, potential-loss regions, and statistics on a map; they can also export reports or GeoJSON and use location search. The runtime analysis selects imagery, filters scene classes, computes NDVI change, and produces cached map outputs. Community and issue-report features are browser-local prototypes. The graph follows documented capabilities; some frontend/backend wiring and unsampled route details are not shown where source excerpts do not establish them.

Main entry points: [`backend/app.py`](https://github.com/shashank-d404/satellite-based-deforestation-monitoring/blob/main/backend/app.py) (Flask routes), [`frontend/script.js`](https://github.com/shashank-d404/satellite-based-deforestation-monitoring/blob/main/frontend/script.js) (Map dashboard), [`backend/dynamic_analysis.py`](https://github.com/shashank-d404/satellite-based-deforestation-monitoring/blob/main/backend/dynamic_analysis.py) (Year comparison), [`data/ndvi`](https://github.com/shashank-d404/satellite-based-deforestation-monitoring/tree/main/data/ndvi) (Verified results)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_frontend["Map dashboard<br/>[script.js]"]
  node_community["Community tools<br/>[script.js]"]
  node_browserstore["Browser storage"]
end

subgraph group_api["Web API"]
  node_flask["Flask routes<br/>[app.py]"]
end

subgraph group_analysis["Satellite analysis"]
  node_comparison["Year comparison"]
  node_scene["Scene selection"]
  node_bands["Band reading"]
  node_ndvi["Masked NDVI"]
  node_change["Change screening"]
  node_geojson["Loss GeoJSON"]
end

subgraph group_outputs["Analysis outputs"]
  node_rastercache["Cached outputs"]
  node_staticresults["Verified results"]
end

node_user(("Dashboard user"))
node_geocoder["Location geocoder"]
node_catalog["Planetary STAC"]
node_basemaps["Map basemaps"]

node_user -->|"selects and explores"| node_frontend
node_frontend -->|"requests analysis"| node_flask
node_flask -->|"runs comparison"| node_comparison
node_comparison -->|"selects scenes"| node_scene
node_scene -->|"searches catalog"| node_catalog
node_scene -->|"supplies assets"| node_bands
node_bands -->|"provides bands"| node_ndvi
node_ndvi -->|"provides yearly indices"| node_change
node_change -->|"extracts loss regions"| node_geojson
node_comparison -->|"writes cached outputs"| node_rastercache
node_geojson -->|"writes GeoJSON"| node_rastercache
node_rastercache -->|"serves dynamic results"| node_flask
node_flask -->|"reads verified data"| node_staticresults
node_staticresults -->|"serves layers and metadata"| node_flask
node_flask -->|"returns results and exports"| node_frontend
node_frontend -->|"searches locations"| node_geocoder
node_geocoder -->|"returns locations"| node_flask
node_frontend -.->|"loads map tiles"| node_basemaps
node_user -->|"uses community features"| node_community
node_community -->|"stores reports and communities"| node_browserstore

click node_frontend "https://github.com/shashank-d404/satellite-based-deforestation-monitoring/blob/main/frontend/script.js"
click node_community "https://github.com/shashank-d404/satellite-based-deforestation-monitoring/blob/main/frontend/script.js"
click node_flask "https://github.com/shashank-d404/satellite-based-deforestation-monitoring/blob/main/backend/app.py"
click node_comparison "https://github.com/shashank-d404/satellite-based-deforestation-monitoring/blob/main/backend/dynamic_analysis.py"
click node_scene "https://github.com/shashank-d404/satellite-based-deforestation-monitoring/blob/main/backend/dynamic_analysis.py"
click node_bands "https://github.com/shashank-d404/satellite-based-deforestation-monitoring/blob/main/backend/dynamic_analysis.py"
click node_ndvi "https://github.com/shashank-d404/satellite-based-deforestation-monitoring/blob/main/backend/dynamic_analysis.py"
click node_change "https://github.com/shashank-d404/satellite-based-deforestation-monitoring/blob/main/backend/dynamic_analysis.py"
click node_geojson "https://github.com/shashank-d404/satellite-based-deforestation-monitoring/blob/main/backend/dynamic_analysis.py"
click node_rastercache "https://github.com/shashank-d404/satellite-based-deforestation-monitoring/blob/main/backend/dynamic_analysis.py"
click node_staticresults "https://github.com/shashank-d404/satellite-based-deforestation-monitoring/tree/main/data/ndvi"

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_frontend,node_community,node_browserstore,node_user toneBlue
class node_flask toneAmber
class node_comparison,node_scene,node_bands,node_ndvi,node_change,node_geojson toneMint
class node_rastercache,node_staticresults toneRose
class node_geocoder,node_catalog,node_basemaps toneIndigo
```

## Components

### Dashboard

- [Map dashboard](https://github.com/shashank-d404/satellite-based-deforestation-monitoring/blob/main/frontend/script.js): `frontend/script.js`
- [Community tools](https://github.com/shashank-d404/satellite-based-deforestation-monitoring/blob/main/frontend/script.js): `frontend/script.js`
- **Browser storage**

### Web API

- [Flask routes](https://github.com/shashank-d404/satellite-based-deforestation-monitoring/blob/main/backend/app.py): `backend/app.py`

### Satellite analysis

- [Year comparison](https://github.com/shashank-d404/satellite-based-deforestation-monitoring/blob/main/backend/dynamic_analysis.py): `backend/dynamic_analysis.py`
- [Scene selection](https://github.com/shashank-d404/satellite-based-deforestation-monitoring/blob/main/backend/dynamic_analysis.py): `backend/dynamic_analysis.py`
- [Band reading](https://github.com/shashank-d404/satellite-based-deforestation-monitoring/blob/main/backend/dynamic_analysis.py): `backend/dynamic_analysis.py`
- [Masked NDVI](https://github.com/shashank-d404/satellite-based-deforestation-monitoring/blob/main/backend/dynamic_analysis.py): `backend/dynamic_analysis.py`
- [Change screening](https://github.com/shashank-d404/satellite-based-deforestation-monitoring/blob/main/backend/dynamic_analysis.py): `backend/dynamic_analysis.py`
- [Loss GeoJSON](https://github.com/shashank-d404/satellite-based-deforestation-monitoring/blob/main/backend/dynamic_analysis.py): `backend/dynamic_analysis.py`

### Analysis outputs

- [Cached outputs](https://github.com/shashank-d404/satellite-based-deforestation-monitoring/blob/main/backend/dynamic_analysis.py): `backend/dynamic_analysis.py`
- [Verified results](https://github.com/shashank-d404/satellite-based-deforestation-monitoring/tree/main/data/ndvi): `data/ndvi`

### Other components

- **Dashboard user**
- **Location geocoder**
- **Planetary STAC**
- **Map basemaps**

## Connections

- Dashboard user → Map dashboard: selects and explores
- Map dashboard → Flask routes: requests analysis
- Flask routes → Year comparison: runs comparison
- Year comparison → Scene selection: selects scenes
- Scene selection → Planetary STAC: searches catalog
- Scene selection → Band reading: supplies assets
- Band reading → Masked NDVI: provides bands
- Masked NDVI → Change screening: provides yearly indices
- Change screening → Loss GeoJSON: extracts loss regions
- Year comparison → Cached outputs: writes cached outputs
- Loss GeoJSON → Cached outputs: writes GeoJSON
- Cached outputs → Flask routes: serves dynamic results
- Flask routes → Verified results: reads verified data
- Verified results → Flask routes: serves layers and metadata
- Flask routes → Map dashboard: returns results and exports
- Map dashboard → Location geocoder: searches locations
- Location geocoder → Flask routes: returns locations
- Map dashboard → Map basemaps: loads map tiles
- Dashboard user → Community tools: uses community features
- Community tools → Browser storage: stores reports and communities
