đź§  Inspiration

Nigeria’s rural communities face two linked crises — devastating floods and farmer–herder conflicts. Both destroy livelihoods and threaten food security. After building AgroRithm, we saw how combining AI, IoT, and geospatial intelligence could promote peace and sustainability. So, we created Alaafia 9ja (“Peaceful Nigeria”) — a smart AI app that predicts floods, prevents conflicts, and automates relief payouts to protect farmers and herders alike.

🌍 What It Does

Alaafia 9ja is an AI + IoT-powered Android app (Expo Go) that:

🌧️ Predicts floods using Google Weather API and Gemini AI for rainfall, river level, and soil-moisture forecasting.

🛰️ Detects real-time water levels via IoT sensors connected to Firebase.

🗺️ Maps farmlands and grazing routes using Google Maps SDK to reduce overlap and conflict zones.

🤝 Prevents farmer–herder conflicts by sending AI-driven route alerts to both groups when flood risk or encroachment risk is detected — similar to our AgroRithm logic.

đź’¸ Triggers automatic payouts to affected farmers through smart contracts when IoT confirms a flood, reducing post-disaster tension.

🗣️ Communicates in English, Hausa, and Pidgin, ensuring inclusivity for rural users.

⚙️ How We Built It

Frontend: React Native + Expo Go

Backend: Firebase (Realtime Database, Authentication, Cloud Functions)

AI Engine: Google Gemini API for weather reasoning + route conflict prediction

IoT Layer: Arduino-based water-level and soil sensors streaming data to Firebase

Flood Prediction: Google Weather API + historical data model

Conflict Prediction: Gemini + map overlays trained to identify high-risk overlaps in grazing/farm zones

Maps & Geofencing: Google Maps SDK + Expo Location

Smart Contracts: Simulated blockchain contract for automatic farmer compensation

đźš§ Challenges We Ran Into

Training Gemini to interpret flood + conflict data contextually.

Managing multilingual push notifications offline.

Syncing IoT sensor data with Firebase during poor network coverage.

Visualizing farm vs. grazing boundaries cleanly on small mobile screens.

🏆 Accomplishments We’re Proud Of

Combined AI, IoT, Maps, and Smart Contracts into one working Expo app.

Built an AI-driven early warning system that predicts both floods and human conflicts.

Used Gemini API to generate predictive insights from environmental + spatial data.

Designed a peace-first incentive system — when floods are detected, farmers get compensated automatically.

📚 What We Learned

Gemini’s potential for geospatial and contextual reasoning in local settings.

How to integrate IoT + AI + blockchain to improve real-world sustainability.

The power of local-language AI messaging for inclusive rural impact.

🚀 What’s Next for Alaafia 9ja

Integrate Vertex AI for deeper conflict-risk modeling with real NDVI data.

Launch pilot deployments in Benue, Kogi, Nasarawa, and Kwara States.

Add SMS/USSD fallback alerts for non-smartphone users.

Collaborate with local cooperatives and meteorological agencies.

Scale to other West African flood/conflict hotspots and link with Hedera or TON for decentralized insurance payouts.

Share this project:

Updates