Precision agriculture for small-scale farmers through real-time monitoring and smart alerts
FarmTwin is a digital twin dashboard for greenhouse monitoring that helps small-scale farmers optimize resource usage through real-time sensor data, predictive alerts, and sustainability metrics.
The Problem: Agriculture uses 70% of global freshwater, but 50% is wasted through inefficient irrigation. Small-scale greenhouse farmers lack affordable tools to optimize resource use.
Our Solution: A digital twin platform that provides precision agriculture capabilities at zero hardware cost, using simulated sensors that can easily be swapped for real IoT devices.
- Real-time sensor monitoring (temperature, humidity, soil moisture, light, CO2)
- Color-coded status indicators (optimal/warning/critical)
- Interactive charts with trend visualization
- Updates every 2 seconds via WebSocket
- Automatic threshold detection
- Instant notifications for critical conditions
- Context-aware alerts based on tomato growing requirements
- Alert history and resolution tracking
- Real-time calculation vs. traditional watering schedules
- Daily and weekly savings metrics
- Demonstrates 30-40% water reduction
- Sustainability impact visualization
- Visual status for each sensor
- Tomato-specific optimal ranges
- Progress bars showing current values
- Educational context for growers
| Component | Technology | Purpose |
|---|---|---|
| Sensor Simulation | Python | Generate realistic greenhouse data |
| Real-time Cache | Redis | Pub/sub for live updates, ultra-fast access |
| Backend | Node.js + Express | WebSocket server, business logic, API |
| Database | Supabase | Auth, persistent storage, historical data |
| Frontend | React + Vite | Live dashboard, interactive UI |
| Charts | Recharts | Real-time data visualization |
| WebSocket | Socket.io | Bidirectional real-time communication |
| Styling | Tailwind CSS | Responsive, modern UI |
digital-twins/
├── simulator/ # Python sensor data generator
├── backend/ # Node.js WebSocket + REST API
├── frontend/ # React dashboard UI
├── DATABASE_SCHEMA.md # Supabase SQL schema
├── SETUP_GUIDE.md # Installation instructions
└── PROJECT_STRUCTURE.md # Architecture details
- Python 3.8+
- Node.js 18+
- Redis (local or cloud)
- Supabase account (free tier)
-
Clone and navigate
cd digital-twins -
Setup Python simulator
cd simulator pip install -r requirements.txt python sensor_simulator.py -
Setup Node.js backend
cd backend npm install cp .env.example .env # Edit .env with your Supabase credentials npm run dev
-
Setup React frontend
cd frontend npm install cp .env.example .env # Edit .env with your Supabase credentials npm run dev
-
Open dashboard Navigate to http://localhost:5173
For detailed setup instructions, see SETUP_GUIDE.md
Python Simulator → Redis (Pub/Sub) → Node.js Backend → WebSocket → React Frontend
↓
Supabase (Auth + History)
Data Flow:
- Python generates realistic sensor data every 2 seconds
- Redis stores latest values and publishes updates
- Node.js subscribes to updates, checks thresholds, calculates metrics
- WebSocket broadcasts to all connected clients
- React displays live data, charts, and alerts
- Supabase stores historical data and user configuration
FarmTwin demonstrates measurable environmental impact:
- 30-40% water reduction vs. fixed-schedule irrigation
- Smart alerts prevent resource waste from neglect
- Accessible technology democratizes precision agriculture
- Scalable approach for urban farms, community gardens, schools
- Water saved per day/week
- Optimal range adherence score
- Resource efficiency tracking
- Environmental benefit visualization
- Urban farms: Maximize yield in limited space
- Community gardens: Shared monitoring platform
- Educational institutions: Teach sustainable agriculture
- Hobbyist growers: Professional-grade insights
- Proof of concept: Demonstrate IoT integration before hardware investment
- Mobile app (React Native)
- Multi-greenhouse management
- Crop type profiles (lettuce, peppers, strawberries)
- Historical playback (rewind sensor data)
- Growth stage tracking
- Real sensor integration (Arduino, Raspberry Pi)
- Weather API integration
- Automated irrigation control
Built for [Hackathon Name] 2025
MIT
Live monitoring. Smart alerts. Sustainable farming.