# aleforfab/dancingwiththesars architecture

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

- Interactive diagram: https://gitdiagram.com/aleforfab/dancingwiththesars
- Repository: https://github.com/aleforfab/dancingwiththesars

## Overview

Dancing with the SARs is a web app for exploring radar backscatter and surface-change signals: users choose a study and parameters, request event comparisons and a time series, inspect individual dates or a start/finish difference, and follow links to source SAR scenes. The frontend page coordinates API requests; FastAPI validates requests and dispatches Earth Engine processing or ASF catalog searches. Earth Engine currently uses a Sentinel-1 development fallback, not direct NISAR processing. The README documents the optical context view and change-layer options; some backend and frontend implementation details were not sampled.

Main entry points: [`dancing-with-the-sars-frontend/app/page.tsx`](https://github.com/aleforfab/dancingwiththesars/blob/main/dancing-with-the-sars-frontend/app/page.tsx) (Workspace), [`dancing-with-sars-backend/main.py`](https://github.com/aleforfab/dancingwiththesars/blob/main/dancing-with-sars-backend/main.py) (FastAPI service), [`dancing-with-the-sars-frontend/components/Map.tsx`](https://github.com/aleforfab/dancingwiththesars/blob/main/dancing-with-the-sars-frontend/components/Map.tsx) (Layer map), [`dancing-with-the-sars-frontend/components/ControlPanel.tsx`](https://github.com/aleforfab/dancingwiththesars/blob/main/dancing-with-the-sars-frontend/components/ControlPanel.tsx) (Study controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Study interface"]
  node_page["Workspace<br/>[page.tsx]"]
  node_controls["Study controls<br/>[ControlPanel.tsx]"]
  node_map["Layer map<br/>[Map.tsx]"]
  node_timeline["Timeline controls<br/>[TimeScrubber.tsx]"]
  node_chart["Backscatter chart<br/>[DanceChart.tsx]"]
  node_granules_ui["Source scenes<br/>[AsfGranules.tsx]"]
end

subgraph group_api["API coordination"]
  node_backend["FastAPI service<br/>[main.py]"]
  node_schemas["Request validation<br/>[schemas.py]"]
end

subgraph group_radar["Radar processing"]
  node_gee["Earth Engine service<br/>[gee_service.py]"]
end

subgraph group_catalog["Scene catalog"]
  node_asf_service["ASF search service<br/>[asf_service.py]"]
end

node_user(("Analyst"))
node_mapbox["Mapbox basemap"]
node_earth_engine["Google Earth Engine"]
node_asf["ASF archive"]

node_user -->|"uses"| node_page
node_page -->|"renders"| node_controls
node_page -->|"supplies layers"| node_map
node_page -->|"supplies observations"| node_timeline
node_page -->|"supplies series"| node_chart
node_page -->|"supplies scenes"| node_granules_ui
node_controls -->|"updates settings"| node_page
node_timeline -->|"updates dates"| node_page
node_map -->|"uses basemap"| node_mapbox
node_page -->|"requests analysis"| node_backend
node_backend -->|"validates requests"| node_schemas
node_backend -->|"dispatches radar jobs"| node_gee
node_gee -->|"queries and renders"| node_earth_engine
node_backend -->|"dispatches searches"| node_asf_service
node_asf_service -->|"searches catalog"| node_asf
node_backend -->|"returns results"| node_page
node_page -->|"passes tile URLs"| node_map
node_page -->|"passes time series"| node_chart
node_page -->|"passes granules"| node_granules_ui

click node_page "https://github.com/aleforfab/dancingwiththesars/blob/main/dancing-with-the-sars-frontend/app/page.tsx"
click node_controls "https://github.com/aleforfab/dancingwiththesars/blob/main/dancing-with-the-sars-frontend/components/ControlPanel.tsx"
click node_map "https://github.com/aleforfab/dancingwiththesars/blob/main/dancing-with-the-sars-frontend/components/Map.tsx"
click node_timeline "https://github.com/aleforfab/dancingwiththesars/blob/main/dancing-with-the-sars-frontend/components/TimeScrubber.tsx"
click node_chart "https://github.com/aleforfab/dancingwiththesars/blob/main/dancing-with-the-sars-frontend/components/DanceChart.tsx"
click node_granules_ui "https://github.com/aleforfab/dancingwiththesars/blob/main/dancing-with-the-sars-frontend/components/AsfGranules.tsx"
click node_backend "https://github.com/aleforfab/dancingwiththesars/blob/main/dancing-with-sars-backend/main.py"
click node_schemas "https://github.com/aleforfab/dancingwiththesars/blob/main/dancing-with-sars-backend/schemas.py"
click node_gee "https://github.com/aleforfab/dancingwiththesars/blob/main/dancing-with-sars-backend/services/gee_service.py"
click node_asf_service "https://github.com/aleforfab/dancingwiththesars/blob/main/dancing-with-sars-backend/services/asf_service.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_page,node_controls,node_map,node_timeline,node_chart,node_granules_ui toneBlue
class node_backend,node_schemas toneAmber
class node_gee toneMint
class node_asf_service toneRose
class node_user,node_mapbox,node_earth_engine,node_asf toneIndigo
```

## Components

### Study interface

- [Workspace](https://github.com/aleforfab/dancingwiththesars/blob/main/dancing-with-the-sars-frontend/app/page.tsx): `dancing-with-the-sars-frontend/app/page.tsx`
- [Study controls](https://github.com/aleforfab/dancingwiththesars/blob/main/dancing-with-the-sars-frontend/components/ControlPanel.tsx): `dancing-with-the-sars-frontend/components/ControlPanel.tsx`
- [Layer map](https://github.com/aleforfab/dancingwiththesars/blob/main/dancing-with-the-sars-frontend/components/Map.tsx): `dancing-with-the-sars-frontend/components/Map.tsx`
- [Timeline controls](https://github.com/aleforfab/dancingwiththesars/blob/main/dancing-with-the-sars-frontend/components/TimeScrubber.tsx): `dancing-with-the-sars-frontend/components/TimeScrubber.tsx`
- [Backscatter chart](https://github.com/aleforfab/dancingwiththesars/blob/main/dancing-with-the-sars-frontend/components/DanceChart.tsx): `dancing-with-the-sars-frontend/components/DanceChart.tsx`
- [Source scenes](https://github.com/aleforfab/dancingwiththesars/blob/main/dancing-with-the-sars-frontend/components/AsfGranules.tsx): `dancing-with-the-sars-frontend/components/AsfGranules.tsx`

### API coordination

- [FastAPI service](https://github.com/aleforfab/dancingwiththesars/blob/main/dancing-with-sars-backend/main.py): `dancing-with-sars-backend/main.py`
- [Request validation](https://github.com/aleforfab/dancingwiththesars/blob/main/dancing-with-sars-backend/schemas.py): `dancing-with-sars-backend/schemas.py`

### Radar processing

- [Earth Engine service](https://github.com/aleforfab/dancingwiththesars/blob/main/dancing-with-sars-backend/services/gee_service.py): `dancing-with-sars-backend/services/gee_service.py`

### Scene catalog

- [ASF search service](https://github.com/aleforfab/dancingwiththesars/blob/main/dancing-with-sars-backend/services/asf_service.py): `dancing-with-sars-backend/services/asf_service.py`

### Other components

- **Analyst**
- **Mapbox basemap**
- **Google Earth Engine**
- **ASF archive**

## Connections

- Analyst → Workspace: uses
- Workspace → Study controls: renders
- Workspace → Layer map: supplies layers
- Workspace → Timeline controls: supplies observations
- Workspace → Backscatter chart: supplies series
- Workspace → Source scenes: supplies scenes
- Study controls → Workspace: updates settings
- Timeline controls → Workspace: updates dates
- Layer map → Mapbox basemap: uses basemap
- Workspace → FastAPI service: requests analysis
- FastAPI service → Request validation: validates requests
- FastAPI service → Earth Engine service: dispatches radar jobs
- Earth Engine service → Google Earth Engine: queries and renders
- FastAPI service → ASF search service: dispatches searches
- ASF search service → ASF archive: searches catalog
- FastAPI service → Workspace: returns results
- Workspace → Layer map: passes tile URLs
- Workspace → Backscatter chart: passes time series
- Workspace → Source scenes: passes granules
