Tableau de bord interactif pour analyse de données
# AgriInsight Togo
Plateforme d'intelligence géospatiale pour l'aide à la décision agricole au Togo.
## Fonctionnalités
- **Tableau de bord** — KPIs, cartographie d'intensité régionale, graphiques
- **Analyses détaillées** — Exploitations, coopératives, ZAAP, marchés, pépinières, accessibilité, développement rural
- **IA décisionnelle** — Scores de priorité territoriale, recommandations d'infrastructures, rapports
- **Rapports** — Génération et export Markdown par page d'analyse
## Sources de données
Données officielles via opendata.gouv.tg :
- Grandes et petites exploitations, plantations
- ZAAP (formes et champs individuels)
- Coopératives, marchés, pépinières
- Indicateurs Agriculture & développement rural (Banque mondiale)
## Prérequis
- Python 3.11+
- Node.js 18+
## Installation
```bash
# 1. Collecte des données
pip install -r scripts/requirements.txt
python scripts/download_data.py
# 2. Prétraitement
python scripts/preprocess.py
# 3. Backend
cd backend
pip install -r requirements.txt
powershell -ExecutionPolicy Bypass -File run.ps1 # Windows
# ou : python -m uvicorn main:app --reload --port 8000
# 4. Frontend (nouveau terminal)
cd frontend
npm install
npm run dev
```
Ouvrez **
http://localhost:5173**
## Structure
```
agri-insight-togo/
├── data/raw/ # CSV téléchargés
├── data/processed/ # GeoJSON
├── data/exports/ # indicators.json, agriculture_rural.json
├── scripts/ # Collecte, preprocessing, vérification API, rapports Word
├── backend/ # API FastAPI
└── frontend/ # React + Vite + Tailwind
```
## API principale
| Endpoint | Description |
|---|---|
| `GET /api/kpis` | Indicateurs clés nationaux |
| `GET /api/layers/{name}` | Couche GeoJSON |
| `GET /api/analysis/density` | Densité par région |
| `GET /api/analysis/zaap` | Couverture ZAAP |
| `GET /api/analysis/accessibility` | Accessibilité aux services |
| `GET /api/analysis/cooperatives` | Réseau coopératif |
| `GET /api/analysis/rural-develop …