Inspiration

500 million smallholder farming families grow 70% of the world's food — yet 75% of their climate risk is completely uninsured, and nearly a third have no access to climate information. When drought hits, they find out only when it's already too late: one bad season means debt, kids pulled out of school, and hunger. Traditional crop insurance can't help — it needs inspectors and paperwork, economics that fall apart on a one-hectare plot. We built AgriWatch for farmers like "Amara," a millet grower in Senegal whose rains never came.

What it does

AgriWatch is satellite-powered, AI-driven parametric micro-insurance, delivered to any phone — no app required:

  • 🛰️ Watch — monitors every farm from orbit: crop health (NDVI/NDWI) from Sentinel-2, fused with rainfall and 14-day forecasts from NASA POWER and Open-Meteo.
  • 📡 Warn — when risk crosses FAO drought thresholds, Claude writes a clear alert in the farmer's own language (Arabic, Swahili, French, English) with 3 actions, sent over WhatsApp/SMS.
  • 💵 Pay — if drought is confirmed, a parametric payout fires automatically to mobile money (M-Pesa/Orange Money) with a receipt — in seconds, no claim form, no inspector.

The magic moment: $15 reaches a farmer's phone the instant the satellite confirms drought. Our /simulate page runs the whole chain live — satellite scan → NDVI drop → risk score → Claude alert streaming token-by-token → WhatsApp delivery → automatic payout.

How we built it

  • Next.js 14 (App Router) + TypeScript — frontend, API, and logic in one repo.
  • Route Handlers with a Server-Sent Events stream (/api/simulate) powering the live demo.
  • Anthropic Claude for streaming, multilingual alert generation.
  • Prisma with a dual schema: SQLite (zero-setup) + PostgreSQL/PostGIS (Docker).
  • Real satellite math (NDVI = (NIR−Red)/(NIR+Red)) and FAO crop thresholds → a 0–100 risk score.
  • Tailwind CSS dark UI, Leaflet NDVI map, Recharts, Twilio WhatsApp, Docker Compose.

Challenges we ran into

  • SQLite has no enums — we moved DB enums to String and enforced values in TypeScript so one codebase runs on both SQLite and Postgres.
  • Reliable streaming — clean Server-Sent Events from a Next.js Route Handler, with a structured error event so it never hard-crashes.
  • Keyless demo — a localized, token-by-token fallback so /simulate works with no API key, upgrading to live Claude when a key is present.

Accomplishments that we're proud of

  • A genuinely working end-to-end product — one click runs satellite → AI → payout live.
  • Live, streaming, multilingual AI alerts in 4 languages.
  • Runs with zero setup (SQLite, no Docker) and ships a production Docker/Postgres path.
  • Built on 100% open data (Sentinel-2, NASA POWER, Open-Meteo) — no proprietary hardware.

What we learned

  • How parametric insurance removes fraud and cost by making the measurement the trigger.
  • Satellite vegetation indices and fusing them with weather to reduce basis risk.
  • Server-Sent Events in Next.js, and multi-provider Prisma setups.

What's next for AgriWatch

  • Live Copernicus/Sentinel-2 pipeline, real M-Pesa (Daraja) & Orange Money payouts, production Twilio WhatsApp.
  • SMS/USSD for farmers without WhatsApp.
  • A pilot with a cooperative or microfinance partner, backed by reinsurance.
  • New perils already modeled: flood, frost, pest.

Built With

Share this project:

Updates