How tauqeerahmed0309/oceanshield-backend works
OceanShield AI is a maritime spill-intelligence platform: it ingests live or replayed AIS and satellite SAR data, detects vessel anomalies and slick candidates, correlates evidence to attribute vessels and assess risk, then exposes incidents, reports, analytics, and alerts through a React dashboard and FastAPI API. The graph follows the documented stages and sampled startup, ingestion, correlation, persistence, and frontend API wiring. Several endpoint and task implementations were not sampled, so their internal call relationships are omitted; documented capabilities remain represented.
Main entry points: api REST routers · json_store.py JSON data store · main.py FastAPI app · run_spill_pipeline.py Spill pipeline
Components 28
Dashboard
- Web dashboard
oceanshield-ai/src/App.tsx - Operations views
oceanshield-ai/src/pages - API client
oceanshield-ai/src/api/client.ts
API Surface
- FastAPI app
backend/app/main.py - REST routers
backend/app/api
Data Ingestion
- AIS supervisor
backend/app/ingestion/ais_supervisor.py - AIS message handler
backend/app/ingestion/aisstream_client.py - AIS replay
backend/app/ingestion/ais_replay_client.py - SAR catalogue poll
backend/app/tasks/poll_sar_catalogue.py - SAR fetchers
backend/app/ingestion/sar_fetcher.py
Detection & Attribution
- Anomaly scoring
backend/app/tasks/run_anomaly_detection.py - Anomaly model
backend/app/ml/anomaly_detector.py - Spill pipeline
backend/app/tasks/run_spill_pipeline.py - Slick segmentation
backend/app/ml/unet_segmentation.py - Filter correlation
backend/app/processing/correlation_engine.py - Five-layer filters
backend/app/filters - Risk scoring
backend/app/processing/risk_scoring.py - Vessel attribution
backend/app/ml/vessel_attribution.py - Drift prediction
backend/app/ml/drift_prediction.py
Incidents & Storage
- JSON data store
backend/app/db/json_store.py - Maritime records
backend/app/models - Incident reports
backend/app/api/reports.py - ICG notifications
backend/app/alerting/icg_notifier.py
Other components
- Maritime operator
- AIS feed
- SAR catalogue
- ICG / MRCC
- Open-Meteo
Connections 39
- Maritime operator → Web dashboard: uses
- Web dashboard → Operations views: renders
- Operations views → API client: requests data
- API client → FastAPI app: REST JSON
- FastAPI app → REST routers: registers routes
- FastAPI app → AIS supervisor: starts feed
- AIS supervisor → AIS message handler: connects live
- AIS feed → AIS message handler: streams positions
- AIS supervisor → AIS replay: falls back
- AIS replay → AIS message handler: reuses handler
- AIS message handler → JSON data store: writes positions/history
- FastAPI app → Anomaly scoring: schedules
- Anomaly scoring → JSON data store: reads history
- Anomaly scoring → Anomaly model: scores vessels
- Anomaly scoring → JSON data store: writes anomalies
- FastAPI app → Spill pipeline: schedules
- Spill pipeline → JSON data store: reads anomalies
- Spill pipeline → Risk scoring: scores candidates
- Spill pipeline → JSON data store: writes candidates/incidents
- Spill pipeline → Vessel attribution: ranks vessels
- Vessel attribution → JSON data store: queries positions
- SAR catalogue → SAR catalogue poll: provides scenes
- FastAPI app → SAR catalogue poll: schedules
- SAR catalogue poll → SAR fetchers: acquires imagery
- SAR fetchers → JSON data store: stores scenes
- Slick segmentation → Filter correlation: supplies mask
- Filter correlation → Five-layer filters: applies layers
- Filter correlation → Risk scoring: computes score
- Five-layer filters → Open-Meteo: gets wind
- REST routers → JSON data store: serves records
- REST routers → Slick segmentation: analyzes uploads
- REST routers → Filter correlation: filters candidates
- REST routers → Drift prediction: requests drift
- REST routers → Vessel attribution: requests attribution
- REST routers → Incident reports: generates reports
- REST routers → ICG notifications: dispatches alerts
- ICG notifications → ICG / MRCC: notifies
- Incident reports → JSON data store: reads incidents
- REST routers → Maritime records: returns domain data