# tanishktewetia/ocean-scope architecture

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

- Interactive diagram: https://gitdiagram.com/tanishktewetia/ocean-scope
- Repository: https://github.com/tanishktewetia/ocean-scope

## Overview

OceanScope lets scientists explore ocean model fields and observations in a browser, compare profiles, upload data, and serve interoperable GIS products. The main workflow runs from the React workspace through API requests to FastAPI routes and scientific data processing, then returns grids and profiles for visualization. The graph also preserves comparison, hazards, bathymetry, uploads, and OGC capabilities. Some subsystems are represented from README and source-index references because their implementation excerpts were not shown; those limits are reflected by omitted or dashed links.

Main entry points: [`backend/services/slicer.py`](https://github.com/tanishktewetia/ocean-scope/blob/main/backend/services/slicer.py) (Ocean slicer), [`frontend/src/components/OceanScene3D.jsx`](https://github.com/tanishktewetia/ocean-scope/blob/main/frontend/src/components/OceanScene3D.jsx) (3D workspace), [`backend/main.py`](https://github.com/tanishktewetia/ocean-scope/blob/main/backend/main.py) (FastAPI application), [`backend/services/argo.py`](https://github.com/tanishktewetia/ocean-scope/blob/main/backend/services/argo.py) (Argo profiles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser workspace"]
  node_app["App routing<br/>[App.jsx]"]
  node_ocean_scene["3D workspace<br/>[OceanScene3D.jsx]"]
  node_heatmap["Layered heatmap<br/>[HeatmapCanvas.jsx]"]
  node_comparison_page["Comparison page<br/>[ComparisonPage.jsx]"]
  node_about_page["Context pages<br/>[AboutPage.jsx]"]
  node_upload_ui["Dataset upload<br/>[DatasetUpload.jsx]"]
  node_instrument_overlay["Instrument overlay"]
  node_profile_chart["Profile chart<br/>[ProfileChart.jsx]"]
  node_color_scale["Color scaling<br/>[colorScale.js]"]
  node_gibs_imagery["Satellite imagery<br/>[gibsImagery.js]"]
  node_iso_surface["Isosurfaces<br/>[isosurface.js]"]
  node_particles["Current particles"]
  node_region_selection["Region selection<br/>[regionSelection.js]"]
end

subgraph group_api["API surface"]
  node_api_client["API client<br/>[client.js]"]
  node_fastapi["FastAPI application<br/>[main.py]"]
  node_ocean_router["Ocean routes<br/>[ocean.py]"]
  node_argo_router["Argo routes<br/>[argo.py]"]
  node_instrument_router["Instrument routes<br/>[instruments.py]"]
  node_ogc_router["OGC routes<br/>[ogc.py]"]
  node_hazard_router["Hazard routes<br/>[hazards.py]"]
end

subgraph group_science["Scientific processing"]
  node_slicer["Ocean slicer<br/>[slicer.py]"]
  node_argo_service["Argo profiles<br/>[argo.py]"]
  node_instruments["Instrument catalog<br/>[instruments.py]"]
  node_comparison["Model comparison<br/>[comparison.py]"]
  node_metrics["Validation metrics<br/>[metrics.py]"]
  node_ogc_service["OGC rendering<br/>[ogc.py]"]
  node_hazards["Hazard discovery<br/>[hazards.py]"]
  node_bathymetry["Bathymetry<br/>[bathymetry.py]"]
end

subgraph group_data["Data and integrations"]
  node_storage[("Data storage<br/>[storage.py]")]
  node_copernicus[("Copernicus Marine")]
  node_argo_gdac[("Argo GDAC")]
  node_gebco[("GEBCO bathymetry")]
  node_gibssvc["NASA GIBS"]
end

node_scientist(("Scientist"))

node_scientist -->|"opens"| node_app
node_app -->|"renders"| node_ocean_scene
node_app -->|"renders"| node_heatmap
node_app -->|"routes to"| node_comparison_page
node_app -->|"routes to"| node_about_page
node_ocean_scene -->|"requests data"| node_api_client
node_ocean_scene -->|"renders"| node_instrument_overlay
node_heatmap -->|"requests grids"| node_api_client
node_heatmap -->|"uses"| node_color_scale
node_heatmap -->|"uses"| node_gibs_imagery
node_ocean_scene -->|"uses"| node_iso_surface
node_ocean_scene -->|"uses"| node_particles
node_ocean_scene -->|"uses"| node_region_selection
node_instrument_overlay -->|"loads catalog"| node_api_client
node_instrument_overlay -->|"renders"| node_profile_chart
node_upload_ui -->|"uploads data"| node_api_client
node_api_client -->|"calls endpoints"| node_fastapi
node_fastapi -->|"registers"| node_ocean_router
node_fastapi -->|"registers"| node_argo_router
node_fastapi -->|"registers"| node_instrument_router
node_fastapi -->|"registers"| node_ogc_router
node_fastapi -->|"registers"| node_hazard_router
node_ocean_router -->|"requests fields"| node_slicer
node_ocean_router -->|"requests depths"| node_bathymetry
node_argo_router -->|"requests profiles"| node_argo_service
node_argo_router -->|"requests model data"| node_slicer
node_instrument_router -->|"uses profiles"| node_argo_service
node_instrument_router -->|"requests catalog"| node_instruments
node_instrument_router -->|"requests model data"| node_slicer
node_ogc_router -->|"renders responses"| node_ogc_service
node_ogc_router -->|"handles unavailable data"| node_slicer
node_hazard_router -->|"requests events"| node_hazards
node_argo_service -->|"compares profiles"| node_comparison
node_comparison -->|"calculates scores"| node_metrics
node_comparison -->|"samples model fields"| node_slicer
node_slicer -->|"loads datasets"| node_storage
node_argo_service -->|"ensures storage"| node_storage
node_instruments -->|"uses profiles"| node_argo_service
node_instruments -->|"uses storage"| node_storage
node_ogc_service -->|"reads fields"| node_slicer
node_bathymetry -->|"uses storage"| node_storage
node_storage -.->|"loads subsets"| node_copernicus
node_argo_service -.->|"reads observations"| node_argo_gdac
node_bathymetry -.->|"loads grids"| node_gebco
node_gibs_imagery -.->|"fetches imagery"| node_gibssvc

click node_app "https://github.com/tanishktewetia/ocean-scope/blob/main/frontend/src/App.jsx"
click node_ocean_scene "https://github.com/tanishktewetia/ocean-scope/blob/main/frontend/src/components/OceanScene3D.jsx"
click node_heatmap "https://github.com/tanishktewetia/ocean-scope/blob/main/frontend/src/components/HeatmapCanvas.jsx"
click node_comparison_page "https://github.com/tanishktewetia/ocean-scope/blob/main/frontend/src/pages/ComparisonPage.jsx"
click node_about_page "https://github.com/tanishktewetia/ocean-scope/blob/main/frontend/src/pages/AboutPage.jsx"
click node_upload_ui "https://github.com/tanishktewetia/ocean-scope/blob/main/frontend/src/components/DatasetUpload.jsx"
click node_instrument_overlay "https://github.com/tanishktewetia/ocean-scope/blob/main/frontend/src/components/InstrumentOverlay.jsx"
click node_profile_chart "https://github.com/tanishktewetia/ocean-scope/blob/main/frontend/src/components/ProfileChart.jsx"
click node_color_scale "https://github.com/tanishktewetia/ocean-scope/blob/main/frontend/src/utils/colorScale.js"
click node_gibs_imagery "https://github.com/tanishktewetia/ocean-scope/blob/main/frontend/src/utils/gibsImagery.js"
click node_iso_surface "https://github.com/tanishktewetia/ocean-scope/blob/main/frontend/src/utils/isosurface.js"
click node_particles "https://github.com/tanishktewetia/ocean-scope/blob/main/frontend/src/utils/currentParticles.js"
click node_region_selection "https://github.com/tanishktewetia/ocean-scope/blob/main/frontend/src/utils/regionSelection.js"
click node_api_client "https://github.com/tanishktewetia/ocean-scope/blob/main/frontend/src/api/client.js"
click node_fastapi "https://github.com/tanishktewetia/ocean-scope/blob/main/backend/main.py"
click node_ocean_router "https://github.com/tanishktewetia/ocean-scope/blob/main/backend/routers/ocean.py"
click node_argo_router "https://github.com/tanishktewetia/ocean-scope/blob/main/backend/routers/argo.py"
click node_instrument_router "https://github.com/tanishktewetia/ocean-scope/blob/main/backend/routers/instruments.py"
click node_ogc_router "https://github.com/tanishktewetia/ocean-scope/blob/main/backend/routers/ogc.py"
click node_hazard_router "https://github.com/tanishktewetia/ocean-scope/blob/main/backend/routers/hazards.py"
click node_slicer "https://github.com/tanishktewetia/ocean-scope/blob/main/backend/services/slicer.py"
click node_argo_service "https://github.com/tanishktewetia/ocean-scope/blob/main/backend/services/argo.py"
click node_instruments "https://github.com/tanishktewetia/ocean-scope/blob/main/backend/services/instruments.py"
click node_comparison "https://github.com/tanishktewetia/ocean-scope/blob/main/backend/services/comparison.py"
click node_metrics "https://github.com/tanishktewetia/ocean-scope/blob/main/backend/services/metrics.py"
click node_ogc_service "https://github.com/tanishktewetia/ocean-scope/blob/main/backend/services/ogc.py"
click node_hazards "https://github.com/tanishktewetia/ocean-scope/blob/main/backend/services/hazards.py"
click node_bathymetry "https://github.com/tanishktewetia/ocean-scope/blob/main/backend/services/bathymetry.py"
click node_storage "https://github.com/tanishktewetia/ocean-scope/blob/main/backend/services/storage.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_app,node_ocean_scene,node_heatmap,node_comparison_page,node_about_page,node_upload_ui,node_instrument_overlay,node_profile_chart,node_color_scale,node_gibs_imagery,node_iso_surface,node_particles,node_region_selection toneBlue
class node_api_client,node_fastapi,node_ocean_router,node_argo_router,node_instrument_router,node_ogc_router,node_hazard_router toneAmber
class node_slicer,node_argo_service,node_instruments,node_comparison,node_metrics,node_ogc_service,node_hazards,node_bathymetry toneMint
class node_storage,node_copernicus,node_argo_gdac,node_gebco,node_gibssvc toneRose
class node_scientist toneIndigo
```

## Components

### Browser workspace

- [App routing](https://github.com/tanishktewetia/ocean-scope/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [3D workspace](https://github.com/tanishktewetia/ocean-scope/blob/main/frontend/src/components/OceanScene3D.jsx): `frontend/src/components/OceanScene3D.jsx`
- [Layered heatmap](https://github.com/tanishktewetia/ocean-scope/blob/main/frontend/src/components/HeatmapCanvas.jsx): `frontend/src/components/HeatmapCanvas.jsx`
- [Comparison page](https://github.com/tanishktewetia/ocean-scope/blob/main/frontend/src/pages/ComparisonPage.jsx): `frontend/src/pages/ComparisonPage.jsx`
- [Context pages](https://github.com/tanishktewetia/ocean-scope/blob/main/frontend/src/pages/AboutPage.jsx): `frontend/src/pages/AboutPage.jsx`
- [Dataset upload](https://github.com/tanishktewetia/ocean-scope/blob/main/frontend/src/components/DatasetUpload.jsx): `frontend/src/components/DatasetUpload.jsx`
- [Instrument overlay](https://github.com/tanishktewetia/ocean-scope/blob/main/frontend/src/components/InstrumentOverlay.jsx): `frontend/src/components/InstrumentOverlay.jsx`
- [Profile chart](https://github.com/tanishktewetia/ocean-scope/blob/main/frontend/src/components/ProfileChart.jsx): `frontend/src/components/ProfileChart.jsx`
- [Color scaling](https://github.com/tanishktewetia/ocean-scope/blob/main/frontend/src/utils/colorScale.js): `frontend/src/utils/colorScale.js`
- [Satellite imagery](https://github.com/tanishktewetia/ocean-scope/blob/main/frontend/src/utils/gibsImagery.js): `frontend/src/utils/gibsImagery.js`
- [Isosurfaces](https://github.com/tanishktewetia/ocean-scope/blob/main/frontend/src/utils/isosurface.js): `frontend/src/utils/isosurface.js`
- [Current particles](https://github.com/tanishktewetia/ocean-scope/blob/main/frontend/src/utils/currentParticles.js): `frontend/src/utils/currentParticles.js`
- [Region selection](https://github.com/tanishktewetia/ocean-scope/blob/main/frontend/src/utils/regionSelection.js): `frontend/src/utils/regionSelection.js`

### API surface

- [API client](https://github.com/tanishktewetia/ocean-scope/blob/main/frontend/src/api/client.js): `frontend/src/api/client.js`
- [FastAPI application](https://github.com/tanishktewetia/ocean-scope/blob/main/backend/main.py): `backend/main.py`
- [Ocean routes](https://github.com/tanishktewetia/ocean-scope/blob/main/backend/routers/ocean.py): `backend/routers/ocean.py`
- [Argo routes](https://github.com/tanishktewetia/ocean-scope/blob/main/backend/routers/argo.py): `backend/routers/argo.py`
- [Instrument routes](https://github.com/tanishktewetia/ocean-scope/blob/main/backend/routers/instruments.py): `backend/routers/instruments.py`
- [OGC routes](https://github.com/tanishktewetia/ocean-scope/blob/main/backend/routers/ogc.py): `backend/routers/ogc.py`
- [Hazard routes](https://github.com/tanishktewetia/ocean-scope/blob/main/backend/routers/hazards.py): `backend/routers/hazards.py`

### Scientific processing

- [Ocean slicer](https://github.com/tanishktewetia/ocean-scope/blob/main/backend/services/slicer.py): `backend/services/slicer.py`
- [Argo profiles](https://github.com/tanishktewetia/ocean-scope/blob/main/backend/services/argo.py): `backend/services/argo.py`
- [Instrument catalog](https://github.com/tanishktewetia/ocean-scope/blob/main/backend/services/instruments.py): `backend/services/instruments.py`
- [Model comparison](https://github.com/tanishktewetia/ocean-scope/blob/main/backend/services/comparison.py): `backend/services/comparison.py`
- [Validation metrics](https://github.com/tanishktewetia/ocean-scope/blob/main/backend/services/metrics.py): `backend/services/metrics.py`
- [OGC rendering](https://github.com/tanishktewetia/ocean-scope/blob/main/backend/services/ogc.py): `backend/services/ogc.py`
- [Hazard discovery](https://github.com/tanishktewetia/ocean-scope/blob/main/backend/services/hazards.py): `backend/services/hazards.py`
- [Bathymetry](https://github.com/tanishktewetia/ocean-scope/blob/main/backend/services/bathymetry.py): `backend/services/bathymetry.py`

### Data and integrations

- [Data storage](https://github.com/tanishktewetia/ocean-scope/blob/main/backend/services/storage.py): `backend/services/storage.py`
- **Copernicus Marine**
- **Argo GDAC**
- **GEBCO bathymetry**
- **NASA GIBS**

### Other components

- **Scientist**

## Connections

- Scientist → App routing: opens (evidence: `README.md`)
- App routing → 3D workspace: renders (evidence: `frontend/src/App.jsx`)
- App routing → Layered heatmap: renders (evidence: `frontend/src/App.jsx`)
- App routing → Comparison page: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Context pages: routes to (evidence: `frontend/src/App.jsx`)
- 3D workspace → API client: requests data (evidence: `frontend/src/components/OceanScene3D.jsx`)
- 3D workspace → Instrument overlay: renders (evidence: `frontend/src/components/OceanScene3D.jsx`)
- Layered heatmap → API client: requests grids (evidence: `frontend/src/components/HeatmapCanvas.jsx`)
- Layered heatmap → Color scaling: uses (evidence: `frontend/src/components/HeatmapCanvas.jsx`)
- Layered heatmap → Satellite imagery: uses (evidence: `frontend/src/components/HeatmapCanvas.jsx`)
- 3D workspace → Isosurfaces: uses (evidence: `frontend/src/components/OceanScene3D.jsx`)
- 3D workspace → Current particles: uses (evidence: `frontend/src/components/OceanScene3D.jsx`)
- 3D workspace → Region selection: uses (evidence: `frontend/src/components/OceanScene3D.jsx`)
- Instrument overlay → API client: loads catalog (evidence: `frontend/src/components/InstrumentOverlay.jsx`)
- Instrument overlay → Profile chart: renders (evidence: `frontend/src/components/InstrumentOverlay.jsx`)
- Dataset upload → API client: uploads data (evidence: `frontend/src/components/DatasetUpload.jsx`)
- API client → FastAPI application: calls endpoints (evidence: `frontend/src/api/client.js`)
- FastAPI application → Ocean routes: registers (evidence: `backend/main.py`)
- FastAPI application → Argo routes: registers (evidence: `backend/main.py`)
- FastAPI application → Instrument routes: registers (evidence: `backend/main.py`)
- FastAPI application → OGC routes: registers (evidence: `backend/main.py`)
- FastAPI application → Hazard routes: registers (evidence: `backend/main.py`)
- Ocean routes → Ocean slicer: requests fields (evidence: `backend/routers/ocean.py`)
- Ocean routes → Bathymetry: requests depths (evidence: `backend/routers/ocean.py`)
- Argo routes → Argo profiles: requests profiles (evidence: `backend/routers/argo.py`)
- Argo routes → Ocean slicer: requests model data (evidence: `backend/routers/argo.py`)
- Instrument routes → Argo profiles: uses profiles (evidence: `backend/routers/instruments.py`)
- Instrument routes → Instrument catalog: requests catalog (evidence: `backend/routers/instruments.py`)
- Instrument routes → Ocean slicer: requests model data (evidence: `backend/routers/instruments.py`)
- OGC routes → OGC rendering: renders responses (evidence: `backend/routers/ogc.py`)
- OGC routes → Ocean slicer: handles unavailable data (evidence: `backend/routers/ogc.py`)
- Hazard routes → Hazard discovery: requests events (evidence: `backend/routers/hazards.py`)
- Argo profiles → Model comparison: compares profiles (evidence: `backend/services/argo.py`)
- Model comparison → Validation metrics: calculates scores (evidence: `backend/services/comparison.py`)
- Model comparison → Ocean slicer: samples model fields (evidence: `backend/services/comparison.py`)
- Ocean slicer → Data storage: loads datasets (evidence: `backend/services/slicer.py`)
- Argo profiles → Data storage: ensures storage (evidence: `backend/services/argo.py`)
- Instrument catalog → Argo profiles: uses profiles (evidence: `backend/services/instruments.py`)
- Instrument catalog → Data storage: uses storage (evidence: `backend/services/instruments.py`)
- OGC rendering → Ocean slicer: reads fields (evidence: `backend/services/ogc.py`)
- Bathymetry → Data storage: uses storage (evidence: `backend/services/bathymetry.py`)
- Data storage → Copernicus Marine: loads subsets (evidence: `README.md`)
- Argo profiles → Argo GDAC: reads observations (evidence: `README.md`)
- Bathymetry → GEBCO bathymetry: loads grids (evidence: `README.md`)
- Satellite imagery → NASA GIBS: fetches imagery (evidence: `README.md`)
