🌱 Inspiration

While researching climate-smart agriculture, I kept seeing the same pattern:

When floods, droughts, heat, or unusual rainfall hit, farmers are often among the first to lose their crops, livestock, and income.

The numbers made the problem difficult to ignore.

🌍 Globally: FAO estimates disasters caused about $3.8 trillion in crop and livestock production losses over 30 years — around $123 billion every year.

🇰🇪 Kenya, 2024: floods caused about KES 34.9 billion in agricultural damage and another KES 84.8 billion in production losses.

🇳🇵 Nepal, August 2026: flash floods damaged around 1,800 hectares of crops and caused nearly 7,700 tonnes of production losses, alongside major livestock losses.

The more I researched, the more I realized something important:

The environmental data farmers need already exists.

Weather forecasts exist. Satellite imagery exists. Soil databases exist. Historical climate data exists.

But they are scattered across different platforms and usually presented as raw data.

A farmer does not really want five dashboards.

They want answers like:

What should I grow here? Is there enough rainfall? What risks should I prepare for?

That question became the inspiration for FarmTwin.

Understand your farm before you plant.


🌾 What it does

FarmTwin creates a digital environmental twin of a farm by combining:

Weather + Satellite + Soil + Terrain + Climate + Sensors

The farmer selects their farm on an interactive map, and FarmTwin builds a location-specific environmental profile.

It can then help answer:

  • 🌱 Which crops are suitable?
  • 💧 Is rainfall enough for the crop?
  • 🚿 How much additional water may be needed?
  • ⚠️ Are there drought, heat, heavy-rainfall, or waterlogging risks?
  • 📅 What could be planted throughout the year?

The Crop Simulator compares real farm conditions with the requirements of 20+ crops and produces an explainable suitability score.

For example:

Maize — 82/100

✅ Temperature suitable ✅ Soil suitable ✅ Terrain suitable ⚠️ Rainfall below optimal

FarmTwin can also compare expected rainfall with crop water requirements and generate a personalized 12-month crop plan.

The core flow is simple:

Select Farm → Collect Environmental Data → Farm Digital Twin → Analyze → Recommend


🛠️ How we built it

FarmTwin is a full-stack geospatial application.

Frontend

  • Next.js + React 19
  • TypeScript
  • Tailwind CSS
  • MapLibre GL JS

Backend

  • FastAPI + Python
  • PostgreSQL + PostGIS
  • Redis
  • Docker

For environmental intelligence, FarmTwin integrates:

🛰️ Sentinel-2 → NDVI & NDMI 🌦️ Open-Meteo → Weather and forecasts 🌱 SoilGrids → Soil properties ⛰️ Copernicus DEM → Elevation and slope 📊 ERA5-Land → Historical climate 📡 Conduit IoT → Local sensor data when available

The decision engine is intentionally rule-based and explainable.

AI does not invent crop suitability scores.

Instead:

Environmental Data → Decision Engine → Calculated Result → AI Explanation

This lets us use AI while keeping the core agricultural reasoning transparent.


🧩 Challenges we ran into

The hardest part was not getting environmental data.

It was making completely different datasets work together.

Weather, satellites, soil, terrain, and climate data all have different:

  • Spatial resolutions
  • Update frequencies
  • Formats
  • Levels of uncertainty

Satellite imagery can be affected by clouds. SoilGrids provides modeled soil properties rather than laboratory measurements. Weather forecasts can change.

Another major challenge was processing an actual farm polygon, rather than simply using a city or single latitude/longitude.

We also had to decide what to do when data was unavailable.

Instead of silently generating fake fallback values, FarmTwin tracks data source, availability, timestamp, quality, and resolution wherever possible.


🏆 Accomplishments that we're proud of

We are proud that FarmTwin became more than a simple weather dashboard or AI crop recommender.

We built a working system containing:

🌍 Interactive farm boundary selection 🧬 Farm Digital Twin 🛰️ Six environmental data integrations 🌿 Sentinel-2 NDVI / NDMI analysis 🌾 20+ crop simulations 💧 Water requirement analysis ⚠️ Climate-risk analysis 📅 12-month crop planning 🔎 Data provenance and quality tracking 🤖 AI-generated explanations 🐳 Dockerized full-stack deployment

One of our biggest accomplishments is explainability.

FarmTwin doesn't only say:

"Grow maize."

It tries to show why maize may or may not be suitable.


📚 What we learned

FarmTwin taught us that the biggest challenge is not collecting more environmental data.

It is turning existing data into useful decisions.

Through the project, we learned about geospatial processing, PostGIS, satellite imagery, NDVI/NDMI, weather systems, soil modeling, elevation data, climate datasets, crop-water requirements, Docker, and decision-engine design.

We also learned an important distinction:

Satellite data, modeled soil data, and weather forecasts are useful environmental signals — but they are not perfect ground truth.

That is why FarmTwin tries to expose uncertainty instead of hiding it.

We also learned that AI becomes much more useful when it has a specific job.

For FarmTwin, AI explains the decision instead of making up the decision.


🚀 What's next for FarmTwin

The current version of FarmTwin focuses on the web platform, but we want to take it much further.

Our next major goal is a mobile application so farmers can access FarmTwin directly from their phones.

We also plan to add:

📱 Mobile app and mobile-first experience 🔔 Real-time climate and risk alerts 🌾 More crops and local crop varieties 🌐 Local-language support 📡 Deeper IoT sensor integration 🛰️ Continuous satellite crop monitoring 💧 Irrigation and water-source customization 💰 Budget-aware recommendations 📖 Previous crop and farm-history tracking 📴 Better support for low-connectivity areas

Eventually, we want the Farm Digital Twin to continuously update throughout the growing season using new weather, satellite, sensor, and farmer-provided observations.

So FarmTwin can evolve from answering:

"What should I plant?"

to:

"What is happening on my farm, what could happen next, and what should I do?"

🌱 FarmTwin

Understand your farm before you plant.

Better data. Better decisions. More resilient farms.

Built With

Share this project:

Updates

Submission history