Files
radarsargasses/docs/roadmap.md
Gwadaking 2cef3725e9 feat: Phase 3 complete — push alerts, feedback scoring, S3 fallback, SPA routing, mobile CSS
- ImpactScoreService: implement getFeedbackBonus() (ST_Distance query on UserFeedback within 20km/6h)
- ImpactScoreService: trigger PushNotificationService when score >= 70
- PushNotificationService: send VAPID WebPush to spot subscribers, clean expired subs
- PushController: GET vapid-public-key, POST/DELETE subscribe with rate limiting
- SentinelHubClient: add optional $collection param, add Sentinel-3 OLCI FAI evalscript (MCI)
- IngestionService: add $collection param + HighCloudCoverageException for fallback logic
- IngestionService: add ingestWithFallback() — tries S2, falls back to S3 on high cloud
- IngestSentinelCommand: --source=auto (default) triggers ingestWithFallback
- FeedbackController: rate limiting via apiFeedbackLimiter
- Migration: push_subscription table
- rate_limiter.yaml: api_read(120/min), api_feedback(10/min), api_push(5/min)
- sw.js: service worker handling push events + notificationclick
- usePushSubscription hook: subscribe/unsubscribe lifecycle with VAPID
- SpotPanel: PushButton component integrated
- SpotPanel.css + TimelineSlider.css: mobile responsive (bottom-sheet on small screens)
- Caddyfile: SPA served at / with try_files fallback, sw.js served from root scope
- vite.config.js: build outDir → backend/public (not /spa)
- deploy/post-receive.sh: full deploy script (composer, npm build, migrations, cache, docker up)
- docs/roadmap.md: all Phase 3 + transversal items marked done

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 03:43:56 -04:00

5.6 KiB

ROADMAP — Sargasse-Sentry

Checklist permanente d'avancement projet. Mettre à jour au fil des implémentations.


Légende

  • À faire
  • [~] En cours
  • Terminé

Phase 0 — Fondations

