# artinranjbaran/terra-sight architecture

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

- Interactive diagram: https://gitdiagram.com/artinranjbaran/terra-sight
- Repository: https://github.com/artinranjbaran/terra-sight

## Overview

Terra Sight is an interactive Earth-observation platform for discovering OPERA RTC-S1 scenes and comparing backscatter. Users choose a study area, search NASA CMR, select compatible acquisitions, then compare public browse previews or run authenticated raster analysis; they can also analyze local GeoTIFFs without login. The frontend additionally supports temporal profiles, evidence and methodology views, saved settings, and report exports. The graph includes both the local FastAPI and public catalog-function paths; unsampled frontend request wiring is included only where the README documents it.

Main entry points: [`src/main.js`](https://github.com/artinranjbaran/terra-sight/blob/main/src/main.js) (Investigation UI), [`backend/app/analysis.py`](https://github.com/artinranjbaran/terra-sight/blob/main/backend/app/analysis.py) (OPERA Analysis), [`api/catalog/search.js`](https://github.com/artinranjbaran/terra-sight/blob/main/api/catalog/search.js) (CMR Search), [`backend/app/main.py`](https://github.com/artinranjbaran/terra-sight/blob/main/backend/app/main.py) (Local API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_explore["Study Interface"]
  node_frontend["Investigation UI<br/>[main.js]"]
  node_globe["3D Globe<br/>[globe.js]"]
  node_study_map["Study Map<br/>[map.js]"]
  node_assets["Earth Texture<br/>[assets.js]"]
  node_browser_storage[("Browser Storage")]
end

subgraph group_discovery["Catalog Discovery"]
  node_scene_catalog["Scene Parsing<br/>[catalog.js]"]
  node_catalog_search["CMR Search<br/>[search.js]"]
  node_backend_catalog["Backend Catalog<br/>[catalog.py]"]
end

subgraph group_processing["Raster Analysis"]
  node_analysis["OPERA Analysis<br/>[analysis.py]"]
end

subgraph group_services["API Services"]
  node_api_health["Catalog Health<br/>[health.js]"]
  node_netlify_search["Netlify Search Adapter<br/>[catalog-search.js]"]
  node_netlify_health["Netlify Health Adapter<br/>[health.js]"]
  node_backend_api["Local API<br/>[main.py]"]
end

node_investigator(("Investigator"))
node_cmr["NASA CMR"]
node_raster_sources["ASF Raster Service"]
node_earthdata["Earthdata Login"]
node_local_files["Local GeoTIFFs"]

node_investigator -->|"uses"| node_frontend
node_frontend -->|"loads"| node_globe
node_frontend -->|"creates"| node_study_map
node_frontend -->|"uses"| node_scene_catalog
node_globe -->|"loads texture"| node_assets
node_study_map -->|"loads texture"| node_assets
node_frontend -->|"searches via API"| node_catalog_search
node_catalog_search -->|"queries"| node_cmr
node_catalog_search -->|"parses granules"| node_scene_catalog
node_frontend -->|"requests analysis"| node_backend_api
node_backend_api -->|"searches scenes"| node_backend_catalog
node_backend_catalog -->|"queries"| node_cmr
node_backend_api -->|"runs analyses"| node_analysis
node_analysis -->|"looks up products"| node_backend_catalog
node_analysis -->|"downloads rasters"| node_raster_sources
node_analysis -->|"authenticates retrieval"| node_earthdata
node_frontend -->|"uploads GeoTIFFs"| node_local_files
node_frontend -->|"saves settings and reports"| node_browser_storage
node_netlify_search -->|"dispatches"| node_catalog_search
node_netlify_health -->|"dispatches"| node_api_health
node_investigator -.->|"checks service"| node_api_health

click node_frontend "https://github.com/artinranjbaran/terra-sight/blob/main/src/main.js"
click node_globe "https://github.com/artinranjbaran/terra-sight/blob/main/src/globe.js"
click node_study_map "https://github.com/artinranjbaran/terra-sight/blob/main/src/map.js"
click node_assets "https://github.com/artinranjbaran/terra-sight/blob/main/src/assets.js"
click node_scene_catalog "https://github.com/artinranjbaran/terra-sight/blob/main/src/catalog.js"
click node_catalog_search "https://github.com/artinranjbaran/terra-sight/blob/main/api/catalog/search.js"
click node_api_health "https://github.com/artinranjbaran/terra-sight/blob/main/api/health.js"
click node_netlify_search "https://github.com/artinranjbaran/terra-sight/blob/main/netlify/functions/catalog-search.js"
click node_netlify_health "https://github.com/artinranjbaran/terra-sight/blob/main/netlify/functions/health.js"
click node_backend_api "https://github.com/artinranjbaran/terra-sight/blob/main/backend/app/main.py"
click node_backend_catalog "https://github.com/artinranjbaran/terra-sight/blob/main/backend/app/catalog.py"
click node_analysis "https://github.com/artinranjbaran/terra-sight/blob/main/backend/app/analysis.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_frontend,node_globe,node_study_map,node_assets,node_browser_storage toneBlue
class node_scene_catalog,node_catalog_search,node_backend_catalog toneAmber
class node_analysis toneMint
class node_api_health,node_netlify_search,node_netlify_health,node_backend_api toneRose
class node_investigator,node_cmr,node_raster_sources,node_earthdata,node_local_files toneIndigo
```

## Components

### Study Interface

- [Investigation UI](https://github.com/artinranjbaran/terra-sight/blob/main/src/main.js): `src/main.js`
- [3D Globe](https://github.com/artinranjbaran/terra-sight/blob/main/src/globe.js): `src/globe.js`
- [Study Map](https://github.com/artinranjbaran/terra-sight/blob/main/src/map.js): `src/map.js`
- [Earth Texture](https://github.com/artinranjbaran/terra-sight/blob/main/src/assets.js): `src/assets.js`
- **Browser Storage**

### Catalog Discovery

- [Scene Parsing](https://github.com/artinranjbaran/terra-sight/blob/main/src/catalog.js): `src/catalog.js`
- [CMR Search](https://github.com/artinranjbaran/terra-sight/blob/main/api/catalog/search.js): `api/catalog/search.js`
- [Backend Catalog](https://github.com/artinranjbaran/terra-sight/blob/main/backend/app/catalog.py): `backend/app/catalog.py`

### Raster Analysis

- [OPERA Analysis](https://github.com/artinranjbaran/terra-sight/blob/main/backend/app/analysis.py): `backend/app/analysis.py`

### API Services

- [Catalog Health](https://github.com/artinranjbaran/terra-sight/blob/main/api/health.js): `api/health.js`
- [Netlify Search Adapter](https://github.com/artinranjbaran/terra-sight/blob/main/netlify/functions/catalog-search.js): `netlify/functions/catalog-search.js`
- [Netlify Health Adapter](https://github.com/artinranjbaran/terra-sight/blob/main/netlify/functions/health.js): `netlify/functions/health.js`
- [Local API](https://github.com/artinranjbaran/terra-sight/blob/main/backend/app/main.py): `backend/app/main.py`

### Other components

- **Investigator**
- **NASA CMR**
- **ASF Raster Service**
- **Earthdata Login**
- **Local GeoTIFFs**

## Connections

- Investigator → Investigation UI: uses (evidence: `README.md`)
- Investigation UI → 3D Globe: loads (evidence: `src/main.js`)
- Investigation UI → Study Map: creates (evidence: `src/main.js`)
- Investigation UI → Scene Parsing: uses (evidence: `src/main.js`)
- 3D Globe → Earth Texture: loads texture (evidence: `src/globe.js`)
- Study Map → Earth Texture: loads texture (evidence: `src/map.js`)
- Investigation UI → CMR Search: searches via API (evidence: `README.md`)
- CMR Search → NASA CMR: queries (evidence: `api/catalog/search.js`)
- CMR Search → Scene Parsing: parses granules (evidence: `api/catalog/search.js`)
- Investigation UI → Local API: requests analysis (evidence: `README.md`)
- Local API → Backend Catalog: searches scenes (evidence: `backend/app/main.py`)
- Backend Catalog → NASA CMR: queries (evidence: `README.md`)
- Local API → OPERA Analysis: runs analyses (evidence: `backend/app/main.py`)
- OPERA Analysis → Backend Catalog: looks up products (evidence: `backend/app/analysis.py`)
- OPERA Analysis → ASF Raster Service: downloads rasters (evidence: `README.md`)
- OPERA Analysis → Earthdata Login: authenticates retrieval (evidence: `README.md`)
- Investigation UI → Local GeoTIFFs: uploads GeoTIFFs (evidence: `README.md`)
- Investigation UI → Browser Storage: saves settings and reports (evidence: `README.md`)
- Netlify Search Adapter → CMR Search: dispatches (evidence: `netlify/functions/catalog-search.js`)
- Netlify Health Adapter → Catalog Health: dispatches (evidence: `netlify/functions/health.js`)
- Investigator → Catalog Health: checks service
