A full-stack drone fleet management platform with Django REST API backend and React TypeScript frontend. Monitor your drone fleet, plan missions, track real-time telemetry, and manage multiple operational bases.
π Live Demo: https://dsms-raqe.onrender.com
- Base Management - Create and manage operational bases with map visualization
- Drone Fleet Management - Add, monitor, and control DJI drone fleet with detailed specifications
- Mission Planning - Define survey areas, configure flight paths with multiple pattern types
- Real-time Mission Monitoring - Live drone tracking with auto-refresh telemetry
- Analytics Dashboard - Fleet statistics, mission history, and performance metrics
- Flight Pattern Generator - Support for waypoint, crosshatch, perimeter, and spiral patterns
- Return-to-Base Paths - Automatic return flight path generation after mission completion
- Mission Phase Tracking - Distinct phases: traveling β surveying β returning β completed
- Interactive Map - Leaflet-based map with base locations and drone positioning
- Real-time Updates - React Query with auto-refresh (works even when tab is in background)
- Responsive Design - Tailwind CSS with shadcn/ui components
- Clean White Theme - Modern interface with neutral color scheme
- GitHub Actions Keep-Alive - Automated cron job to prevent Render service sleep
- Background Polling - Auto-refresh continues even when browser tab is not focused
- Health Endpoint -
/health/for monitoring and keep-alive pings
This project follows a layered full-stack architecture:
FlytBase-DSMS/
βββ src/dsms/ # Django Backend
β βββ models/ # MongoDB models (MongoEngine)
β βββ api/ # REST API endpoints
β β βββ endpoints/ # Resource endpoints
β β βββ serializers/ # Request/Response schemas
β βββ services/ # Business logic layer
β β βββ fleet_service.py # Drone fleet operations
β β βββ mission_service.py # Mission management
β β βββ path_generator.py # Flight path algorithms
β β βββ analytics_service.py # Statistics and metrics
β βββ tasks/ # Celery background jobs
β βββ consumers/ # WebSocket handlers
β βββ simulator/ # Drone physics simulation
β βββ utils/ # Shared utilities
βββ static/app/ # React Frontend
β βββ pages/ # Main application pages
β β βββ Bases.tsx # Base management (default)
β β βββ Drone.tsx # Drone fleet dashboard
β β βββ Missions.tsx # Mission list and control
β β βββ MissionPlanner.tsx # Create new missions
β β βββ LiveMonitor.tsx # Real-time mission tracking
β β βββ Analytics.tsx # Statistics and charts
β βββ components/ # Reusable UI components
β β βββ common/ # Layout, navigation
β β βββ ui/ # shadcn/ui components
β βββ services/ # API client services
β βββ types/ # TypeScript interfaces
β βββ hooks/ # React custom hooks
βββ scripts/ # Utility scripts
βββ seed_drone_fleet.py # Load DJI drone fleet data
βββ test_api.py # API testing utilities
| Layer | Technology |
|---|---|
| Frontend | React 18 + TypeScript + Vite |
| UI Library | shadcn/ui + Tailwind CSS |
| State | React Query + Zustand |
| Maps | Leaflet + React Leaflet |
| Backend | Django 6.x + Django REST Framework |
| Database | MongoDB (MongoEngine ODM) |
| Real-time | Django Channels (WebSocket) |
| Task Queue | Celery + Redis |
| Build | Webpack 5 |
- Python 3.11+
- Node.js 18+ and npm
- MongoDB Atlas account (free tier) or local MongoDB
- Redis (local or cloud service)
git clone https://github.com/yourusername/FlytBase-DSMS.git
cd FlytBase-DSMS
# Install Python dependencies
cd src/dsms
pip install -r requirements.txt
# Install Node.js dependencies
cd ../..
npm installCreate a .env file in the root directory:
# MongoDB Configuration
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/dsms
# Redis Configuration
REDIS_URL=redis://localhost:6379
# Django Configuration
SECRET_KEY=your-secret-key-here
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1
CORS_ALLOWED_ORIGINS=http://localhost:5173,http://localhost:3000
# Django Settings Module
DJANGO_SETTINGS_MODULE=dsms.conf.settings.development# Load DJI drone fleet data
python scripts/seed_drone_fleet.pyThis will populate your database with:
- 12 DJI drone models (Mavic 4/3 Pro, Air 3S, Mini series, Flip, Neo, Avata 2, Inspire 3)
- 30-45 drones per base with realistic specifications
- Drone images from static/drone-gallery
Backend (Django):
cd src/dsms
python manage.py runserverFrontend (Webpack Dev Server):
npm run dev:frontendOr use the unified dev script:
python dev.pyAccess the application:
- Frontend: http://localhost:5173/ (dev) or http://localhost:8000/ (production)
- API: http://localhost:8000/api/
- Health Check: http://localhost:8000/health/
# Build frontend for production
npm run build
# Type checking
npm run typecheck
# Linting
npm run lint
npm run lint:fix# Seed drone fleet with DJI models
python scripts/seed_drone_fleet.py
# Test API endpoints
python scripts/test_api.py| Method | Endpoint | Description |
|---|---|---|
| GET | /api/bases/ |
List all bases |
| POST | /api/bases/ |
Create base |
| GET | /api/bases/<id>/ |
Get base details |
| PATCH | /api/bases/<id>/ |
Update base |
| DELETE | /api/bases/<id>/ |
Delete base |
| GET | /api/bases/<id>/drones/ |
Get drones at base |
| GET | /api/bases/<id>/stats/ |
Get base statistics |
| GET | /api/bases/nearest/?lat=&lng= |
Find nearest base |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/fleet/drones/ |
List all drones |
| POST | /api/fleet/drones/ |
Register drone |
| GET | /api/fleet/drones/<id>/ |
Get drone details |
| PATCH | /api/fleet/drones/<id>/ |
Update drone |
| DELETE | /api/fleet/drones/<id>/ |
Delete drone |
| GET | /api/fleet/stats/ |
Fleet statistics |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/missions/ |
List all missions |
| POST | /api/missions/ |
Create mission |
| GET | /api/missions/<id>/ |
Get mission details |
| PATCH | /api/missions/<id>/ |
Update mission |
| DELETE | /api/missions/<id>/ |
Delete mission |
| POST | /api/missions/<id>/start/ |
Start mission |
| POST | /api/missions/<id>/pause/ |
Pause mission |
| POST | /api/missions/<id>/resume/ |
Resume mission |
| POST | /api/missions/<id>/abort/ |
Abort mission |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/missions/ |
List all missions |
| POST | /api/missions/ |
Create mission |
| GET | /api/missions/<id>/ |
Get mission details |
| PATCH | /api/missions/<id>/ |
Update mission |
| DELETE | /api/missions/<id>/ |
Delete mission |
| POST | /api/missions/<id>/start/ |
Start mission |
| POST | /api/missions/<id>/pause/ |
Pause mission |
| POST | /api/missions/<id>/resume/ |
Resume mission |
| POST | /api/missions/<id>/abort/ |
Abort mission |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/analytics/overview/ |
System-wide analytics |
| GET | /api/analytics/missions/timeline/ |
Mission completion timeline |
| GET | /api/analytics/drones/utilization/ |
Drone utilization metrics |
Real-time telemetry updates:
ws://localhost:8000/ws/missions/<mission_id>/telemetry/
| Route | Component | Description |
|---|---|---|
/bases |
Bases | Base management (default page) |
/drones |
Drone | Drone fleet dashboard |
/missions |
Missions | Mission list and history |
/mission/planner |
MissionPlanner | Create new missions |
/mission/monitor |
LiveMonitor | Real-time mission tracking |
/analytics |
Analytics | Statistics and charts |
static/app/
βββ components/
β βββ common/
β β βββ Layout.tsx # Main app layout with sidebar
β β βββ DeviceRestriction.tsx # Desktop-only restriction
β βββ ui/ # shadcn/ui components
β βββ badge.tsx
β βββ button.tsx
β βββ card.tsx
β βββ table.tsx
βββ pages/
β βββ Bases.tsx # Base CRUD with map
β βββ Drone.tsx # Drone fleet with hero layout
β βββ Missions.tsx # Mission management
β βββ MissionPlanner.tsx # Mission creation wizard
β βββ LiveMonitor.tsx # WebSocket telemetry
β βββ Analytics.tsx # Charts and metrics
βββ services/
β βββ baseService.ts # Base API client
β βββ droneService.ts # Drone API client
β βββ missionService.ts # Mission API client
βββ types/
βββ base.ts # Base interfaces
βββ drone.ts # Drone interfaces
βββ mission.ts # Mission interfaces
src/dsms/services/
βββ fleet_service.py # Drone CRUD operations
βββ mission_service.py # Mission lifecycle management
βββ path_generator.py # Flight path algorithms
βββ analytics_service.py # Statistics computation
βββ telemetry_service.py # Real-time data streaming
Build and deploy using the provided Dockerfile:
# Build Docker image
docker build -t dsms:latest .
# Run container
docker run -p 8000:8000 \
-e MONGODB_URI=your_mongodb_uri \
-e REDIS_URL=your_redis_url \
-e SECRET_KEY=your_secret_key \
dsms:latestThe Docker build process:
- Installs Python and Node.js dependencies
- Builds the React frontend with Webpack
- Collects Django static files
- Serves both frontend and API from port 8000
1. Build Frontend:
npm ci --production=false
npm run build2. Collect Static Files:
python manage.py collectstatic --noinput3. Set Production Environment:
export DJANGO_SETTINGS_MODULE=dsms.conf.settings.production
export SECRET_KEY=your-production-secret-key4. Run with Gunicorn:
gunicorn dsms.wsgi:application --bind 0.0.0.0:8000# Required
MONGODB_URI=mongodb+srv://...
REDIS_URL=redis://...
SECRET_KEY=production-secret-key
DJANGO_SETTINGS_MODULE=dsms.conf.settings.production
# Optional
DEBUG=False
ALLOWED_HOSTS=yourdomain.com,www.yourdomain.com
CORS_ALLOWED_ORIGINS=https://yourdomain.com- Create operational bases with geographic coordinates
- View all bases on an interactive Leaflet map
- Status tracking (active, maintenance, offline)
- Filter bases by status
- Edit base details and status inline
- View drone count per base
- Support for 12 DJI drone models with authentic specifications
- Hero layout with large drone images
- Real-time battery and status monitoring
- Add new drones with detailed specifications
- Assign drones to specific bases
- Filter by base and status
- Delete drones with confirmation
- Draw coverage areas on map
- Multiple flight patterns: crosshatch, perimeter, spiral, waypoint
- Configurable altitude, speed, and overlap
- Automatic waypoint generation
- Assign drones from available fleet
- Schedule mission start times
- Auto-refresh telemetry (1-5 second intervals)
- Live drone position updates on map
- Battery level tracking
- Mission progress percentage
- Pause/resume/abort controls
- Mission phases: traveling β surveying β returning β completed
- Background polling (works even when tab is not focused)
- Fleet utilization metrics
- Mission completion statistics
- Completed mission path visualization
- Survey area display with boundaries
- Historical performance data
The project includes a GitHub Actions workflow that pings the Render health endpoint every 10 minutes to prevent the free tier from sleeping:
# .github/workflows/keep-alive.yml
name: Keep Render Alive
on:
schedule:
- cron: '*/10 * * * *'
jobs:
ping:
runs-on: ubuntu-latest
steps:
- run: curl https://dsms-raqe.onrender.com/health/This runs automatically on GitHub's servers, keeping your Render service active 24/7.
- React Query: Efficient data fetching with automatic caching and background updates
- shadcn/ui: Accessible, customizable components built on Radix UI
- Tailwind CSS: Utility-first styling with neutral color scheme
- TypeScript: Full type safety across the frontend
- Leaflet: Interactive maps with custom markers and polygons
- MongoEngine: Elegant MongoDB ODM for Python
- Django Channels: WebSocket support for real-time features
- Celery: Background task processing for mission execution
- Architecture Guide - System design and patterns
- API Reference - Complete API documentation
- Deployment Guide - Production setup instructions
- Setup Guide - Detailed development setup
# Clear node_modules and reinstall
rm -rf node_modules package-lock.json
npm install- Verify MONGODB_URI in .env
- Check IP whitelist in MongoDB Atlas
- Ensure database user has proper permissions
- Check Redis is running
- Verify REDIS_URL in .env
- Ensure CORS settings allow WebSocket connections
MIT License - See LICENSE file for details
Contributions are welcome! Please feel free to submit a Pull Request.
For questions or support, please open an issue on GitHub.
Built for the FlytBase Design Challenge π