Astro 5 SSR + ioredis cache Valkey, déployable sur shared-net. - Vigilance temps réel via Opendatasoft (no-auth, LOv2) - Carte SVG des 96 départements (gregoiredavid/france-geojson) - Climato T° 30j par dept (CSV.GZ Météo France, cache 24h) - Conseils officiels par phénomène (7 types Vigilance) - /api/health (UptimeRobot) + /api/vigilance (JSON public CORS *) - Dockerfile multi-stage, CI Forgejo deploy.yml (pattern Reteno) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
62 lines
2.4 KiB
Markdown
62 lines
2.4 KiB
Markdown
# 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.).
|
|
|
|
- **Prod** : https://info-canicule.nocleus.com
|
|
- **Source données** : [meteo.data.gouv.fr](https://meteo.data.gouv.fr/) via [Opendatasoft](https://public.opendatasoft.com/) (Licence Ouverte 2.0)
|
|
- **Stack** : Astro 5 SSR + Node adapter, TailwindCSS, ioredis (cache Valkey)
|
|
|
|
## Dev local
|
|
|
|
```bash
|
|
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)
|
|
|
|
```bash
|
|
# 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)
|
|
- [ ] 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)
|