Skip to content

SabrinaYyy/AeroGuard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AeroGuard

A dock-based drone response system for smart homes. Launches autonomously when perimeter sensors detect anomalies.

Stack

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)

MVP Features

  1. Perimeter sensor triggers anomaly (motion, door, camera, thermal)
  2. Decision engine dispatches drone or marks false alarm
  3. Frontend visualises drone launching from dock with live phase updates
  4. Gemini analyses camera + thermal feed images
  5. Structured threat analysis (level, objects detected, recommended action)
  6. Dashboard alert + MongoDB event log + ElevenLabs voice broadcast

Project Structure

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

Setup

1. Backend

cd backend
npm install
cp .env.example .env
# Fill in MONGODB_URI, GEMINI_API_KEY, ELEVENLABS_API_KEY, ELEVENLABS_VOICE_ID
npm run dev

2. Frontend

cd frontend
npm install
cp .env.local.example .env.local
# NEXT_PUBLIC_API_URL=http://localhost:5000
npm run dev

Environment Variables

Backend (backend/.env)

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

API Reference

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

Data Flow

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors