griSense is a real-time agricultural IoT dashboard designed to help farm owners in Rwanda monitor environmental conditions.
# 🌾 AgriSense: Smart Farm Monitoring System
AgriSense is a real-time agricultural IoT dashboard designed to help farm owners in Rwanda monitor environmental conditions. It features a robust **Django** backend, **AJAX-driven** CRUD operations, and dynamic data visualization using **Chart.js**.
## 🚀 Features
- **Dynamic Dashboard**:
- Real-time **Line Charts** for temperature trends.
- **Data Volume Pie Charts** to compare sensor activity.
- **Farm Health Doughnut Charts** showing "In-Range" vs "Alert" status.
- **Seamless CRUD**: Manage Farms and Sensors via **Bootstrap Modals** and **AJAX** (no page refreshes).
- **Smart Filtering**: Multi-farm selector and search functionality for specific locations or names.
- **Automated Alerts**: Integrated **Email (SMTP)** and **SMS (Twilio)** notifications for threshold breaches.
- **Secure Architecture**: Strict data isolation—users only see their own farms and sensor data.
## 🛠️ Tech Stack
- **Framework**: Django 5.x
- **Package Manager**: uv (Fast Python package installer)
- **Database**:
- **Development**: SQLite
- **Production**: AWS RDS (MySQL)
- **Frontend**: Bootstrap 5, jQuery, Chart.js
- **Communications**: Twilio API (SMS), SendGrid/Gmail (Email)
## 📊 Data Models
- **Farm**: Tracks name and location (Supports all 30 Rwandan Districts).
- **Sensor**: `OneToOne` with Farm. Stores `min_temp` and `max_temp` thresholds.
- **SensorReading**: Stores temperature values and timestamps (`recorded_at`).
- **NotificationPreference**: User-specific toggles for SMS/Email alerts and phone numbers.
- **Notification**: History of all alerts sent to users.
## ⚡ Quick Start (Manual Download)
If you have uv installed, run this to get started in seconds:
1. **Download & Extract** the ZIP from GitHub.
2. **Open Terminal** in the project folder.
3. **Run Setup:**
```bash
uv sync && uv run manage.py migrate && uv run manage.py runserver
```
## 📦 Installation & Setup
This project uses `uv` for ultra-fast dependency management. …