Site d utilite publique - Vigilance Meteo France temps reel
Find a file
Florian 2c4d91ce2f
Some checks are pending
Deploy info-canicule / deploy (push) Waiting to run
feat: graph T° interactif + widget iframe + MF auth + E2E Playwright
Graph T° (TemperatureChartInteractive.astro) :
- Onglets 24 h / 7 j / 30 j (toggle JS, séries serialisées au SSR)
- Hover vertical line + tooltip valeurs
- Overlay normales mois en pointillé (TX orange, TN bleu)
- Onglet 24 h dispo seulement si l'API MF a répondu (best-effort)

Météo France OAuth2 (lib/meteofrance-auth.ts + observations.ts) :
- client_credentials avec refresh auto, cache token Valkey
- Fallback METEOFRANCE_STATIC_TOKEN pour debug
- /synop endpoint pour 24h horaires par station SYNOP du dept
- Mapping dept → station SYNOP la plus proche (src/data/stations-synop.json)
- En attente de creds : SDK skip silencieusement, l'onglet 24h n'apparaît pas

Widget iframe (/embed/dept/[code] + /embed doc) :
- Layout minimal sans header/footer global
- Réutilisable via iframe avec une ligne
- Page /embed avec snippet copier-coller + aperçu live

Tests E2E Playwright (tests/e2e/) :
- home (carte 96 paths, tooltip dept, navigation)
- api (health, vigilance, vigilance/dept)
- departement (tabs période, DROM notice, 404)
- static pages (a-propos, mentions, dependances, soutenir, conseils, embed)
- embed widget (rendu minimal, headers X-Frame OK)
- 20+ tests, run via pnpm test:e2e (live) ou test:e2e:local

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 00:14:05 +02:00
.forgejo/workflows init: info-canicule MVP (Vigilance + climato + conseils) 2026-05-25 18:17:56 +02:00
data-sources init: info-canicule MVP (Vigilance + climato + conseils) 2026-05-25 18:17:56 +02:00
public feat: OG png + sentry + dept api + drom notice + registre canicule 2026-05-25 20:59:11 +02:00
scripts fix: anomalie fenêtres 3j+7j (worst-case) + carte plus large PC 2026-05-26 00:07:18 +02:00
src feat: graph T° interactif + widget iframe + MF auth + E2E Playwright 2026-05-26 00:14:05 +02:00
tests/e2e feat: graph T° interactif + widget iframe + MF auth + E2E Playwright 2026-05-26 00:14:05 +02:00
.dockerignore init: info-canicule MVP (Vigilance + climato + conseils) 2026-05-25 18:17:56 +02:00
.env.example feat: graph T° interactif + widget iframe + MF auth + E2E Playwright 2026-05-26 00:14:05 +02:00
.env.tmpl feat: graph T° interactif + widget iframe + MF auth + E2E Playwright 2026-05-26 00:14:05 +02:00
.gitignore feat: graph T° interactif + widget iframe + MF auth + E2E Playwright 2026-05-26 00:14:05 +02:00
astro.config.mjs feat: OG png + sentry + dept api + drom notice + registre canicule 2026-05-25 20:59:11 +02:00
CLAUDE.md init: info-canicule MVP (Vigilance + climato + conseils) 2026-05-25 18:17:56 +02:00
docker-compose.yml init: info-canicule MVP (Vigilance + climato + conseils) 2026-05-25 18:17:56 +02:00
Dockerfile init: info-canicule MVP (Vigilance + climato + conseils) 2026-05-25 18:17:56 +02:00
Makefile init: info-canicule MVP (Vigilance + climato + conseils) 2026-05-25 18:17:56 +02:00
package.json feat: graph T° interactif + widget iframe + MF auth + E2E Playwright 2026-05-26 00:14:05 +02:00
playwright.config.ts feat: graph T° interactif + widget iframe + MF auth + E2E Playwright 2026-05-26 00:14:05 +02:00
pnpm-lock.yaml feat: graph T° interactif + widget iframe + MF auth + E2E Playwright 2026-05-26 00:14:05 +02:00
README.md doc: roadmap updated post-MVP go-live 2026-05-25 18:40:54 +02:00
tailwind.config.mjs feat: tooltip carte + tri/group alertes + safelist couleurs + legal Nocleus 2026-05-25 20:23:02 +02:00
tsconfig.json init: info-canicule MVP (Vigilance + climato + conseils) 2026-05-25 18:17:56 +02:00

info-canicule

Site d'utilité publique affichant les alertes Vigilance Météo France en temps réel et les conseils officiels en cas d'événements météo dangereux (canicule, orages, vent, etc.).

Dev local

make install
# Optionnel : Valkey local pour tester le cache
docker run -d --name valkey-dev -p 6379:6379 valkey/valkey:8-alpine
cp .env.example .env
make dev

Ouvrir http://localhost:4321.

Prod (VPS)

# Premier déploiement (depuis le VPS)
git clone git@git.nocleus.com:florian/info-canicule.git /opt/projects/info-canicule
cd /opt/projects/info-canicule
make env       # matérialise .env depuis vault Infra
make up        # build + start, joint shared-net, atteint `valkey:6379`

Les déploiements suivants passent par la CI Forgejo (push main → workflow deploy.yml).

Endpoints

  • / — carte Vigilance par département (J)
  • /departement/<code> — détail dept (alertes J + J1 + conseils contextuels)
  • /conseils — conseils officiels pour les 7 phénomènes Vigilance
  • /api/health — JSON {status, cache, time} pour UptimeRobot
  • /api/vigilance — JSON public du snapshot Vigilance courant (CORS *)

Structure

src/
├── layouts/Base.astro       # shell HTML + header/footer
├── components/              # VigilanceChip, DepartementGrid, VigilanceLegend
├── lib/
│   ├── cache.ts             # ioredis wrapper + cacheOrFetch helper
│   ├── vigilance.ts         # fetch Opendatasoft + parse + maps utilitaires
│   ├── phenomena.ts         # référentiel 7 phénomènes + couleurs
│   ├── departements.ts      # liste INSEE des départements
│   └── advice.ts            # conseils officiels par phénomène
└── pages/                   # index, departement/[code], conseils, api/*

Roadmap

  • Vraie carte SVG géographique (GeoJSON départements + paths)
  • Historique T° (données climato base quotidiennes — CSV.GZ par département)
  • Pages contenu (à propos, mentions légales, dépendances, soutenir)
  • SEO (sitemap, robots, OG image, JSON-LD)
  • Umami analytics (RGPD, sans cookies)
  • SDK Sentry/GlitchTip côté Astro pour reporter les erreurs serveur (DSN déjà provisionné)
  • Détail "qui appeler / s'inscrire au registre canicule" par mairie/préfecture
  • Switch optionnel vers l'API Météo France officielle (plus fraîche que Opendatasoft)
  • Section "comparer avec moyennes saisonnières" pour signaler les vagues de chaleur anormales