Inspiration

In November 2023, the Shabelle River flooded and displaced half a million people around Beledweyne, Somalia. In South Sudan, between 2020 and 2022, over one million people were affected by floods. In Kenya, the Tana River burst its banks in April 2024. In nearly every case, global models like GloFAS saw the water coming days in advance. The data existed — the warning never arrived.

Technical meteorological data stays trapped in English-language dashboards built for scientists. The farmer on the riverbank, the teacher deciding whether to close the school, the clinic worker moving medicine to higher ground — they never see it. We built Tayari to close that gap between information generated and information acted upon.

What it does

Tayari ("Ready" in Swahili) monitors eight high-risk river basins across Somalia, Kenya, Ethiopia, South Sudan, and Sudan. It:

Predicts river flooding 1–7 days ahead using a LightGBM ML model on GloFAS river discharge and rainfall forecasts Overlays impact data — estimating the population, schools, clinics, and markets at risk per basin using WorldPop and OpenStreetMap data Generates AI advisories using Llama 3.3 70B (via Groq) — plain-language, role-specific guidance for farmers, teachers, pastoralists, and the general public in English, Somali, Swahili, Amharic, and Oromo Delivers alerts via a Next.js PWA web dashboard, SMS (Twilio), and an offline-first Flutter Android app Closes the feedback loop — community members submit geotagged photo reports of ground conditions, and coordinators respond with advice threads (safe routes, closed bridges, who to contact)

Free to use at tayari.pages.dev. No signup required.

How we built it

Backend: FastAPI (Python) on Render, ingesting 7-day forecasts from Open-Meteo's GloFAS API. A Cloudflare Worker proxies requests to avoid rate limits and pings the backend on a cron schedule to eliminate cold-start delays.

ML Pipeline: LightGBM model trained on tabular GloFAS data producing a 0–100% flood risk score per basin over a 7-day horizon. A calibrated heuristic fallback ensures predictions never go dark.

Impact Engine: Pre-computed WorldPop population estimates and OSM-derived infrastructure data (schools, clinics, markets, roads) estimate people and assets at risk.

AI Advisory Generation: Groq API (Llama 3.3 70B) generates role-specific advisories in five languages. Pre-written template fallbacks guarantee warnings go out even if the AI is unavailable.

Web Frontend: Next.js 14 (App Router) PWA on Cloudflare Pages with MapLibre GL JS for interactive basin maps, river discharge charts, impact assessment cards, and advisory panels.

Mobile App: Flutter with Riverpod, MapLibre for native vector maps, Isar for offline-first local caching. Photos are compressed aggressively for low-bandwidth networks. Offline reports queue and sync automatically.

Database & Auth: Supabase (managed Postgres) for shared storage and user authentication. Reports and alerts sync bidirectionally between web and mobile.

Challenges we ran into

GloFAS data complexity: River discharge forecasts come in ensemble runs across multiple grid points per basin. Selecting the right upstream gauge coordinates and aggregating ensemble members into a single actionable risk score required careful calibration against historical flood events.

Multilingual advisory quality: Getting an LLM to produce genuinely useful, culturally appropriate advisories in Somali and Oromo — not just translated English — required extensive prompt engineering and role-specific context injection.

Offline-first sync: Ensuring geotagged photo reports submitted offline on the mobile app sync correctly with the Supabase backend without duplicates or data loss when connectivity returns intermittently.

Cold starts on free tier: The Render free tier spins down after inactivity. A flood warning delayed by a 30-second cold start is a warning that arrives too late. We solved this with a Cloudflare Worker cron ping.

Accomplishments that we're proud of

Hindcast validation: Querying historical data for the Shabelle basin around October–November 2023, the model predicts the devastating Beledweyne floods days before they happened — a powerful validation that this system could save lives.

Five languages, five audiences: Advisories in English, Somali, Swahili, Amharic, and Oromo, tailored for farmers, teachers, pastoralists, students, and the general public. A warning you can't read is a warning that doesn't exist.

No single point of failure: If the AI API goes down, template advisories are served. If the ML model fails, the heuristic fallback takes over. If the internet is unavailable, the mobile app serves cached data offline. Truly free and open source: No paywall, no signup, no data collection. An early warning should never be gated.

What we learned

Forecasts alone don't save lives — translation into actionable, role-specific guidance in the right language is where the real value is. The "last mile" of early warning is a communication problem, not just a data science problem.

Designing for low-bandwidth, intermittent-connectivity environments forces better architecture decisions — aggressive caching, offline-first design, and minimal payload sizes benefit all users, not just those in remote areas. Community reports are as important as forecasts. Satellites and models predict the future; people on the ground tell you what's happening right now. The two together close the information loop.

What's next for Tayari

Two-way SMS & USSD — so households with basic phones (not smartphones) can subscribe to alerts by texting a shortcode

Voice advisories (IVR) — phone calls that read the advisory aloud in Somali or Oromo for non-literate residents

Safe-route guidance — not just "go to high ground" but showing the actual route, updated by community reports of closed roads

Anticipatory cash triggers — linking HIGH-risk forecasts to humanitarian cash-transfer programs so families can act before the water arrives

Satellite verification — cross-checking community reports against Sentinel-1 radar flood extent imagery

Drought & locust modules — the basin-config architecture already supports new hazards with different data feeds

Built With

Share this project:

Updates