API REST FastAPI pour un système national de surveillance environnementale du Burkina Faso
# Secheinon Burkina — Backend
> **Version 1.0.0-alpha** · Build 20260513-001
API REST FastAPI pour le système national de surveillance environnementale du Burkina Faso.
---
## Structure
```
backend/
├── config/
│ ├── app_config.yaml # Configuration pays, régions, villes, seuils, APIs
│ └── supabase_schema.sql # Schéma PostgreSQL complet (tables, index, RLS)
├── app/
│ ├── config.py # Chargeur YAML singleton (résolution absolue via __file__)
│ ├── database.py # Client Supabase, upsert batch, helpers UUID
│ ├── cache.py # Cache mémoire TTL simple
│ ├── routers/
│ │ ├── system.py # Santé, config, statut, init, reset-status
│ │ ├── locations.py # Arbre géographique régions/provinces/villes
│ │ ├── weather.py # Météo courante, historique, prévisions, ML
│ │ ├── floods.py # Débit fluvial, risque, historique, ML
│ │ ├── air_quality.py # AQI, polluants, historique, prévisions CAMS
│ │ ├── drought.py # SPI, sécheresse, historique, carte
│ │ ├── climate.py # Tendances climatiques long terme
│ │ ├── alerts.py # Alertes actives, historique, stats
│ │ ├── report.py # Rapport de synthèse multi-domaines
│ │ └── export.py # Export CSV/JSON avec filtres
│ └── services/
│ ├── data_collector.py # Collecteurs météo, inondations, air, sécheresse, climat
│ ├── ml_engine.py # Entraînement Gradient Boosting / Random Forest
│ ├── open_meteo.py # Client Open-Meteo (weather, air quality, flood, archive)
│ ├── nasa_power.py # Client NASA POWER (données climatiques)
│ └── scheduler.py # Tâches périodiques APScheduler
├── main.py # Point d'entrée + endpoint /api/dashboard
├── requirements.txt
├── .env / .env.example
├── .gitignore
└── README.md
```
---
## Prérequis
- Python **3.11+**
- Compte Supabase (gratuit)
---
# …