A comprehensive web-based ground control station for agricultural drone operations, featuring real-time telemetry, mission planning, AI-powered anomaly detection, and field management.
๐ Backend API: https://agri-7.onrender.com
๐ API Documentation: https://agri-7.onrender.com/docs
โ
Health Check: https://agri-7.onrender.com/health
No backend setup needed! The backend is already deployed and running.
-
Clone the repository:
git clone https://github.com/Advaithftw/agri.git cd agri -
Setup frontend only:
cd frontend npm install npm start -
Access the app:
- Frontend: http://localhost:3000
- Backend: https://agri-7.onrender.com (already running)
If you want to run everything locally:
-
Navigate to backend directory:
cd backend -
Create virtual environment:
python -m venv venv # Windows venv\Scripts\activate # Linux/Mac source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Configure database:
# Copy environment template cp .env.example .env # Edit .env and set your DATABASE_URL (see docs/supabase-setup.md for details)
-
Initialize database:
python -c "from database import create_tables; create_tables()" -
Start the server:
python main.py
Local backend will be available at http://localhost:8000
-
Navigate to frontend directory:
cd frontend -
Install dependencies:
npm install
-
For local backend, create
.env.local:REACT_APP_API_BASE_URL=http://localhost:8000
-
Start development server:
npm start
Frontend will be available at http://localhost:3000
-
Navigate to simulator directory:
cd simulator -
Install dependencies:
pip install asyncio websockets numpy
-
Start simulator:
python simulator.py
- User Authentication - JWT-based secure login/registration
- Field Management - Create, edit, and visualize agricultural fields
- Mission Planning - Design drone missions with waypoints and actions
- Real-time Telemetry - Live drone status, GPS, battery, and sensor data
- AI Anomaly Detection - Machine learning-powered alert system
- Data Export - Export telemetry and mission data (CSV, JSON)
- Interactive Maps - Leaflet-based field and mission visualization
- WebSocket Communication - Real-time updates and alerts
- FastAPI Backend - Modern, fast web API with automatic documentation
- React Frontend - Responsive TypeScript interface with Material-UI
- SQLAlchemy ORM - Robust database management with SQLite
- Realistic Simulator - Physics-based drone flight simulation
- Comprehensive Testing - Unit, integration, and E2E test suites
- Documentation - Complete API docs and deployment guides
โโโ backend/ # FastAPI REST API + WebSocket server
โโโ frontend/ # React web application
โโโ simulator/ # Drone flight simulator service
โโโ docs/ # Architecture and API documentation
- Backend: FastAPI, SQLAlchemy, PostgreSQL (Supabase), WebSockets, JWT Authentication
- Frontend: React, Leaflet maps, Material-UI, WebSocket client
- Simulator: Python asyncio service with realistic flight physics
- AI/ML: scikit-learn (Isolation Forest), numpy, pandas
- Database: PostgreSQL via Supabase (cloud-hosted, multi-user support)
- Python 3.9+
- Node.js 16+
- npm or yarn
cd backend
python -m venv venv
# Windows
venv\Scripts\activate
# Linux/Mac
source venv/bin/activate
pip install -r requirements.txt
python -m uvicorn main:app --reload --port 8000cd frontend
npm install
npm startcd simulator
python -m venv venv
# Windows
venv\Scripts\activate
# Linux/Mac
source venv/bin/activate
pip install -r requirements.txt
python simulator.py- Frontend: http://localhost:3000
- Backend API (Deployed): https://agri-7.onrender.com
- API Documentation: https://agri-7.onrender.com/docs
- Local Backend (if running): http://localhost:8000
This application uses Supabase (PostgreSQL) for cloud-hosted, multi-user database support.
For detailed setup instructions, see: docs/supabase-setup.md
Quick setup:
- Create a free Supabase project at supabase.com
- Copy your connection string to
backend/.env - Run database initialization:
python -c "from database import create_tables; create_tables()"
POST /auth/register- User registrationPOST /auth/login- User loginGET /auth/me- Get current user profile
GET /fields- List user fieldsPOST /fields- Create new fieldGET /fields/{id}- Get field detailsPUT /fields/{id}- Update fieldDELETE /fields/{id}- Delete field
GET /missions- List user missionsPOST /missions- Create new missionGET /missions/{id}- Get mission detailsPUT /missions/{id}- Update missionDELETE /missions/{id}- Delete missionPOST /missions/{id}/start- Start mission executionPOST /missions/{id}/pause- Pause missionPOST /missions/{id}/resume- Resume missionPOST /missions/{id}/abort- Abort mission
GET /telemetry/{mission_id}- Get mission telemetry historyGET /logs- List flight logs with filtersGET /logs/{id}/export- Export log as CSV/JSON
GET /ai/anomalies/{mission_id}- Get anomaly detection resultsPOST /ai/predict-battery- Battery drain prediction
wss://agri-7.onrender.com/ws/telemetry/{mission_id}- Real-time telemetry stream (deployed)ws://localhost:8000/ws/telemetry/{mission_id}- Real-time telemetry stream (local)
See docs/database-schema.md for detailed table structures.
# Backend tests
cd backend
pytest
# Frontend tests
cd frontend
npm test# Backend
cd backend
black . && isort .
# Frontend
cd frontend
npm run formatSee docs/deployment.md for production deployment instructions.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
MIT License - see LICENSE file for details.
- Inspired by QGroundControl (QGCS) for UI/UX patterns
- Uses open-source mapping libraries and ML models
- Built for agricultural technology advancement