Infrastructure & environnement

  • Initialisation dépôt Git (bare repo VPS + hook post-receive)
  • Configuration Docker (FrankenPHP + PostgreSQL/PostGIS + Redis)
  • Configuration Traefik (domaine radarsargasses971.com, SSL Let's Encrypt)
  • Variables d'environnement (.env + clés VAPID documentées)
  • Initialisation projet Symfony (symfony new backend)
  • Installation API Platform
  • Initialisation projet React (npm create vite@latest frontend)
  • Configuration MapLibre GL JS + react-map-gl

Base de données

  • Extension PostGIS activée (dans la migration)
  • Migration : SargassumObservation
  • Migration : SargassumForecast
  • Migration : DataIngestionJob
  • Migration : CoastalPoint
  • Migration : ImpactScore
  • Migration : UserFeedback
  • Migration : PushSubscription
  • Index spatiaux (GIST) + index BTREE définis

Phase 1 — MVP (Antilles, observations uniquement)

Pipeline d'ingestion

  • Cron VPS (docker exec toutes les 3h) → app:ingest-sentinel
  • Appel API Sentinel Hub (bandes B04, B08, B11 via evalscript)
  • Création DataIngestionJob (pending → success/failed)
  • Retry automatique + logging erreurs
  • Filtrage nuages via Catalog API (seuil 60%, configurable)
  • Calcul AFAI dans evalscript Sentinel Hub (formule complète)
  • Rasterisation → raster UINT8 binaire (evalscript cloud-side)
  • Vectorisation GDAL (gdal_polygonize.py) + simplification PostGIS
  • Persistance SargassumObservation
  • Génération vector tiles (Tippecanoe → .pbf) — différé Phase 2

API Backend

  • GET /api/spots — liste CoastalPoints (API Platform)
  • GET /api/spots/{id} — détail (API Platform)
  • GET /api/spots/{id}/score — score + niveau + trend
  • GET /api/observations?bbox=&date=&source= — PostGIS ST_Intersects
  • GET /api/observations/{id} — détail avec geometry GeoJSON
  • GET /api/forecasts — API Platform
  • POST /api/feedback — feedback anonyme (IP hachée)

Frontend React

  • Carte de base (MapLibre GL JS + fond CARTO dark)
  • Affichage observations GeoJSON (bbox dynamique au mouvement)
  • Marqueurs CoastalPoints avec sélection
  • SpotPanel : Spot Mode complet (score, niveau, distance, trend)
  • Bouton feedback terrain (confirmation/infirmation anonyme)
  • Build Vite → backend/public/ (SPA servie depuis la racine par Caddy)

Données initiales

  • Seed CoastalPoint zone Antilles — 29 points (plages, ports, surf, pêche)

Phase 2 — Dérive & Score

Pipeline — simulation de dérive

  • Vent horaire via Open-Meteo (gratuit, sans clé, JSON)
  • Échantillonnage PostGIS ST_GeneratePoints (30 points internes)
  • Déplacement horaire itératif (modèle Stokes 3% vent)
  • Reconstruction ST_ConcaveHull (PostGIS 3.4)
  • Génération horizons H+6, H+12, H+24, H+48 avec confiance décroissante
  • Persistance SargassumForecast
  • Génération vector tiles prédictions (Tippecanoe) — différé

Calcul ImpactScore

  • Score par CoastalPoint : distance(40) + densité(30) + vitesse(20) + tendance(10)
  • Persistance ImpactScore
  • Mise en cache Redis (TTL 3h) via ImpactScoreService

API Backend

  • GET /api/spots/{id}/score — score courant + horizons H+6/12/24/48
  • GET /api/spots/{id}/score?at={datetime} — score à un instant
  • GET /api/forecasts?bbox=&horizon= — prédictions par zone + horizon (API Platform)

Frontend React

  • Slider temporel (Now → +6h → +12h → +24h → +48h)
  • Spot Mode complet par horizon (OK / Risque / Impact + confiance)
  • Mise à jour dynamique polygones + score sur slider
  • Couche forecasts (violet pointillé) vs observations (orange plein)
  • Gradients radiaux densité — différé

Phase 3 — Feedback & Alertes

Boucle d'apprentissage

  • Bouton "Je confirme présence de sargasses"
  • POST /api/feedback — persistance UserFeedback anonyme
  • Intégration feedback dans calcul score (bonus +8 pts si présence confirmée < 6h dans rayon 20 km)

Alertes push

  • Commande app:generate-vapid-keys (génération clés VAPID)
  • GET /api/push/vapid-public-key — clé publique VAPID
  • POST /api/push/subscribe — enregistrement abonnement push
  • DELETE /api/push/subscribe — désinscription
  • PushNotificationService — envoi WebPush VAPID, nettoyage abonnements expirés
  • Déclenchement alertes si score ≥ 70 (HIGH_SCORE_THRESHOLD)
  • Service worker (sw.js) — réception push + ouverture app au clic
  • usePushSubscription hook React — subscribe/unsubscribe lifecycle
  • Bouton "Activer les alertes" dans SpotPanel

Transversal (continu)

  • Rate limiting endpoints publics (api_read 120/min, api_feedback 10/min, api_push 5/min)
  • Fallback Sentinel-2 → Sentinel-3 OLCI (mode auto dans IngestSentinelCommand)
  • Routing SPA corrigé (Caddyfile try_files + build vers backend/public/)
  • Vue mobile (SpotPanel bottom-sheet + TimelineSlider compact)
  • Post-receive hook complet (composer + npm build + migrations + cache + docker up)
  • Monitoring pipeline (alertes si ingestion échoue > N fois)
  • Logs structurés (Monolog JSON handler)
  • Configuration Cloudflare free tier (cache tiles statiques)
  • Tests fonctionnels pipeline (ingestion → score)