A dock-based drone response system for smart homes. Launches autonomously when perimeter sensors detect anomalies.
Layer
Technology
Frontend
Next.js 14 (App Router) + TypeScript + Tailwind CSS
Backend
Node.js + Express
Database
MongoDB Atlas (Mongoose)
AI Analysis
Google Gemini (multimodal)
Voice Alerts
ElevenLabs TTS
Daily Summary
MeDo (via Gemini)
Real-time
Server-Sent Events (SSE)
Perimeter sensor triggers anomaly (motion, door, camera, thermal)
Decision engine dispatches drone or marks false alarm
Frontend visualises drone launching from dock with live phase updates
Gemini analyses camera + thermal feed images
Structured threat analysis (level, objects detected, recommended action)
Dashboard alert + MongoDB event log + ElevenLabs voice broadcast
AeroGuard/
├── backend/ Node.js + Express API
│ ├── config/ DB, constants
│ ├── controllers/ Route handlers
│ ├── middleware/ Error handling, rate limiting
│ ├── models/ Mongoose schemas
│ ├── routes/ Express routers
│ ├── services/ Gemini, ElevenLabs, SSE, mission simulation
│ └── utils/ Logger, image processing, async wrapper
└── frontend/ Next.js app
├── app/ App Router pages
├── components/ React components
├── hooks/ useSSE, useMission, useVoiceAlert
└── lib/ Types, API client, AppStateContext
cd backend
npm install
cp .env.example .env
# Fill in MONGODB_URI, GEMINI_API_KEY, ELEVENLABS_API_KEY, ELEVENLABS_VOICE_ID
npm run dev
cd frontend
npm install
cp .env.local.example .env.local
# NEXT_PUBLIC_API_URL=http://localhost:5000
npm run dev
Variable
Description
MONGODB_URI
MongoDB Atlas connection string
GEMINI_API_KEY
Google AI Studio API key
GEMINI_MODEL
Model name (default: gemini-1.5-flash)
ELEVENLABS_API_KEY
ElevenLabs API key
ELEVENLABS_VOICE_ID
ElevenLabs voice ID
PORT
Server port (default: 5000)
ALLOWED_ORIGINS
Comma-separated CORS origins
Frontend (frontend/.env.local)
Variable
Description
NEXT_PUBLIC_API_URL
Backend base URL
NEXT_PUBLIC_SSE_URL
SSE stream URL
Method
Path
Description
POST
/api/sensors/trigger
Fire a sensor anomaly
GET
/api/missions/active
Get active drone mission
GET
/api/events
List events (paginated)
GET
/api/events/stats/today
Today's activity counts
POST
/api/analysis/run
Run Gemini analysis
POST
/api/voice/broadcast
Synthesise + broadcast voice alert
GET
/api/summary/today
Get/generate today's MeDo summary
GET
/api/stream
SSE real-time event stream
Sensor Trigger
↓ POST /api/sensors/trigger
Decision Engine (missionDecisionService)
↓ shouldDispatch = true
Create Mission → Start Simulation
↓ SSE: mission:created, mission:phase (every few seconds)
Frontend DroneDocWidget animates phase transitions
↓
POST /api/analysis/run (with camera + thermal base64)
↓ Gemini multimodal API
Structured JSON analysis stored on Event
↓ SSE: gemini:complete
AlertBanner shows threat + POST /api/voice/broadcast
↓ ElevenLabs TTS → audio file
VoiceAlertPlayer auto-plays audio
↓
Nightly cron: MeDo generates daily summary