# abutalaham/spectral-earth architecture

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

- Interactive diagram: https://gitdiagram.com/abutalaham/spectral-earth
- Repository: https://github.com/abutalaham/spectral-earth

## Overview

Spectral Earth is a browser-first environmental change analysis app with two workflows: compare RGB images, or derive NDVI change from Sentinel-2 red/NIR GeoTIFF bands. Users reach an analysis workspace, provide two dates of imagery, run local processing, and review visual maps and exports. The README documents local-only processing, sample data, a Copernicus acquisition guide, and scientific caveats. Edges below use README or SOURCE INDEX evidence; unsampled implementation details are represented without speculative calls.

Main entry points: [`src/routes/analyze.tsx`](https://github.com/abutalaham/spectral-earth/blob/main/src/routes/analyze.tsx) (Analysis workspace), [`src/components/analysis/SpectralAnalysisView.tsx`](https://github.com/abutalaham/spectral-earth/blob/main/src/components/analysis/SpectralAnalysisView.tsx) (Spectral workflow), [`src/routes/index.tsx`](https://github.com/abutalaham/spectral-earth/blob/main/src/routes/index.tsx) (Landing page), [`src/components/landing/HeroSection.tsx`](https://github.com/abutalaham/spectral-earth/blob/main/src/components/landing/HeroSection.tsx) (Hero scene)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routing["App routing"]
  node_analyze_route["Analysis route<br/>[analyze.tsx]"]
  node_router["Router setup<br/>[router.tsx]"]
end

subgraph group_analysis["Analysis workflows"]
  node_workspace["Analysis workspace<br/>[analyze.tsx]"]
  node_rgb_upload["RGB image input<br/>[UploadPanel.tsx]"]
  node_rgb_results["RGB results and exports"]
  node_spectral_view["Spectral workflow"]
  node_band_upload["Sentinel band input"]
  node_copernicus_guide["Copernicus guide"]
  node_spectral_results["Spectral results"]
end

subgraph group_compute["Browser analysis"]
  node_rgb_engine["RGB comparison engine<br/>[engine.ts]"]
  node_pixel_diff["Pixel difference<br/>[difference.ts]"]
  node_ndvi_engine["NDVI raster analysis<br/>[ndvi.ts]"]
  node_spectral_samples["Synthetic spectral data<br/>[ndviSamples.ts]"]
  node_sample_images["RGB sample imagery<br/>[samples.ts]"]
  node_reporting["Analysis report generation<br/>[report.ts]"]
end

subgraph group_presentation["Product experience"]
  node_home["Landing page<br/>[index.tsx]"]
  node_hero["Hero scene<br/>[HeroSection.tsx]"]
  node_fallback["Static hero"]
  node_capabilities["Device capability check"]
  node_features["Feature overview"]
  node_workflow["Workflow overview"]
  node_responsible["Responsible use"]
end

node_visitor(("User"))
node_copernicus(("Copernicus Data Space"))

node_visitor -->|"opens"| node_home
node_visitor -->|"opens"| node_analyze_route
node_home -->|"renders"| node_hero
node_home -->|"renders"| node_features
node_home -->|"renders"| node_workflow
node_home -->|"renders"| node_responsible
node_hero -->|"checks"| node_capabilities
node_hero -->|"uses when constrained"| node_fallback
node_analyze_route -->|"renders"| node_workspace
node_visitor -->|"selects mode"| node_workspace
node_workspace -->|"renders"| node_rgb_upload
node_workspace -->|"renders"| node_spectral_view
node_workspace -->|"loads samples"| node_sample_images
node_workspace -->|"loads images"| node_rgb_engine
node_workspace -.->|"shows results"| node_rgb_results
node_rgb_engine -->|"computes differences"| node_pixel_diff
node_spectral_view -->|"renders"| node_band_upload
node_spectral_view -->|"opens guide"| node_copernicus_guide
node_visitor -->|"gets band data"| node_copernicus
node_spectral_view -->|"loads sample data"| node_spectral_samples
node_spectral_view -->|"computes NDVI"| node_ndvi_engine
node_spectral_view -.->|"shows maps"| node_spectral_results
node_rgb_results -.->|"exports reports"| node_reporting
node_router -->|"registers route"| node_analyze_route

click node_home "https://github.com/abutalaham/spectral-earth/blob/main/src/routes/index.tsx"
click node_hero "https://github.com/abutalaham/spectral-earth/blob/main/src/components/landing/HeroSection.tsx"
click node_fallback "https://github.com/abutalaham/spectral-earth/blob/main/src/components/landing/StaticHeroFallback.tsx"
click node_capabilities "https://github.com/abutalaham/spectral-earth/blob/main/src/hooks/useDeviceCapabilities.ts"
click node_features "https://github.com/abutalaham/spectral-earth/blob/main/src/components/landing/FeaturesSection.tsx"
click node_workflow "https://github.com/abutalaham/spectral-earth/blob/main/src/components/landing/WorkflowSection.tsx"
click node_responsible "https://github.com/abutalaham/spectral-earth/blob/main/src/components/landing/ResponsibleUseSection.tsx"
click node_analyze_route "https://github.com/abutalaham/spectral-earth/blob/main/src/routes/analyze.tsx"
click node_workspace "https://github.com/abutalaham/spectral-earth/blob/main/src/routes/analyze.tsx"
click node_rgb_upload "https://github.com/abutalaham/spectral-earth/blob/main/src/components/analysis/UploadPanel.tsx"
click node_rgb_engine "https://github.com/abutalaham/spectral-earth/blob/main/src/lib/analysis/engine.ts"
click node_pixel_diff "https://github.com/abutalaham/spectral-earth/blob/main/src/lib/analysis/difference.ts"
click node_rgb_results "https://github.com/abutalaham/spectral-earth/blob/main/src/components/analysis/ResultsDashboard.tsx"
click node_spectral_view "https://github.com/abutalaham/spectral-earth/blob/main/src/components/analysis/SpectralAnalysisView.tsx"
click node_band_upload "https://github.com/abutalaham/spectral-earth/blob/main/src/components/analysis/SpectralUploadCard.tsx"
click node_copernicus_guide "https://github.com/abutalaham/spectral-earth/blob/main/src/components/analysis/CopernicusHelpModal.tsx"
click node_ndvi_engine "https://github.com/abutalaham/spectral-earth/blob/main/src/lib/analysis/ndvi.ts"
click node_spectral_samples "https://github.com/abutalaham/spectral-earth/blob/main/src/lib/analysis/ndviSamples.ts"
click node_spectral_results "https://github.com/abutalaham/spectral-earth/blob/main/src/components/analysis/SpectralResultsDashboard.tsx"
click node_sample_images "https://github.com/abutalaham/spectral-earth/blob/main/src/lib/analysis/samples.ts"
click node_reporting "https://github.com/abutalaham/spectral-earth/blob/main/src/lib/analysis/report.ts"
click node_router "https://github.com/abutalaham/spectral-earth/blob/main/src/router.tsx"

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_analyze_route,node_router,node_visitor toneBlue
class node_workspace,node_rgb_upload,node_rgb_results,node_spectral_view,node_band_upload,node_copernicus_guide,node_spectral_results toneAmber
class node_rgb_engine,node_pixel_diff,node_ndvi_engine,node_spectral_samples,node_sample_images,node_reporting toneMint
class node_home,node_hero,node_fallback,node_capabilities,node_features,node_workflow,node_responsible toneRose
class node_copernicus toneIndigo
```

## Components

### App routing

- [Analysis route](https://github.com/abutalaham/spectral-earth/blob/main/src/routes/analyze.tsx): `src/routes/analyze.tsx`
- [Router setup](https://github.com/abutalaham/spectral-earth/blob/main/src/router.tsx): `src/router.tsx`

### Analysis workflows

- [Analysis workspace](https://github.com/abutalaham/spectral-earth/blob/main/src/routes/analyze.tsx): `src/routes/analyze.tsx`
- [RGB image input](https://github.com/abutalaham/spectral-earth/blob/main/src/components/analysis/UploadPanel.tsx): `src/components/analysis/UploadPanel.tsx`
- [RGB results and exports](https://github.com/abutalaham/spectral-earth/blob/main/src/components/analysis/ResultsDashboard.tsx): `src/components/analysis/ResultsDashboard.tsx`
- [Spectral workflow](https://github.com/abutalaham/spectral-earth/blob/main/src/components/analysis/SpectralAnalysisView.tsx): `src/components/analysis/SpectralAnalysisView.tsx`
- [Sentinel band input](https://github.com/abutalaham/spectral-earth/blob/main/src/components/analysis/SpectralUploadCard.tsx): `src/components/analysis/SpectralUploadCard.tsx`
- [Copernicus guide](https://github.com/abutalaham/spectral-earth/blob/main/src/components/analysis/CopernicusHelpModal.tsx): `src/components/analysis/CopernicusHelpModal.tsx`
- [Spectral results](https://github.com/abutalaham/spectral-earth/blob/main/src/components/analysis/SpectralResultsDashboard.tsx): `src/components/analysis/SpectralResultsDashboard.tsx`

### Browser analysis

- [RGB comparison engine](https://github.com/abutalaham/spectral-earth/blob/main/src/lib/analysis/engine.ts): `src/lib/analysis/engine.ts`
- [Pixel difference](https://github.com/abutalaham/spectral-earth/blob/main/src/lib/analysis/difference.ts): `src/lib/analysis/difference.ts`
- [NDVI raster analysis](https://github.com/abutalaham/spectral-earth/blob/main/src/lib/analysis/ndvi.ts): `src/lib/analysis/ndvi.ts`
- [Synthetic spectral data](https://github.com/abutalaham/spectral-earth/blob/main/src/lib/analysis/ndviSamples.ts): `src/lib/analysis/ndviSamples.ts`
- [RGB sample imagery](https://github.com/abutalaham/spectral-earth/blob/main/src/lib/analysis/samples.ts): `src/lib/analysis/samples.ts`
- [Analysis report generation](https://github.com/abutalaham/spectral-earth/blob/main/src/lib/analysis/report.ts): `src/lib/analysis/report.ts`

### Product experience

- [Landing page](https://github.com/abutalaham/spectral-earth/blob/main/src/routes/index.tsx): `src/routes/index.tsx`
- [Hero scene](https://github.com/abutalaham/spectral-earth/blob/main/src/components/landing/HeroSection.tsx): `src/components/landing/HeroSection.tsx`
- [Static hero](https://github.com/abutalaham/spectral-earth/blob/main/src/components/landing/StaticHeroFallback.tsx): `src/components/landing/StaticHeroFallback.tsx`
- [Device capability check](https://github.com/abutalaham/spectral-earth/blob/main/src/hooks/useDeviceCapabilities.ts): `src/hooks/useDeviceCapabilities.ts`
- [Feature overview](https://github.com/abutalaham/spectral-earth/blob/main/src/components/landing/FeaturesSection.tsx): `src/components/landing/FeaturesSection.tsx`
- [Workflow overview](https://github.com/abutalaham/spectral-earth/blob/main/src/components/landing/WorkflowSection.tsx): `src/components/landing/WorkflowSection.tsx`
- [Responsible use](https://github.com/abutalaham/spectral-earth/blob/main/src/components/landing/ResponsibleUseSection.tsx): `src/components/landing/ResponsibleUseSection.tsx`

### Other components

- **User**
- **Copernicus Data Space**

## Connections

- User → Landing page: opens (evidence: `src/routes/index.tsx`)
- User → Analysis route: opens
- Landing page → Hero scene: renders (evidence: `src/routes/index.tsx`)
- Landing page → Feature overview: renders (evidence: `src/routes/index.tsx`)
- Landing page → Workflow overview: renders (evidence: `src/routes/index.tsx`)
- Landing page → Responsible use: renders (evidence: `src/routes/index.tsx`)
- Hero scene → Device capability check: checks (evidence: `src/components/landing/HeroSection.tsx`)
- Hero scene → Static hero: uses when constrained (evidence: `src/components/landing/HeroSection.tsx`)
- Analysis route → Analysis workspace: renders (evidence: `src/routes/analyze.tsx`)
- User → Analysis workspace: selects mode (evidence: `src/routes/analyze.tsx`)
- Analysis workspace → RGB image input: renders (evidence: `src/routes/analyze.tsx`)
- Analysis workspace → Spectral workflow: renders (evidence: `src/routes/analyze.tsx`)
- Analysis workspace → RGB sample imagery: loads samples (evidence: `src/routes/analyze.tsx`)
- Analysis workspace → RGB comparison engine: loads images (evidence: `src/routes/analyze.tsx`)
- Analysis workspace → RGB results and exports: shows results (evidence: `src/routes/analyze.tsx`)
- RGB comparison engine → Pixel difference: computes differences (evidence: `src/lib/analysis/engine.ts`)
- Spectral workflow → Sentinel band input: renders (evidence: `src/components/analysis/SpectralAnalysisView.tsx`)
- Spectral workflow → Copernicus guide: opens guide (evidence: `src/components/analysis/SpectralAnalysisView.tsx`)
- User → Copernicus Data Space: gets band data (evidence: `README.md`)
- Spectral workflow → Synthetic spectral data: loads sample data (evidence: `src/components/analysis/SpectralAnalysisView.tsx`)
- Spectral workflow → NDVI raster analysis: computes NDVI (evidence: `src/components/analysis/SpectralAnalysisView.tsx`)
- Spectral workflow → Spectral results: shows maps (evidence: `src/components/analysis/SpectralAnalysisView.tsx`)
- RGB results and exports → Analysis report generation: exports reports
- Router setup → Analysis route: registers route (evidence: `src/routeTree.gen.ts`)
