# 🌍 AgroResilience Africa: Continental Crop Monitoring & AI Forecasting System
An enterprise-grade, edge-computed geospatial platform designed to track crop health, estimate yields, and forecast agricultural productivity across Africa. Powered by **Digital Earth Africa's Open Data Cube (STAC API)** and deployed entirely on the **Cloudflare Edge Network** with integrated **Workers AI**.
## 🚀 Key Capabilities
- **Continental Scaling with Granular Filters:** Seamless navigation from a pan-African overview down to specific national fields (e.g., Zambia's Mkushi Farm Block).
- **Edge Geospatial Compute:** Real-time computation of the **Enhanced Vegetation Index (EVI)** directly inside Cloudflare Workers using Sentinel-2 Surface Reflectance data, completely bypassing heavy GIS server overhead.
- **Robust Cloud Masking:** Automated processing of the Scene Classification Layer (SCL) to remove cloud interference, matching real-world data science practices.
- **Edge AI Insights:** Utilizes Cloudflare Workers AI (`Llama-3`) to run inference on time-series vegetation analytics to produce descriptive yield forecasts and strategic resilience recommendations.
## 🛠️ Architecture & Tech Stack
```text
[User Interface: React + Tailwind + Leaflet]
│ (JSON API via HTTPS)
â–Ľ
[Edge Layer: Cloudflare Workers + Pages]
│
├─► [AI Inference: Cloudflare Workers AI (Llama-3)]
├─► [Cache / Metadata: Cloudflare KV Store]
└─► [Geospatial Core: Digital Earth Africa STAC API]
```
- **Frontend:** React 18, TypeScript, Tailwind CSS, Vite, Recharts, Leaflet.
- **Backend:** Cloudflare Pages Functions, Hono Framework.
- **Geospatial Engine:** Digital Earth Africa STAC API & AWS Sentinel-2 Level-2A Catalogs.
- **Artificial Intelligence:** Cloudflare Workers AI Engine (`@cf/meta/llama-3-8b-instruct`).
- **Database/Caching:** Cloudflare KV Namespace (`CROP_CACHE`).
## 📊 Grounded Regional Use Cases (Zambia & Tanzania)
Inspired by real-world Earth Observation initiatives:
1. **Mkushi Farm Block (Zambia) …