Project Info
Inspiration
In California, 81% of residents (26M+) live with wildfire risk, and 2025 alone has seen 7,500+ fires that burned ~500,000 acres. In late-night ride-alongs and debriefs with emergency volunteers, one theme kept coming up: incident commanders are forced to stitch together radios, spreadsheets, texts, and maps while the fire grows by the minute. Orion was born to replace that chaos with a single, AI-powered command centerβso responders can act faster, smarter, and safer.
What it does
Orion is an AI wildfire operations dashboard that turns raw data into decisions: πΊοΈ Live 3D Situational Awareness β Real-time fire incidents, wind-aware spread prediction, weather/AQI overlays, and embedded live video on the map. π€ Autonomous Agents β Background Python + Fetch.ai uAgents monitor incidents, compute risk, and continuously propose optimal routes for responders and evacuations. π£οΈ Voice Operations β VAPI-powered hands-free control: βStatus of Pine Ridge? Dispatch two teams. Read me wind for the next hour.β π Dynamic Dispatch & Containment β One-click deploy from nearest station, animated units along routes, on-scene detection (Haversine), and visual containment progression. π¨ Multi-Channel Alerts β Telegram/SMS notifications with formatted incident payloads, delivery confirmation, and retry logic. Outcome: a unified command center that cuts coordination time, reduces guesswork, and helps protect people and property when every second counts.
How we built it
Frontend & UX Next.js 16 + React 18 + TypeScript for fast, type-safe UI Tailwind + Radix UI + shadcn for accessible, production-ready components Mapbox GL JS + react-map-gl for 3D terrain, custom layers, and route rendering Realtime & Data Supabase (Postgres + Realtime) for incidents, firestations, responders; sub-second sync via WebSockets Open-Meteo for weather/AQI (no key), Mapbox Directions for routing AI, Agents & Voice Python uAgents (Fetch.ai): monitoring agent (risk scoring, anomaly detection) + route agent VAPI (@vapi-ai/web): domain-tuned prompts, low-latency voice queries & responses Comms & Integrations Composio + Telegram Bot API for one-click alerts, message IDs, retries Fire Spread Modeling Custom multi-octave noise + wind vectors to generate organic, non-circular boundaries and time-based growth. Deployed with Vercel/AWS Amplify; strict ESLint/TypeScript rules, cleanup on unmount, and debounced updates to keep the UI crisp.
Challenges we ran into
Realistic fire behavior without jank: Getting organic, wind-influenced edges that donβt βflickerβ or become perfect circles required multi-octave noise, normalization, and careful animation timing. Keeping everything in sync: Incidents, responders, routes, weather panels, and voice state had to update in lock-step. Memory leaks were a riskβsolved with disciplined subscription cleanup and state batching. Smooth responder movement + arrival detection: Interpolating along polyline routes while computing precise on-scene thresholds (Haversine) and status transitions. Voice in crisis contexts: VAPI needed wildfire terminology, context injection (active incidents, weather), and graceful fallback when mic/connection issues occurred. Video performance in map popups: Ensured codecs/fallbacks didnβt tank FPS; isolated rendering paths.
Accomplishments we're proud of
β A complete, working workflow: detection β analysis β dispatch β alerts β containment visualization. β Sub-second realtime across clients with Supabase Realtimeβand zero critical leaks. β Agent ecosystem that actually runs unattended (monitoring + routing) with actionable recommendations. β Voice-first operations that meaningfully reduce clicks in high-stress moments. β Designed for scale: 25+ active incidents, many concurrent users, 60 FPS animations on commodity hardware.
What we learned
Geospatial math is everything: Haversine distance, bearings, and interpolation underpin user trust. Realtime demands discipline: WebSocket lifecycles, debouncing, optimistic updates, and teardown patterns are non-negotiable. Voice shines when hands are busy: In command roles, conversational ops beat menusβif latency stays <2s and context is accurate. Agents β background tasks: Orchestration, retries, and human-in-the-loop UX are product features, not just infra.
What's next
π°οΈ NASA FIRMS satellite ingestion for earlier detection π± Native iOS/Android apps for field teams with offline sync πΊοΈ Automatic evacuation zone mapping + geofenced public alerts β‘ Predictive resource staging (AI forecasts for pre-positioning crews/equipment) π₯ Multi-agency roles & audit trails (CAL FIRE, local, federal) π Historical analytics: response times, allocation efficiency, and after-action insights Orionβs mission: put actionable intelligence in the hands of first respondersβwhen it matters most.
π₯ Orion - Wildfire Operations Dashboard

