AI-powered anticipatory action platform for climate risk and farmer alerting in Uganda
# PROACT — Anticipatory Action Platform
An AI-powered climate risk and farmer alerting system for Uganda.
## What It Does
- Monitors 5 pilot districts in Northern and Eastern Uganda
- Computes daily flood, landslide, and food stress risk scores using Open-Meteo weather data
- Displays district-level risk on an interactive dashboard with map, alerts, and trend charts
- Sends SMS alerts to enrolled smallholder farmers (mock provider by default)
## Quick Start
### Prerequisites
- Docker + Docker Compose
- OR: Python 3.11+, Node 20+, PostgreSQL 15 with PostGIS
### Option A — Docker (recommended)
```bash
cp .env.example .env
docker-compose up --build
```
Then visit:
- Dashboard:
localhost
- API docs:
localhost
### Option B — Local development
**1. Database**
```bash
# Start PostgreSQL with PostGIS locally, then:
createdb proact
```
**2. Backend**
```bash
cd apps/api
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
cp ../../.env.example .env
# Edit .env with your DATABASE_URL
uvicorn app.main:app --reload --port 8000
```
On first start, the API automatically:
- Creates all tables
- Seeds 5 pilot districts and hazard features
- Seeds 12 sample farmers
- Creates admin user: `admin@proact.org` / `proact2024`
**3. Frontend**
```bash
cd apps/web
npm install
NEXT_PUBLIC_API_URL=
localhost npm run dev
```
Visit
localhost
## Running the Data Pipeline
After starting the API, trigger data ingestion:
```bash
# Fetch weather data from Open-Meteo (last 37 days + 7-day forecast)
curl -X POST
localhost
# Compute risk scores for all districts
curl -X POST
localhost
# Generate alerts from risk scores
curl -X POST
localhost
```
The scheduler also runs this pipeline automatically at 06:00 UTC daily.
## Project Structure
```
proact/
apps/
api/ FastAPI backend …