A full-stack farm management platform for a **0.2-acre (809 m²) integrated farm** in Kenya, designed as both a profitable agribusiness and a demonstration site for commercial agritech products.
# FarmTech — Smart Integrated Farm & Agritech Platform
A full-stack farm management platform for a **0.2-acre (809 m²) integrated farm** in Kenya, designed as both a profitable agribusiness and a demonstration site for commercial agritech products.
## Vision
- **Stage 1:** Run a profitable integrated farm (poultry, vegetables, dairy, goats)
- **Stage 2:** Productize as subscription farm management SaaS
- **Stage 3:** Offer software + IoT + training packages to other farmers
## Architecture
```
Mobile App (Flutter - planned)
│
Cloud API (FastAPI + PostgreSQL/TimescaleDB)
│
┌───────┼───────┐
Dashboard Redis MQTT
│
Raspberry Pi Edge Agent
│
Sensors · Cameras · Meters · Controllers
```
## Stack
| Layer | Technology |
|-------|------------|
| Backend | FastAPI, SQLAlchemy, PostgreSQL (TimescaleDB) |
| Frontend | Next.js 15, React 19, Tailwind CSS |
| IoT | Raspberry Pi 5, ESP32, MQTT (Mosquitto) |
| Cache | Redis |
| Containers | Docker Compose |
## Quick Start
### Prerequisites
- Docker & Docker Compose
- Node.js 20+ (for local frontend dev)
- Python 3.12+ (for local backend dev)
### Run with Docker
```bash
cp .env.example .env
docker compose up -d
```
- **Dashboard:**
localhost
- **API:**
localhost
- **API Docs:**
localhost
Demo data is seeded automatically on first startup (200 layers, 2 cows, 9 goats, 5 vegetable plots).
### Local Development
**Backend:**
```bash
cd backend
python -m venv .venv
.venv\Scripts\activate # Windows
pip install -r requirements.txt
uvicorn app.main:app --reload
```
**Frontend:**
```bash
cd frontend
npm install
npm run dev
```
**IoT Edge Agent (Raspberry Pi):**
```bash
cd iot/edge_agent
pip install -r requirements.txt
python main.py
```
## Farm Layout (809 m²)
| Area | Size | Enterprise |
|------|------|------------|
| Poultry house + run | 150 m² | 200 layers |
| Dairy unit | 80 m² | 2 zero-grazed cows |
| Goat shed + yard | 90 m² | 10–15 breeding goats |
| Worker/store | 40 m …