# 8x15yz/optimal-loads-gfs-viewer architecture

> Architecture diagram of the GitHub repository 8x15yz/optimal-loads-gfs-viewer, 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/8x15yz/optimal-loads-gfs-viewer
- Repository: https://github.com/8x15yz/optimal-loads-gfs-viewer

## Overview

Optimal-LOADS is a prototype ocean-and-atmosphere gridded-data pipeline with a FastAPI inventory and grid API. Its main workflow is scheduled source ingestion, processing and storage in S3/MongoDB, then metadata-driven retrieval for users; NOAA also has a documented S-100 conversion path. The graph includes operator ingestion controls, latest-data manifests, monitoring, and request logging. Some ingestion and ECMWF internals were not sampled, so uncertain source-to-ingestor links are shown as dashed rather than asserted.

Main entry points: [`2026-05-demo-v0.7/get_variables/noaa/noaa_gfs_ingest.py`](https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/get_variables/noaa/noaa_gfs_ingest.py) (NOAA GFS ingest), [`2026-05-demo-v0.7/fastapi-inventory/app/main.py`](https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/fastapi-inventory/app/main.py) (Web app entry), [`2026-05-demo-v0.7/fastapi-inventory/app/db.py`](https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/fastapi-inventory/app/db.py) (Database access), [`2026-05-demo-v0.7/fastapi-inventory/app/api.py`](https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/fastapi-inventory/app/api.py) (Grid data API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Data ingestion"]
  node_noaa_gate["NOAA run gate"]
  node_noaa_ingest["NOAA GFS ingest<br/>[noaa_gfs_ingest.py]"]
  node_ecmwf_pipeline["ECMWF pipeline<br/>[emcwf]"]
end

subgraph group_processing["Data products"]
  node_srp_package["SRP packaging"]
  node_srp_store["SRP package store<br/>[noaa_srp_store.py]"]
  node_depth_wrapper["S-100 conversion"]
  node_s102_metadata["S-102 metadata"]
  node_rerun_conversion["S-100 rerun"]
end

subgraph group_service["API and inventory"]
  node_app_main["Web app entry<br/>[main.py]"]
  node_grid_api["Grid data API<br/>[api.py]"]
  node_latest_api["Latest manifest<br/>[latest.py]"]
  node_models["Grid response model<br/>[models.py]"]
end

subgraph group_operations["Operations"]
  node_ingestion_ui["Ingestion controls<br/>[ingestion.py]"]
  node_monitoring["Usage monitoring<br/>[monitoring.py]"]
  node_request_logging["Request logging<br/>[request_logging.py]"]
end

subgraph group_storage["Persistence"]
  node_db_access["Database access<br/>[db.py]"]
end

node_scheduler(("Scheduler"))
node_data_user(("Data user"))
node_noaa(("NOAA GFS"))
node_cmems(("CMEMS"))
node_s3[("AWS S3")]
node_mongo[("MongoDB")]

node_scheduler -.->|"triggers"| node_noaa_gate
node_noaa_gate -->|"runs ingest"| node_noaa_ingest
node_noaa_gate -->|"probes availability"| node_srp_package
node_noaa -.->|"provides forecasts"| node_noaa_ingest
node_cmems -.->|"provides datasets"| node_ecmwf_pipeline
node_noaa_ingest -->|"converts grids"| node_depth_wrapper
node_noaa_ingest -->|"packages forecast"| node_srp_package
node_noaa_ingest -->|"stores package"| node_srp_store
node_noaa_ingest -.->|"uploads files"| node_s3
node_noaa_ingest -.->|"writes metadata"| node_mongo
node_ecmwf_pipeline -.->|"stores datasets"| node_s3
node_ecmwf_pipeline -.->|"stores metadata"| node_mongo
node_depth_wrapper -.->|"uploads products"| node_s3
node_depth_wrapper -.->|"writes tile metadata"| node_mongo
node_rerun_conversion -->|"reruns conversion"| node_depth_wrapper
node_s102_metadata -.->|"writes metadata"| node_mongo
node_data_user -->|"requests pages"| node_app_main
node_app_main -->|"routes requests"| node_grid_api
node_app_main -->|"routes requests"| node_latest_api
node_app_main -->|"mounts controls"| node_ingestion_ui
node_app_main -->|"mounts dashboard"| node_monitoring
node_app_main -->|"configures logging"| node_request_logging
node_grid_api -->|"queries metadata"| node_db_access
node_grid_api -->|"downloads grids"| node_s3
node_grid_api -->|"returns response"| node_models
node_latest_api -->|"queries latest data"| node_db_access
node_latest_api -->|"signs download URLs"| node_s3
node_db_access -->|"accesses collections"| node_mongo
node_ingestion_ui -->|"reads run state"| node_db_access
node_monitoring -->|"queries log data"| node_db_access
node_request_logging -->|"writes request logs"| node_db_access

click node_noaa_gate "https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/get_variables/noaa/noaa_gfs_gate_and_ingest.py"
click node_noaa_ingest "https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/get_variables/noaa/noaa_gfs_ingest.py"
click node_ecmwf_pipeline "https://github.com/8x15yz/optimal-loads-gfs-viewer/tree/main/2026-05-demo-v0.7/get_variables/emcwf"
click node_srp_package "https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/get_variables/noaa/noaa_srp_package.py"
click node_srp_store "https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/get_variables/noaa/noaa_srp_store.py"
click node_depth_wrapper "https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/get_variables/noaa/depth_conversion_wrapper.py"
click node_s102_metadata "https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/get_variables/s102/generate_s102_metadata.py"
click node_rerun_conversion "https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/fix_s100/rerun_s100_conversion.py"
click node_app_main "https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/fastapi-inventory/app/main.py"
click node_grid_api "https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/fastapi-inventory/app/api.py"
click node_latest_api "https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/fastapi-inventory/app/latest.py"
click node_db_access "https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/fastapi-inventory/app/db.py"
click node_models "https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/fastapi-inventory/app/models.py"
click node_ingestion_ui "https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/fastapi-inventory/app/ingestion.py"
click node_monitoring "https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/fastapi-inventory/app/monitoring.py"
click node_request_logging "https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/fastapi-inventory/app/request_logging.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_noaa_gate,node_noaa_ingest,node_ecmwf_pipeline,node_data_user toneBlue
class node_srp_package,node_srp_store,node_depth_wrapper,node_s102_metadata,node_rerun_conversion,node_s3,node_mongo toneAmber
class node_app_main,node_grid_api,node_latest_api,node_models toneMint
class node_ingestion_ui,node_monitoring,node_request_logging,node_scheduler toneRose
class node_db_access,node_noaa,node_cmems toneIndigo
```

## Components

### Data ingestion

- [NOAA run gate](https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/get_variables/noaa/noaa_gfs_gate_and_ingest.py): `2026-05-demo-v0.7/get_variables/noaa/noaa_gfs_gate_and_ingest.py`
- [NOAA GFS ingest](https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/get_variables/noaa/noaa_gfs_ingest.py): `2026-05-demo-v0.7/get_variables/noaa/noaa_gfs_ingest.py`
- [ECMWF pipeline](https://github.com/8x15yz/optimal-loads-gfs-viewer/tree/main/2026-05-demo-v0.7/get_variables/emcwf): `2026-05-demo-v0.7/get_variables/emcwf`

### Data products

- [SRP packaging](https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/get_variables/noaa/noaa_srp_package.py): `2026-05-demo-v0.7/get_variables/noaa/noaa_srp_package.py`
- [SRP package store](https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/get_variables/noaa/noaa_srp_store.py): `2026-05-demo-v0.7/get_variables/noaa/noaa_srp_store.py`
- [S-100 conversion](https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/get_variables/noaa/depth_conversion_wrapper.py): `2026-05-demo-v0.7/get_variables/noaa/depth_conversion_wrapper.py`
- [S-102 metadata](https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/get_variables/s102/generate_s102_metadata.py): `2026-05-demo-v0.7/get_variables/s102/generate_s102_metadata.py`
- [S-100 rerun](https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/fix_s100/rerun_s100_conversion.py): `2026-05-demo-v0.7/fix_s100/rerun_s100_conversion.py`

### API and inventory

- [Web app entry](https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/fastapi-inventory/app/main.py): `2026-05-demo-v0.7/fastapi-inventory/app/main.py`
- [Grid data API](https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/fastapi-inventory/app/api.py): `2026-05-demo-v0.7/fastapi-inventory/app/api.py`
- [Latest manifest](https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/fastapi-inventory/app/latest.py): `2026-05-demo-v0.7/fastapi-inventory/app/latest.py`
- [Grid response model](https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/fastapi-inventory/app/models.py): `2026-05-demo-v0.7/fastapi-inventory/app/models.py`

### Operations

- [Ingestion controls](https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/fastapi-inventory/app/ingestion.py): `2026-05-demo-v0.7/fastapi-inventory/app/ingestion.py`
- [Usage monitoring](https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/fastapi-inventory/app/monitoring.py): `2026-05-demo-v0.7/fastapi-inventory/app/monitoring.py`
- [Request logging](https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/fastapi-inventory/app/request_logging.py): `2026-05-demo-v0.7/fastapi-inventory/app/request_logging.py`

### Persistence

- [Database access](https://github.com/8x15yz/optimal-loads-gfs-viewer/blob/main/2026-05-demo-v0.7/fastapi-inventory/app/db.py): `2026-05-demo-v0.7/fastapi-inventory/app/db.py`

### Other components

- **Scheduler**
- **Data user**
- **NOAA GFS**
- **CMEMS**
- **AWS S3**
- **MongoDB**

## Connections

- Scheduler → NOAA run gate: triggers
- NOAA run gate → NOAA GFS ingest: runs ingest (evidence: `2026-05-demo-v0.7/get_variables/noaa/noaa_gfs_gate_and_ingest.py`)
- NOAA run gate → SRP packaging: probes availability (evidence: `2026-05-demo-v0.7/get_variables/noaa/noaa_gfs_gate_and_ingest.py`)
- NOAA GFS → NOAA GFS ingest: provides forecasts
- CMEMS → ECMWF pipeline: provides datasets
- NOAA GFS ingest → S-100 conversion: converts grids (evidence: `2026-05-demo-v0.7/get_variables/noaa/noaa_gfs_ingest.py`)
- NOAA GFS ingest → SRP packaging: packages forecast (evidence: `2026-05-demo-v0.7/get_variables/noaa/noaa_gfs_ingest.py`)
- NOAA GFS ingest → SRP package store: stores package (evidence: `2026-05-demo-v0.7/get_variables/noaa/noaa_gfs_ingest.py`)
- NOAA GFS ingest → AWS S3: uploads files
- NOAA GFS ingest → MongoDB: writes metadata
- ECMWF pipeline → AWS S3: stores datasets
- ECMWF pipeline → MongoDB: stores metadata
- S-100 conversion → AWS S3: uploads products
- S-100 conversion → MongoDB: writes tile metadata
- S-100 rerun → S-100 conversion: reruns conversion (evidence: `2026-05-demo-v0.7/fix_s100/rerun_s100_conversion.py`)
- S-102 metadata → MongoDB: writes metadata
- Data user → Web app entry: requests pages (evidence: `2026-05-demo-v0.7/fastapi-inventory/app/main.py`)
- Web app entry → Grid data API: routes requests (evidence: `2026-05-demo-v0.7/fastapi-inventory/app/main.py`)
- Web app entry → Latest manifest: routes requests (evidence: `2026-05-demo-v0.7/fastapi-inventory/app/main.py`)
- Web app entry → Ingestion controls: mounts controls (evidence: `2026-05-demo-v0.7/fastapi-inventory/app/main.py`)
- Web app entry → Usage monitoring: mounts dashboard (evidence: `2026-05-demo-v0.7/fastapi-inventory/app/main.py`)
- Web app entry → Request logging: configures logging (evidence: `2026-05-demo-v0.7/fastapi-inventory/app/main.py`)
- Grid data API → Database access: queries metadata (evidence: `2026-05-demo-v0.7/fastapi-inventory/app/api.py`)
- Grid data API → AWS S3: downloads grids (evidence: `2026-05-demo-v0.7/fastapi-inventory/app/api.py`)
- Grid data API → Grid response model: returns response (evidence: `2026-05-demo-v0.7/fastapi-inventory/app/api.py`)
- Latest manifest → Database access: queries latest data (evidence: `2026-05-demo-v0.7/fastapi-inventory/app/latest.py`)
- Latest manifest → AWS S3: signs download URLs (evidence: `2026-05-demo-v0.7/fastapi-inventory/app/latest.py`)
- Database access → MongoDB: accesses collections (evidence: `2026-05-demo-v0.7/fastapi-inventory/app/db.py`)
- Ingestion controls → Database access: reads run state (evidence: `2026-05-demo-v0.7/fastapi-inventory/app/ingestion.py`)
- Usage monitoring → Database access: queries log data (evidence: `2026-05-demo-v0.7/fastapi-inventory/app/monitoring.py`)
- Request logging → Database access: writes request logs (evidence: `2026-05-demo-v0.7/fastapi-inventory/app/request_logging.py`)