AI-Powered Wildfire Command Center with Autonomous Agents, Live Video Streaming, and Real-Time Intelligence
Built at CalHacks β’ Transforming Emergency Response through AI
π₯ Live Video Intelligence β’ π€ Autonomous AI Agents β’ π£οΈ Voice Operations β’ πΊοΈ 3D Fire Simulation β’ π¨ Smart Alerts
π Features β’ π¬ User Flow β’ π οΈ Installation β’ βοΈ Configuration β’ ποΈ Architecture
π Table of Contents
- Feature Highlights
- Overview
- Features
- User Flow
- Technology Stack
- Installation
- Configuration
- Usage
- Project Structure
- Architecture
- API Reference
- Database Schema
- Components
- Real-Time Features
- Styling & Theming
- Testing
- Performance Optimizations
- Security Considerations
- Future Enhancements
- Troubleshooting
- Contributing
- License
- Team
- Acknowledgments
- Resources
π― Feature Highlights
π₯ What Makes Orion Special
| Feature | Description | Technology |
|---|---|---|
| π€ Autonomous AI Agents | Background Python + Fetch.ai agents monitor fires and optimize routes 24/7 | Python, Fetch.ai, Real-time APIs |
| π£οΈ Voice AI Operations | Hands-free incident management with conversational AI assistant | VAPI, Natural Language Processing |
| πΉ Live Video Streaming | Real-time fire footage embedded directly in map interface | Embedded video players, MP4 streaming |
| πΊοΈ 3D Fire Visualization | Physics-based fire spread with wind-influenced directional growth | Mapbox GL, Multi-octave noise algorithms |
| π¨ Multi-Channel Alerts | Automated SMS + Telegram emergency alerts with intelligent routing | Telegram Bot API, Composio |
| π Real-Time Intelligence | Live weather, air quality, and environmental risk assessment | Open-Meteo API, Supabase Realtime |
| π£οΈ Dynamic Rerouting | AI-calculated evacuation routes that adapt to fire spread patterns | Mapbox Directions API, AI optimization |
| β‘ Instant Sync | Sub-second database updates across all connected clients | Supabase Realtime subscriptions |
π Overview
Orion is a next-generation, AI-powered wildfire operations command center designed for emergency response teams, fire departments, and incident commanders. Built during CalHacks, Orion transforms wildfire response through real-time intelligence, autonomous decision-making, and seamless human-AI collaboration.
π― Product Purpose
Orion addresses the critical challenge of wildfire response coordination by providing a unified command platform that combines:
- Real-time situational awareness across all active fires
- AI-driven decision support for resource deployment and routing
- Voice-activated operations for hands-free incident management
- Automated emergency communications via multiple channels
- Live video intelligence from fire locations
- Predictive fire behavior modeling with environmental data integration
Mission: Reduce emergency response times, optimize resource allocation, and save lives through intelligent automation and real-time coordination.
π Key Capabilities
π₯ Intelligent Fire Operations
- Real-Time Incident Tracking: Monitor active wildfires with live database updates and automatic synchronization
- AI Agent Fire Monitoring: Autonomous Python agent continuously monitors fire states and recommends optimal response strategies
- Dynamic Fire Spread Visualization: Physics-based fire simulation with wind, terrain, and fuel modeling
- Live Video Streaming: Real-time video feeds from active fire locations embedded in map interface
π€ Autonomous AI Systems
- Agentic Voice AI: Conversational AI assistant powered by VAPI for hands-free operations
- AI Route Optimization: Fetch.ai agents automatically calculate and recommend evacuation routes and fire station deployment paths
- Intelligent Alert System: AI-powered SMS/Telegram alerts with contextual fire information
- Predictive Risk Assessment: Real-time fire danger analysis based on environmental conditions
πΊοΈ Advanced Geospatial Intelligence
- 3D Interactive Mapping: Mapbox GL terrain visualization with realistic elevation and buildings
- Live Route Planning: Dynamic rerouting based on fire spread, road closures, and risk zones
- Evacuation Zone Mapping: Automatic generation of evacuation perimeters
- Fire Station Network: Nearest station identification with optimal response routing
π Real-Time Environmental Monitoring
- Weather Integration: Live temperature, humidity, wind speed/direction from Open-Meteo API
- Air Quality Tracking: PM2.5, PM10, and AQI monitoring for health advisories
- Fire Risk Scoring: Dynamic fire danger index based on multiple environmental factors
- Visibility Tracking: Real-time visibility conditions for aviation and ground operations
π¨ Multi-Channel Emergency Communications
- SMS Emergency Alerts: Automated SMS dispatch to emergency contacts and responders
- Telegram Integration: Instant messaging to command channels with formatted incident reports
- Voice Notifications: AI-generated voice alerts for critical situations
- Alert Tracking: Message delivery confirmation and status monitoring
β¨ Features
πΊοΈ Interactive 3D Map
-
Mapbox GL 3D Terrain Visualization
- 3D buildings and terrain with realistic elevation
- Dynamic day/night sky rendering
- Smooth camera animations and transitions
- Pan, zoom, pitch, and rotate controls
-
Fire Incident Markers
- Color-coded by risk level (Critical, High, Medium, Low)
- Animated pulse effects for active fires
- Particle trails for critical incidents
- Clickable markers with detailed popups
- Fire name labels with risk-based styling
-
Dynamic Fire Spread Visualization
- Realistic organic fire spread patterns using multi-octave noise algorithms
- Directional growth simulation (wind, terrain, fuel)
- Non-uniform expansion with emergence from center
- Subtle edge flickering for dynamic appearance
- Color-coded heat intensity gradients
-
Fire Station Network
- Visual fire station markers across California
- Station information popups (name, city, county)
- Automatic routing to nearest station
- Blue route lines showing optimal response paths
- Directional arrow animations on routes
π€ AI Voice Assistant
-
VAPI Integration
- Natural language processing for voice commands
- Real-time transcription of conversations
- Voice-activated incident reporting
- Contextual responses about fire conditions
- Volume level visualization
- Session management (start/stop)
-
Conversation Interface
- Timestamped message history
- User/Assistant role differentiation
- Speaking status indicators
- Offline/Live session states
- Collapsible panel design
π€οΈ Environmental Conditions
-
Real-Time Weather Data (Open-Meteo API)
- Temperature (Β°F) with color-coded risk levels
- Relative humidity with fire risk indicators
- Wind speed (mph) and direction
- Visibility conditions (miles)
- Weather descriptions
-
Air Quality Monitoring
- US AQI (Air Quality Index)
- PM2.5 and PM10 particulate matter
- Risk-based color coding (Good to Very Unhealthy)
- Real-time updates based on map location
-
Fire Risk Analysis
- Fire Danger Index (Extreme to Low)
- Fuel Moisture levels
- Combined environmental risk assessment
- Visual progress bars for risk factors
π¨ Emergency Alert System
-
Telegram Integration (via Composio)
- One-click emergency alert dispatch
- Formatted alert messages with incident details
- Fire name, location, risk level, containment
- Timestamp and coordinates
- Custom message support
- Multi-chat broadcasting capability
-
Alert Management
- Selected incident targeting
- Success/failure status notifications
- Message ID tracking
- Retry mechanisms
π Emergency Responder System
-
Response Team Management
- Track available, dispatched, and on-scene teams
- Each fire station has multiple response teams (default: 3)
- Real-time team status updates
- Automatic nearest station selection
-
Dynamic Dispatch
- One-click responder deployment
- Automatic route calculation to fire location
- Animated firetruck markers moving along routes
- Travel time estimation (configurable ~30 seconds)
- Status updates: available β dispatched β en route β on scene
-
Fire Containment
- Fires automatically shrink when responders arrive
- Containment rate: 60 seconds per responder team
- Multiple teams speed up containment
- Real-time containment percentage updates
- Visual fire size reduction on map
-
Team Tracking
- Live position updates every 2 seconds
- Team number identification (Team 1, 2, 3, etc.)
- Station association and deployment history
- Arrival detection and automatic status change
π Incident Management
-
Real-Time Incident List
- Live updates via Supabase Realtime
- Risk-based badge indicators
- Containment percentages
- Incident ID tracking
- Last update timestamps
- Coordinates display
-
Incident Details
- Name, status, and description
- Precise GPS coordinates
- Risk level classification
- Containment progress
- Video feed availability
- Historical update tracking
π₯ Video Preview System
- Live Fire Footage
- Embedded video players in map popups
- Auto-play with mute
- Click to play/pause
- Video thumbnails
- Fallback for unavailable feeds
- Dynamic video mapping by fire name
π€ Autonomous AI Agent System
Python Fire Monitoring Agent
- Autonomous Fire State Tracking: Background Python agent continuously monitors fire database for changes
- Risk Assessment: Automatically calculates risk scores based on spread rate, containment, and environmental factors
- Anomaly Detection: Identifies unusual fire behavior patterns requiring immediate attention
- Smart Alerting: Triggers notifications when fires meet specific risk thresholds
- Polling Interval: 60-second intervals for near-real-time monitoring
- State Comparison: Tracks historical states to detect changes in containment, risk, or location
Fetch.ai Route Optimization Agent
- Dynamic Route Calculation: AI agent computes optimal routes from fire stations to fire locations
- Evacuation Planning: Automatically generates evacuation perimeters and safe exit routes
- Road Network Analysis: Considers traffic, road conditions, and fire proximity
- Real-Time Rerouting: Updates routes when fire spreads or roads become unsafe
- Multi-Objective Optimization: Balances fastest response time with safest paths
- Visualization: Routes displayed as orange dashed lines on map interface
AI-Powered Decision Support
- Resource Allocation: Suggests optimal deployment of firefighting resources
- Priority Ranking: Orders incidents by urgency based on multiple factors
- Predictive Modeling: Forecasts fire spread patterns using weather + terrain data
- Coordination Intelligence: Identifies conflicts in resource allocation across multiple fires
- Historical Learning: Improves recommendations based on past incident outcomes
Integration Architecture
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Orion AI Agent Ecosystem β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββββββ ββββββββββββββββ β
β β Python β β Fetch.ai β β
β β Agent βββββββΊβ Agent β β
β β (Monitoring) β β (Routing) β β
β ββββββββ¬ββββββββ ββββββββ¬ββββββββ β
β β β β
β ββββββββββββ¬ββββββββββββ β
β β β
β ββββββββββββΌββββββββββββ β
β β API Routes β β
β β /api/fire-state β β
β β /api/update-routes β β
β ββββββββββββ¬ββββββββββββ β
β β β
β ββββββββββββΌββββββββββββ β
β β Dashboard UI β β
β β - Map visualization β β
β β - Route display β β
β β - Alert notificationsβ β
β ββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Agent Communication Flow
Fire State Change (Supabase) β Python Agent Detects β
Risk Analysis β Fetch.ai Route Calculation β
API Push to Dashboard β Map Updates β
User Notification β Emergency Response
π Modern UI/UX
-
Glass Morphism Design
- Frosted glass panels with backdrop blur
- Semi-transparent overlays
- Smooth shadows and borders
- Depth-based layering
-
Responsive Layout
- Left sidebar: Active Incidents list
- Right sidebar: AI Assistant, Environmental Conditions, Emergency Alerts
- Center: Full-screen interactive map
- Collapsible panels to maximize map space
- Mobile-responsive design patterns
-
Visual Feedback
- Hover effects and transitions
- Fire glow effects for critical elements
- Cyan glow for active status indicators
- Smooth animations and fades
- Scale transformations on interaction
-
Dark Theme Optimized
- Dark background for reduced eye strain
- High contrast text for readability
- Color-coded risk indicators
- Vignette overlay for depth
π¬ User Flow
Complete Operational Workflow
1οΈβ£ Dashboard Launch & Initialization
User opens Orion β California map loads with 3D terrain β
Real-time fire incidents populate β Fire spread animations begin β
Weather data loads for current view β AI systems initialize
What You See:
- Full-screen interactive 3D map of California
- Active fire markers with pulsing animations (color-coded by risk)
- Left sidebar showing active incidents list with real-time updates
- Right sidebar with AI Voice Assistant (offline state)
- Environmental conditions panel (hidden until fire selected)
- Top navigation with current wind conditions
2οΈβ£ Incident Discovery & Navigation
User clicks on fire incident (map marker or sidebar list) β
Map flies to incident location with smooth animation β
Popup appears showing incident details + live video feed β
Nearest fire station identified automatically β
Optimal response route calculated and displayed β
Environmental conditions panel appears with local weather
Interactive Elements:
- Click Fire Marker: Zoom to location, show popup with video
- Click Sidebar Incident: Navigate to fire location on map
- View Live Video: Embedded video player with click-to-play controls
- Route Visualization: Blue route line from nearest fire station to fire
- Fire Label: Name label appears on selected fire
3οΈβ£ AI Voice Assistant Activation
User clicks microphone button β Voice session starts β
User speaks: "What's the status of Pine Ridge Fire?" β
VAPI transcribes speech β AI processes query β
Assistant responds with current containment, risk level, conditions β
Response appears in message history with timestamp β
Audio plays through speakers
Voice Commands You Can Use:
- "Show me all critical fires"
- "What's the weather at [fire name]?"
- "How many fires are currently active?"
- "What's the containment status of [fire name]?"
- "Report a new fire at [location]"
- "What's the air quality near [fire name]?"
Visual Feedback:
- Volume level indicator shows microphone input
- Speaking status animation when AI is responding
- Timestamped message history for full conversation
- Live/Offline status indicator
4οΈβ£ AI Agent Recommendations (Background)
Python agent monitors fire state changes β
Detects risk increase or spread pattern change β
Fetch.ai agent calculates optimal evacuation routes β
Recommendations pushed to dashboard via API β
Orange dashed lines appear on map showing AI-recommended routes β
Evacuation zones displayed as red polygons β
Command center receives real-time intelligence
Autonomous Operations:
- Fire State Monitoring: Python agent polls fire data every 60 seconds
- Route Optimization: AI calculates safest paths avoiding fire zones
- Evacuation Planning: Automatic evacuation boundary generation
- Risk Scoring: Continuous risk assessment based on spread patterns
- Resource Allocation: Suggests optimal fire station deployment
Map Visualization:
- AI Routes: Orange dashed lines (fire station β fire, updated paths)
- Evacuation Zones: Red translucent polygons with dashed borders
- Fire Spread: Growing organic polygons showing fire perimeter
- Station Routes: Blue solid lines for current response paths
5οΈβ£ Environmental Monitoring
User views selected fire β Environmental Conditions panel expands β
Shows real-time weather data from Open-Meteo API β
Displays humidity, temperature, visibility, air quality β
Color-coded indicators show risk levels β
Fire danger index and fuel moisture displayed β
Updates automatically as map moves
Risk-Based Color Coding:
- Humidity: <20% = Critical (Red), 20-30% = High (Orange), >50% = Good (Cyan)
- Temperature: >100Β°F = Extreme (Red), 90-100Β°F = High (Orange), <70Β°F = Good (Cyan)
- Air Quality: >201 AQI = Very Unhealthy (Maroon), 151-200 = Unhealthy (Red)
- Fire Danger: Extreme = 95% bar (Red), Critical = 88% bar (Orange)
6οΈβ£ Emergency Alert Dispatch
User selects critical fire incident β
Environmental panel shows dangerous conditions β
User clicks "Alert: [Fire Name]" button β
System sends formatted alert via Telegram + SMS β
Alert includes: Fire name, location, risk level, containment β
Coordinates, timestamp, and current conditions β
Success confirmation appears with message ID β
Emergency responders receive alert on devices
Alert Content Example:
π¨ WILDFIRE ALERT π¨
Fire: Pine Ridge Fire
Risk Level: CRITICAL
Location: 38.5Β°N, -121.8Β°W
Containment: 15%
Conditions:
- Temperature: 98Β°F
- Humidity: 18%
- Wind: 25 mph ESE
- Fire Danger: EXTREME
Timestamp: 2024-10-26 14:30 UTC
Nearest Station: Station 3
Response Route: Active
Alert Channels:
- β Telegram bot messages to command channels
- β SMS alerts to emergency contacts
- β In-dashboard confirmation with message ID
- β Delivery status tracking
7οΈβ£ Live Fire Spread Monitoring
Fire polygons animate in real-time β
Wind-influenced directional growth (physics-based) β
Organic edges with multi-octave noise patterns β
Fire grows from center outward over 4 minutes β
Color gradient shows heat intensity β
Pulse animation on critical fires β
Containment percentages update live via Supabase
Fire Visualization Features:
- Realistic Spread: Wind direction influences growth patterns
- Organic Shapes: Multi-octave noise for natural-looking edges
- Time-Based Growth: Starts small, expands over 240 seconds
- Color Intensity: Dark red (core) β Orange (edges) gradient
- Glow Effects: Outer glow for depth and realism
- Stable Rendering: Smooth animation without flickering
8οΈβ£ Live Video Intelligence
User clicks fire marker β Popup displays β
Video feed loads from fire location β
Auto-plays on mute with click-to-play controls β
Shows real-time footage from drone or fixed camera β
User can observe smoke, flames, spread direction β
Visual intelligence aids decision-making
Video Features:
- Embedded Player: Video in map popup for immediate context
- Auto-Play: Muted auto-play for quick awareness
- Interactive Controls: Click to play/pause
- Fallback State: "Livestream Unavailable" for fires without video
- Thumbnail Support: Video thumbnails for preview
9οΈβ£ Multi-Fire Coordination
Dashboard shows 3+ active fires simultaneously β
Each fire has independent spread simulation β
Priority indicated by risk badges (Critical, High, Medium, Low) β
User can toggle between fires quickly β
All fire states tracked in left sidebar β
Real-time count badge shows total active incidents β
Command center maintains awareness of all situations
Coordination Features:
- Incident List: Scrollable list with containment percentages
- Quick Navigation: Click any incident to jump to location
- Risk Sorting: Incidents ordered by last update time
- Status Badges: Color-coded risk indicators
- Count Display: Total active incidents in badge
- Real-time Sync: Automatic updates via Supabase Realtime
π Map Controls & Reset
User explores map freely β
Pan, zoom, pitch, rotate controls β
Click-drag to move, scroll to zoom β
Right-click-drag to rotate bearing β
Ctrl+drag to adjust pitch angle β
"Reset View" button returns to California overview β
All selections cleared, routes removed
Navigation:
- Pan: Click + drag
- Zoom: Scroll or pinch
- Rotate: Right-click + drag
- Pitch: Ctrl + drag up/down
- Reset: Bottom-left reset button
- Scale: Imperial scale indicator (miles)
π Real-Time Synchronization Flow
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Orion Dashboard β
βββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββΌββββββββββββββββ
β β β
ββββββΌβββββ ββββββΌβββββ ββββββΌβββββ
βSupabase β β APIs β βAI Agentsβ
βRealtime β β(Weather)β β(Fetch.aiβ
β β β β β Python) β
ββββββ¬βββββ ββββββ¬βββββ ββββββ¬βββββ
β β β
β ββββββΌβββββ β
β β Map β β
β β Updates β β
β βββββββββββ β
β β
ββββββΌβββββββββββββββββββββββββββββββββΌβββββ
β Fire Updates β AI Processing β β
β Route Calculations β Map Display β β
β User Actions β Emergency Alerts β
ββββββββββββββββββββββββββββββββββββββββββββ
π― Typical Use Cases
Scenario 1: New Fire Detected
- AI agent detects new fire entry in database
- Fire appears on map with spreading animation
- Nearest fire station automatically identified
- Response route calculated and displayed
- Voice assistant notifies: "New critical fire detected: [Name]"
- User clicks to view details
- Emergency alert dispatched to responders
Scenario 2: Fire Containment Increases
- Fire crew updates containment percentage in field
- Database update triggers Realtime subscription
- Dashboard updates containment value instantly
- Risk level automatically recalculated
- If contained, fire marker changes color
- Voice assistant can report updated status on request
Scenario 3: Wind Conditions Change
- User pans map to new area
- Weather API fetched for new coordinates
- Environmental panel updates with new wind data
- Fire spread visualization adjusts (for new fires)
- Risk assessment recalculated with new conditions
- AI agent recommends route adjustments if needed
Scenario 4: Mass Evacuation Required
- Fire spreads rapidly (critical risk)
- AI agent calculates evacuation zones
- Red polygons appear on map showing danger areas
- Optimal evacuation routes recommended (green/orange paths)
- Emergency alerts sent to affected areas via SMS/Telegram
- Voice assistant provides evacuation instructions
- Command center coordinates response with real-time intelligence
π οΈ Technology Stack
Frontend
- Next.js 16 - React framework with App Router
- React 18 - UI library
- TypeScript 5 - Type-safe JavaScript
- Tailwind CSS 4 - Utility-first CSS framework
- Radix UI - Headless UI components
- Lucide React - Icon library
- class-variance-authority - Component variants
Mapping & Visualization
- Mapbox GL JS - Interactive 3D maps
- react-map-gl - React wrapper for Mapbox
- Custom Fire Simulation - Procedural fire spread algorithms
Backend & Database
- Supabase - PostgreSQL database with real-time subscriptions
- Supabase Realtime - Live database change notifications
- Next.js API Routes - Serverless API endpoints
AI & Voice
- VAPI - Voice AI platform
- Natural Language Processing - Voice command interpretation
- Real-time Transcription - Speech-to-text conversion
External APIs
- Open-Meteo - Weather and air quality data (free, no API key)
- Telegram Bot API - Emergency alert messaging
- Composio - Integration platform for Telegram
- Mapbox Directions API - Route optimization
Development Tools
- ESLint - Code linting
- PostCSS - CSS processing
- Lightning CSS - Fast CSS bundling
π Installation
Prerequisites
- Node.js 18.x or higher
- npm or pnpm package manager
- Git for version control
- Supabase account for database
- Mapbox account for map API
- VAPI account for voice AI
- Telegram Bot for emergency alerts
Step 1: Clone the Repository
git clone https://github.com/your-org/orion.git
cd orion
Step 2: Install Dependencies
npm install
# or
pnpm install
Step 3: Environment Configuration
Create a .env.local file in the root directory:
# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
# Mapbox Configuration
NEXT_PUBLIC_MAPBOX_TOKEN=your_mapbox_access_token
# VAPI Configuration (Voice AI)
NEXT_PUBLIC_VAPI_PUBLIC_KEY=your_vapi_public_key
# Telegram Configuration (Emergency Alerts)
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
TELEGRAM_CHAT_ID=your_telegram_chat_id
# Composio Configuration
COMPOSIO_API_KEY=your_composio_api_key
Step 4: Database Setup
- Create a Supabase project at supabase.com
- Run the following SQL in your Supabase SQL Editor:
-- Create incidents table
CREATE TABLE incidents (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
name TEXT,
status TEXT CHECK (status IN ('active', 'contained', 'extinguished')),
risk TEXT CHECK (risk IN ('low', 'medium', 'high', 'critical')),
lat NUMERIC,
lon NUMERIC,
containment NUMERIC,
start_time TIMESTAMPTZ DEFAULT NOW(),
last_update TIMESTAMPTZ DEFAULT NOW(),
description TEXT,
created_at TIMESTAMPTZ DEFAULT NOW()
);
-- Create firestations table
CREATE TABLE firestations (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
city TEXT,
county TEXT,
lat NUMERIC NOT NULL,
lon NUMERIC NOT NULL,
created_at TIMESTAMPTZ DEFAULT NOW()
);
-- Enable realtime
ALTER PUBLICATION supabase_realtime ADD TABLE incidents;
ALTER PUBLICATION supabase_realtime ADD TABLE firestations;
-- Create indexes for performance
CREATE INDEX incidents_last_update_idx ON incidents(last_update DESC);
CREATE INDEX incidents_status_idx ON incidents(status);
CREATE INDEX firestations_location_idx ON firestations(lat, lon);
- Insert sample fire station data (optional):
INSERT INTO firestations (name, city, county, lat, lon) VALUES
('Station 1', 'San Francisco', 'San Francisco', 37.7749, -122.4194),
('Station 2', 'Los Angeles', 'Los Angeles', 34.0522, -118.2437),
('Station 3', 'San Diego', 'San Diego', 32.7157, -117.1611);
- Run the responder system migration:
Copy and run the SQL from supabase/migrations/create_responders.sql in your Supabase SQL Editor. This will:
- Create the
responderstable - Seed initial response teams (3 per fire station)
- Create indexes for performance
- Set up the
responder_statsview
Step 5: Mapbox Setup
- Sign up at mapbox.com
- Create an access token with the following scopes:
styles:readfonts:readdatasets:read
- Add the token to
.env.local
Step 6: VAPI Setup
- Sign up at vapi.ai
- Create a voice assistant in the VAPI dashboard
- Configure the assistant with wildfire-specific prompts:
- "You are an AI assistant for a wildfire operations dashboard..."
- Enable voice-to-text and text-to-voice
- Copy the assistant ID and update in
hooks/use-vapi.ts(line 107) - Copy the public key to
.env.local
Step 7: Telegram Setup
- Create a bot with @BotFather on Telegram
- Get your bot token
- Get your chat ID by messaging @userinfobot
- Add credentials to
.env.local
Step 8: Run Development Server
npm run dev
# or
pnpm dev
Open http://localhost:3000 in your browser.
βοΈ Configuration
Mapbox Token Configuration
Update the Mapbox token in components/california-map.tsx (line 718):
mapboxgl.accessToken = "your_token_here";
Or set it via environment variable and reference it:
mapboxgl.accessToken = process.env.NEXT_PUBLIC_MAPBOX_TOKEN!;
VAPI Assistant ID
Update the assistant ID in hooks/use-vapi.ts (line 107):
await vapi.start("your-assistant-id");
Video Mapping
To add video support for specific fires, update lib/video-mapping.ts:
export const FIRE_VIDEOS: FireVideoMap = {
"Pine Ridge Fire": {
videoUrl: "/videos/pine-ridge-fire.mp4",
thumbnailUrl: "/videos/pine-ridge-fire-thumb.jpg",
},
"Redwood Valley Fire": {
videoUrl: "/videos/redwood-valley-fire.mp4",
thumbnailUrl: "/videos/redwood-valley-fire-thumb.jpg",
},
// Add more fires here
};
Place video files in the public/videos/ directory.
Fire Simulation Parameters
Adjust fire spread behavior in components/california-map.tsx:
// Base radius multiplier (line 818)
baseRadius: getBaseRadiusMeters(incident) * 2.5,
// Growth rate (line 822)
expansionRate: getExpansionRate(incident),
// Spread duration (line 914)
const growthProgress = Math.min(elapsedSeconds / 120, 1); // 120 seconds
π Usage
Starting the Dashboard
- Launch Application: Run
npm run devand navigate tohttp://localhost:3000 - Initial View: You'll see California centered with active fire incidents
- Map Navigation:
- Click and drag to pan
- Scroll to zoom
- Right-click + drag to rotate
- Ctrl + drag to adjust pitch
Monitoring Incidents
- View Active Incidents: Check the left sidebar "Active Incidents" panel
- Click on Incident: Navigate to fire location on map
- View Details: Popup shows:
- Fire name and description
- Status and intensity
- Containment percentage
- Video feed (if available)
- Route Display: Blue line shows optimal route from nearest fire station
Using Voice Assistant
- Activate: Click the microphone button in the AI Assistant panel
- Speak Naturally: Ask questions like:
- "What fires are currently active?"
- "What's the status of Pine Ridge Fire?"
- "Show me weather conditions"
- View Responses: Assistant replies appear in real-time with timestamps
- Deactivate: Click the red microphone icon to end session
Checking Environmental Conditions
- Select Fire: Click on a fire incident marker
- View Panel: Environmental Conditions panel appears on right sidebar
- Monitor Metrics:
- Humidity (critical if < 20%)
- Temperature (extreme if > 100Β°F)
- Visibility (poor if < 1 mile)
- Air Quality Index
- Fire Danger level
- Fuel Moisture
Sending Emergency Alerts
- Select Incident: Click on a fire from the map or sidebar
- Click Alert Button: Orange "Alert: [Fire Name]" button at bottom right
- Confirmation: Status message appears showing success/failure
- Telegram Delivery: Alert sent to configured Telegram chat
Managing Panel Views
- Collapse Panels: Click the minimize icon to save screen space
- Expand Panels: Click on collapsed panel header to expand
- Reset View: Click "Reset View" button at bottom left to return to California overview
π Project Structure
CalHacks/
βββ app/ # Next.js App Router
β βββ api/ # API Routes
β β βββ send-emergency-alert/ # Telegram alert endpoint
β β β βββ route.ts
β β βββ weather/ # Weather API proxy
β β βββ route.ts
β βββ globals.css # Global styles
β βββ layout.tsx # Root layout
β βββ page.tsx # Main dashboard page
β βββ test-video/ # Video testing page
β βββ page.tsx
βββ components/ # React components
β βββ ui/ # Reusable UI components (Radix)
β β βββ button.tsx
β β βββ badge.tsx
β β βββ card.tsx
β β βββ ... # 50+ UI components
β βββ california-map.tsx # Main map component
β βββ IncidentsList.tsx # Incidents sidebar
β βββ VideoPreview.tsx # Video player component
β βββ voice-assistant.tsx # Voice AI interface
βββ hooks/ # Custom React hooks
β βββ use-vapi.ts # VAPI voice integration
β βββ use-weather.ts # Weather data fetching
β βββ use-mobile.ts # Mobile detection
β βββ use-toast.ts # Toast notifications
βββ lib/ # Utility libraries
β βββ composio-telegram-service.ts # Telegram integration
β βββ supabase-client.ts # Supabase client setup
β βββ utils.ts # Helper functions
β βββ video-mapping.ts # Fire video mappings
βββ public/ # Static assets
β βββ videos/ # Fire video files
β β βββ pine-ridge-fire.mp4
β β βββ redwood-valley-fire.mp4
β β βββ README.md
β βββ *.svg, *.png # Images and logos
βββ styles/ # Additional stylesheets
β βββ globals.css
βββ .env.local # Environment variables (create this)
βββ amplify.yml # AWS Amplify config
βββ components.json # shadcn/ui config
βββ mcp.json # MCP config
βββ next.config.mjs # Next.js configuration
βββ package.json # Dependencies
βββ postcss.config.mjs # PostCSS configuration
βββ tailwind.config.ts # Tailwind configuration
βββ tsconfig.json # TypeScript configuration
βββ README.md # This file
ποΈ Architecture
System Overview
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Orion Dashboard β
β (Next.js Frontend) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β βββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β Map View β β AI Voice β β Incidents β β
β β (Mapbox) β β (VAPI) β β (Supabase) β β
β βββββββββ¬ββββββββ ββββββββ¬ββββββββ ββββββββ¬ββββββββ β
β β β β β
β ββββββββββββββββββββ΄βββββββββββββββββββ β
β β β
βββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββ΄ββββββββββββββββ
β β
βββββββββββΌββββββββββ ββββββββββββΌβββββββββββ
β External APIs β β Backend Services β
βββββββββββββββββββββ€ βββββββββββββββββββββββ€
β - Open-Meteo β β - Supabase DB β
β - Mapbox API β β - Realtime Subs β
β - Telegram Bot β β - API Routes β
β - Composio β β - Serverless Funcs β
βββββββββββββββββββββ βββββββββββββββββββββββ
Data Flow
-
Incident Updates:
Supabase DB β Realtime Subscription β React State β UI Update -
Map Interactions:
User Click β Map Event β Incident Selection β Popup Display -
Weather Updates:
Map Move β Coordinates β API Route β Open-Meteo β Weather Display -
Emergency Alerts:
Button Click β API Route β Composio β Telegram Bot β User Notification -
Voice Commands:
Microphone Input β VAPI β Transcription β Assistant Response β Audio Output
Component Hierarchy
OrionDashboard (page.tsx)
βββ CaliforniaMap
β βββ Mapbox GL Map
β βββ Fire Markers
β βββ Fire Station Markers
β βββ Fire Spread Polygons
β βββ Route Visualization
β βββ Popups
βββ Left Sidebar
β βββ IncidentsList
β βββ Incident Cards
β βββ Real-time Updates
βββ Right Sidebar
βββ AI Assistant
β βββ Voice Control
β βββ Message History
β βββ Volume Indicator
βββ Environmental Conditions
β βββ Weather Metrics
β βββ Risk Indicators
βββ Emergency Alert Button
State Management
- Local State: React
useStatefor component-specific data - Real-time State: Supabase subscriptions for live updates
- Derived State: Calculated values from multiple sources
- Ref State: Map instances, animation frames, markers
Real-time Architecture
// Supabase Realtime Subscription
const channel = supabase
.channel("incidents-rt")
.on(
"postgres_changes",
{ event: "*", schema: "public", table: "incidents" },
(payload) => {
// Handle INSERT, UPDATE, DELETE events
updateIncidentsState(payload);
}
)
.subscribe();
π‘ API Reference
Weather API
Endpoint: GET /api/weather
Parameters:
lat(required): Latitude coordinatelon(required): Longitude coordinate
Response:
{
"wind": {
"speed": 15,
"deg": 270,
"direction": "W"
},
"temp": 78,
"humidity": 35,
"visibility": 10,
"airQuality": {
"aqi": 65,
"pm2_5": 18.5,
"pm10": 25.3
},
"description": "Clear sky",
"location": "Current Location"
}
Emergency Alert API
Endpoint: POST /api/send-emergency-alert
Request Body:
{
"incident": {
"id": "uuid",
"name": "Pine Ridge Fire",
"risk": "critical",
"lat": 37.7749,
"lon": -122.4194,
"containment": 25,
"last_update": "2024-01-15T10:30:00Z",
"description": "Active wildfire with high winds"
},
"customMessage": "Optional custom message"
}
Response:
{
"success": true,
"messageSid": "123456",
"message": "Emergency alert sent successfully via Telegram"
}
ποΈ Database Schema
incidents Table
| Column | Type | Description |
|---|---|---|
| id | UUID | Primary key |
| name | TEXT | Fire incident name |
| status | TEXT | active, contained, extinguished |
| risk | TEXT | low, medium, high, critical |
| lat | NUMERIC | Latitude coordinate |
| lon | NUMERIC | Longitude coordinate |
| containment | NUMERIC | Containment percentage (0-100) |
| start_time | TIMESTAMPTZ | When fire started |
| last_update | TIMESTAMPTZ | Last update timestamp |
| description | TEXT | Incident description |
| created_at | TIMESTAMPTZ | Record creation time |
firestations Table
| Column | Type | Description |
|---|---|---|
| id | BIGINT | Primary key |
| name | TEXT | Station name |
| city | TEXT | City location |
| county | TEXT | County location |
| lat | NUMERIC | Latitude coordinate |
| lon | NUMERIC | Longitude coordinate |
| total_teams | INTEGER | Number of teams (3) |
| created_at | TIMESTAMPTZ | Record creation time |
responders Table
| Column | Type | Description |
|---|---|---|
| id | UUID | Primary key |
| firestation_id | BIGINT | References firestations.id |
| incident_id | UUID | References incidents.id (null when available) |
| status | TEXT | available, dispatched, en_route, on_scene |
| team_number | INTEGER | Team number (1-3 per station) |
| current_lat | NUMERIC | Current latitude position |
| current_lon | NUMERIC | Current longitude position |
| dispatched_at | TIMESTAMPTZ | Timestamp when dispatched |
| arrived_at | TIMESTAMPTZ | Timestamp when arrived on scene |
| created_at | TIMESTAMPTZ | Record creation time |
| updated_at | TIMESTAMPTZ | Last update time |
responder_stats View
Real-time view for quick team statistics:
| Column | Type | Description |
|---|---|---|
| firestation_id | BIGINT | Fire station ID |
| firestation_name | TEXT | Fire station name |
| available_teams | INTEGER | Count of available teams |
| dispatched_teams | INTEGER | Count of en route teams |
| active_teams | INTEGER | Count of on-scene teams |
| total_teams_runtime | INTEGER | Total teams for this station |
| total_teams_configured | INTEGER | Configured team capacity |
π§© Components
Core Components
california-map.tsx
Main map component with Mapbox GL integration, fire markers, fire stations, routes, and fire spread visualization.
Props:
className?: string- CSS classesonMapReady?: (navigateToIncident) => void- Callback when map is readyonMapMove?: (center) => void- Callback on map movementonIncidentSelect?: (incident) => void- Callback on incident selection
IncidentsList.tsx
Real-time list of active fire incidents with Supabase integration.
Props:
onIncidentClick?: (incident) => void- Click handleronIncidentCountChange?: (count) => void- Count change callbackonIncidentsUpdate?: (incidents) => void- Incidents update callback
voice-assistant.tsx
Voice AI interface with VAPI integration for hands-free operation.
Features:
- Voice activation/deactivation
- Real-time transcription
- Volume level visualization
- Message history
UI Components
Located in components/ui/, including:
button.tsx- Button variantsbadge.tsx- Status badgescard.tsx- Card containersdialog.tsx- Modal dialogstoast.tsx- Notifications- And 50+ more components from Radix UI
π Real-Time Features
Supabase Realtime Subscriptions
The dashboard maintains live connections to the database for instant updates:
// Subscribe to incidents changes
const channel = supabase
.channel("incidents-rt")
.on(
"postgres_changes",
{ event: "*", schema: "public", table: "incidents" },
handleIncidentChange
)
.subscribe();
Fire Spread Animation
Realistic fire spread using procedural generation:
// Multi-octave noise for organic edges
const multiNoise = (x, y, seed, octaves = 3) => {
let value = 0;
let amplitude = 1;
let frequency = 1;
// ... combine octaves for natural patterns
};
// Generate irregular polygon coordinates
const generateFirePolygonCoordinates = (center, radius, options) => {
// ... use noise, growth vectors, and time for dynamic spread
};
Weather Updates
Debounced weather fetching based on map position:
useEffect(() => {
if (lat && lon) {
const timeoutId = setTimeout(() => {
fetchWeather(lat, lon);
}, 1000); // Wait 1 second after map stops moving
return () => clearTimeout(timeoutId);
}
}, [lat, lon]);
π¨ Styling & Theming
Color System
/* Risk Levels */
--critical: #ff6b00; /* Fire orange */
--high: #ff4444; /* Bright red */
--medium: #ffa800; /* Amber */
--low: #00c2ff; /* Cyan */
/* System Colors */
--background: #0a0a0a; /* Near black */
--text: #ffffff; /* White */
--border: rgba(255, 255, 255, 0.1); /* 10% white */
Glass Morphism
.glass-panel {
background: rgba(10, 10, 10, 0.3);
backdrop-filter: blur(20px);
border: 1px solid rgba(255, 255, 255, 0.1);
}
Glow Effects
.fire-glow {
box-shadow: 0 0 20px rgba(255, 107, 0, 0.4);
}
.cyan-glow {
box-shadow: 0 0 10px rgba(0, 194, 255, 0.6);
}
π§ͺ Testing
Local Testing
- Test Incident Creation:
INSERT INTO incidents (name, status, risk, lat, lon, containment, description)
VALUES ('Test Fire', 'active', 'high', 37.7749, -122.4194, 15, 'Test description');
- Test Emergency Alerts:
- Select a fire on the map
- Click the orange alert button
- Check your Telegram for the message
- Test Voice Assistant:
- Click microphone button
- Speak a query: "What fires are active?"
- Verify response appears
Production Deployment
Vercel (Recommended):
npm run build
vercel --prod
AWS Amplify:
- Connect GitHub repository
- Use
amplify.ymlfor build config - Deploy automatically on push
π Performance Optimizations
Implemented Optimizations
-
Map Performance:
- GeoJSON source for fire polygons
- Efficient marker clustering
- Animation frame optimization
- Cleanup on unmount
-
Data Fetching:
- Debounced weather API calls
- Cached video mappings
- Limit database queries to 25 incidents
-
Real-time Updates:
- Single Supabase subscription per component
- State batching for multiple updates
- Cleanup on component unmount
-
Asset Loading:
- Video preloading with metadata
- Lazy loading for large images
- Progressive enhancement
π Security Considerations
Environment Variables
- Never commit
.env.localto version control - Use
.gitignoreto exclude sensitive files - Rotate API keys regularly
API Key Restrictions
- Mapbox: Restrict to your domain in Mapbox dashboard
- Supabase: Use Row Level Security (RLS) policies
- VAPI: Restrict to specific origins
- Telegram: Keep bot token secret
Supabase Row Level Security (RLS)
-- Enable RLS
ALTER TABLE incidents ENABLE ROW LEVEL SECURITY;
ALTER TABLE firestations ENABLE ROW LEVEL SECURITY;
-- Read-only access for authenticated users
CREATE POLICY "Allow public read access" ON incidents
FOR SELECT USING (true);
-- Admin-only write access
CREATE POLICY "Allow admin write access" ON incidents
FOR INSERT WITH CHECK (auth.role() = 'admin');
π Future Enhancements
Planned Features
- Historical Data Analysis: View past fire incidents and trends
- Predictive Fire Risk: Machine learning for fire risk prediction
- Resource Management: Track firefighting equipment and personnel
- Multi-User Collaboration: Real-time collaboration between teams
- Mobile App: Native iOS/Android applications
- Satellite Imagery Integration: Real-time satellite fire detection
- Evacuation Route Planning: Automated evacuation route generation
- Public Alert System: SMS and email alert distribution
- Advanced Analytics Dashboard: Historical trends and insights
- Integration with CAL FIRE: Direct feed from official sources
Technical Improvements
- WebSocket fallback for Realtime
- Offline mode with service workers
- Enhanced error boundaries
- Automated testing suite
- Performance monitoring (Sentry, DataDog)
- CDN integration for video delivery
- GraphQL API layer
- Multi-region deployment
π Troubleshooting
Common Issues
Map Not Loading
- Check Mapbox token: Ensure
NEXT_PUBLIC_MAPBOX_TOKENis set - Check browser console: Look for CORS or token errors
- Verify domain: Add your domain to Mapbox allowed URLs
Incidents Not Appearing
- Check Supabase connection: Verify URL and anon key
- Check database: Ensure incidents table has data
- Check browser console: Look for subscription errors
- Verify RLS policies: Ensure public read access is enabled
Voice Assistant Not Working
- Check VAPI key: Verify
NEXT_PUBLIC_VAPI_PUBLIC_KEYis set - Check assistant ID: Update ID in
use-vapi.tsline 107 - Check microphone permissions: Browser must have mic access
- Check browser compatibility: Use Chrome or Edge for best results
Emergency Alerts Failing
- Check Telegram credentials: Verify bot token and chat ID
- Check bot permissions: Ensure bot can send messages
- Check Composio API: Verify Composio key is valid
- Test bot manually: Send a test message via Telegram API
Weather Data Not Loading
- Check coordinates: Ensure lat/lon are valid
- Check API availability: Open-Meteo may have rate limits
- Check network: Ensure external API calls are allowed
- Check browser console: Look for CORS errors
Debug Mode
Enable debug logging:
// In components/california-map.tsx
console.log("Map loaded:", mapRef.current);
console.log("Incidents:", incidents);
// In hooks/use-vapi.ts
console.log("VAPI message:", message);
console.log("Session active:", isSessionActive);
π€ Contributing
We welcome contributions from the community! Here's how you can help:
Getting Started
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
Code Style
- Use TypeScript for type safety
- Follow ESLint rules
- Use Prettier for formatting
- Write descriptive commit messages
- Add comments for complex logic
Areas for Contribution
- π Bug fixes
- β¨ New features
- π Documentation improvements
- π¨ UI/UX enhancements
- β‘ Performance optimizations
- π§ͺ Test coverage
- π Internationalization
π License
This project is proprietary software developed for wildfire operations management. All rights reserved.
For licensing inquiries, please contact the development team.
π₯ Team
Orion Dashboard was built during CalHacks by a team of passionate developers committed to improving emergency response technology.
Contact
- GitHub: github.com/your-org/orion
- Email: orion-team@example.com
- Website: orion-dashboard.com
π Acknowledgments
- CalHacks for hosting the hackathon
- Mapbox for providing powerful mapping tools
- Supabase for real-time database infrastructure
- VAPI for voice AI technology
- Open-Meteo for free weather data
- Vercel for hosting platform
- Radix UI for accessible components
- Tailwind CSS for styling framework
π Resources
Documentation
- Next.js Documentation
- Mapbox GL JS Documentation
- Supabase Documentation
- VAPI Documentation
- Tailwind CSS Documentation
APIs
Related Projects
- CAL FIRE - Official California fire authority
- InciWeb - Incident information system
- NASA FIRMS - Active fire data
Built with β€οΈ for emergency responders and communities affected by wildfires
Analysis
View
Metric
- 76
- 41
- 24
- 5
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- CSSIn code
- HTMLIn code
- Next.jsIn code
- PythonIn code
- ReactIn code
- SupabaseIn code
- Tailwind CSSIn code
- TypeScriptIn code
- AWSClaimed
- PostgreSQLClaimed
- VercelClaimed
8 of 11 appear in the indexed code. 3 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
495 KB
Source files
93
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
SupratikPanuganti/CalHacks
108 files Β· 127.0 MB Β· @ 28b5980
Structure
Interface
68 files Β· 63%Screens, components and styles rendered to the user.
API & routing
6 files Β· 6%Request entry points: routes, handlers and controllers.
Application logic
14 files Β· 13%Domain rules, services and shared utilities.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here β open the file browser to check anything the diagram implies.
Languages
- TypeScript78%
- Markdown12%
- CSS3%
- HTML3%
- Python3%
- Shell0%
- Other (1)0%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
package.json
npm Β· 65- @composio/core
- @hookform/resolvers
- @radix-ui/react-accordion
- @radix-ui/react-alert-dialog
- @radix-ui/react-aspect-ratio
- @radix-ui/react-avatar
- @radix-ui/react-checkbox
- @radix-ui/react-collapsible
- @radix-ui/react-context-menu
- @radix-ui/react-dialog
- @radix-ui/react-dropdown-menu
- @radix-ui/react-hover-card
- @radix-ui/react-label
- @radix-ui/react-menubar
- @radix-ui/react-navigation-menu
- @radix-ui/react-popover
- @radix-ui/react-progress
- @radix-ui/react-radio-group
- +47 more
python-agent/requirements.txt
pypi Β· 3- python-dotenv
- requests
- uagents
Declared in the repositoryβs manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
Feature verification
3D Mapbox map with fire incident markersVerified
Live 3D situational awareness with real-time fire incidents on a Mapbox GL map
Claimed on readmehigh confidencecomponents/california-map.tsx:674β CaliforniaMap component renders Mapbox GL map with incident markers, popups, and 3D terrain controls
On-scene detection via Haversine and containment progressionVerified
On-scene detection (Haversine) and visual containment progression as responders arrive
Claimed on Devposthigh confidencecomponents/california-map.tsx:396β calculateDistance implements Haversine formulacomponents/california-map.tsx:1292β compares truck-to-fire distance against fire radius (+50m buffer) to trigger on-scene statuscomponents/california-map.tsx:1333β logs 'TOUCHED FIRE EDGE ... ON SCENE' status transition
One-click dynamic dispatch from nearest stationVerified
One-click deploy from nearest station, animated units along routes
Claimed on Devposthigh confidenceapp/api/dispatch-responder/route.ts:18β POST handler finds nearest firestation with available responders via Haversine distance and assigns onecomponents/california-map.tsx:1287β animates truck markers along the route and computes distance to fire center
Python uAgents fire monitoring agent (risk scoring, anomaly detection)Verified
Background Python + Fetch.ai uAgents monitor incidents and compute risk continuously
Claimed on Devposthigh confidencepython-agent/fire_monitor_agent.py:12β imports Agent, Context, Model from uagents and defines an Agent instancepython-agent/fire_monitor_agent.py:230β monitor_fires periodic handler computes risk_score from growth_rate/distance and checks thresholds
Supabase Realtime sub-second sync for incidents/respondersVerified
Sub-second realtime across clients with Supabase Realtime for incidents, firestations, responders
Claimed on readmehigh confidencecomponents/california-map.tsx:920β subscribes to a Supabase channel with postgres_changes on the incidents tablecomponents/IncidentsList.tsx:66β IncidentsList also subscribes to the same realtime channel for live updates
Weather and AQI overlays via Open-MeteoVerified
Real-time weather (temp, humidity, wind, visibility) and air quality (AQI, PM2.5, PM10) overlays with no API key needed
Claimed on readmehigh confidenceapp/api/weather/route.ts:31β fetches current weather from Open-Meteo forecast APIapp/api/weather/route.ts:64β separately fetches us_aqi, pm2_5, pm10 from Open-Meteo air-quality APIhooks/use-weather.ts:15β client hook exposes aqi/pm2_5/pm10 fields to the UI
Wind-aware, multi-octave noise fire spread simulationVerified
Physics-based, wind-influenced organic fire spread using multi-octave noise, non-circular boundaries, time-based growth
Claimed on Devposthigh confidencecomponents/california-map.tsx:465β windSpeed/windDirection parameters bias spread directioncomponents/california-map.tsx:528β multiNoise function combines multiple octaves of noise to build organic, irregular polygon edges
Composio integration for TelegramCode-supported
Composio + Telegram Bot API for one-click alerts, message IDs, retries
Claimed on Devpostmedium confidencelib/composio-telegram-service.ts:1β imports and instantiates the composio-core Composio clientlib/composio-telegram-service.ts:111β comment states actual send bypasses Composio and calls the Telegram Bot API directly ('Composio entity is having issues'), so Composio itself is not actually used for delivery
Embedded live video in map popupsCode-supported
Embedded live video streaming from fire locations directly in the map interface
Claimed on Devpostmedium confidencecomponents/VideoPreview.tsx:160β renders an HTML5 <video> element with a source pointing at videoInfo.videoUrl, autoplay/mute/click-to-playlib/video-mapping.ts:13β static mapping of two fire names to local MP4 files in public/videos, not an actual live stream, just pre-recorded looped clips
Fetch.ai route optimization agent for responders/evacuationCode-supported
Autonomous agent continuously proposes optimal routes for responders and evacuations
Claimed on Devpostmedium confidencepython-agent/fire_monitor_agent.py:135β get_alternative_route computes a rerouted path when a fire intersects the current routepython-agent/fire_monitor_agent.py:185β post_route_update pushes recalculated routes back to the APIlib/fetch-agent.ts:1β TypeScript-side risk analysis mirrors the same Haversine/risk-score logic but no evidence found of an evacuation-zone generator
Fire risk/danger index and fuel moisture displayCode-supported
Fire Danger Index and Fuel Moisture levels shown with visual risk bars
Claimed on readmelow confidencehooks/use-weather.ts:15β weather hook exposes aqi/humidity/temp fields used for risk coloring, but a dedicated fuel-moisture/fire-danger-index computation was not located in the scoped search
Mapbox Directions API routingCode-supported
Mapbox Directions API used for route calculation between stations, fires, and evacuation paths
Claimed on readmelow confidencepython-agent/fire_monitor_agent.py:135β get_alternative_route computes routing, but exact Mapbox Directions API call was not directly inspected/confirmed to originate from this function versus a custom path solver
Multi-channel alerts: Telegram/SMS with delivery confirmation and retry logicCode-supported
Telegram/SMS notifications with formatted incident payloads, delivery confirmation, and retry logic
Claimed on Devpostmedium confidencelib/composio-telegram-service.ts:34β generateFireAlertMessageTelegram builds a formatted incident payload (name, risk, coords, containment)app/api/send-emergency-alert/route.ts:30β route calls sendEmergencyAlertViaTelegram and returns messageId/success on delivery, providing confirmation
VAPI voice control for hands-free operationsCode-supported
VAPI-powered hands-free voice control: status queries, dispatch commands, wind readouts
Claimed on Devpostmedium confidencehooks/use-vapi.ts:21β wraps @vapi-ai/web, wires call-start/end, transcript, and speech eventshooks/use-vapi.ts:105β start() launches a hardcoded VAPI assistant ID; actual assistant-side NLU for specific commands like 'dispatch two teams' lives in the external VAPI dashboard config, not in this repo, so end-to-end command handling can't be confirmed from code alone
Automatic evacuation zone mapping (red polygons)Claimed only
AI agent automatically generates evacuation perimeters displayed as red translucent polygons on the map
Claimed on readmemedium confidenceRetry logic for alert deliveryClaimed only
Alerts include retry mechanisms for failed deliveries
Claimed on readmemedium confidenceSMS alerts to emergency contactsClaimed only
Automated SMS dispatch to emergency contacts and responders
Claimed on readmehigh confidence
An AI agent derived these features from the projectβs Devpost page and readme, then searched the code for each one. Verified features are backed by cited code; claimed-only features had no supporting code, which is not by itself proof a feature is missing.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.