# SHAMBA AI · Climate-Smart Smallholder Platform
SHAMBA AI delivers actionable insights to farmers, cooperatives, and field agents through mobile, web, USSD/SMS, and real-time alerting channels. This repository hosts the reference architecture, component templates, specs, and deployment scaffolding for the end-to-end platform.
## Key Capabilities
- 🌧️ **Climate intelligence**: PostGIS-backed climate alerts, Mapbox visual layers, and Socket.IO push messaging.
- 💰 **Market intelligence**: Live price feeds, transport cost modeling, buyer matching, and recommendation engine outputs.
- 🛡️ **Insurance lifecycle**: Trigger monitoring, payout tracking, and manual/automatic claims flows.
- 🌱 **Advisory + AI**: Crop management, photo-based diagnostics, and multilingual guidance tuned for low-literacy audiences.
- 👥 **Cooperative & admin tooling**: Member directories, bulk communications, analytics, and governance controls.
## Repository Structure
```
├── frontend/ # React + TS web dashboard
├── mobile/ # React Native app (Expo)
├── backend/ # Fastify API + Socket.IO
├── ai-models/ # Python ML pipelines
├── data-pipeline/ # Prefect/Airflow ETL jobs
└── docs/ # Prompt-by-prompt design deliverables
```
Detailed documents for every UI/UX & systems prompt live under `docs/phase*/`. Start with `docs/phase1/project-architecture.md`.
## Quick Start · Local Development
> Requirements: Node.js 18+, pnpm or npm, Python 3.9+, Docker Desktop, Mapbox token.
### 1. Frontend (Web)
```bash
cd frontend
npm install
npm run dev #
localhost
```
Environment variables (create `.env`):
```
VITE_API_URL=
localhost
VITE_SOCKET_URL=
localhost
VITE_MAPBOX_TOKEN=your_token
```
### 2. Mobile (Expo)
```bash
cd mobile
npm install
npm run start
```
Use Expo Go or `npm run android`. Offline-first data lives in MMKV/AsyncStorage; localization defaults to Swahili.
### 3. Backend (Fastify)
```bash
cd backend
npm install
cp .env.e …