An IoT-powered emergency management system that monitors and coordinates survival kits in real-time. This dashboard provides centralized monitoring of distributed survival kit sensors, automated threshold alerts, and emergency communication capabilities.
- Multi-Sensor Data Collection: Temperature, humidity, air pressure, air quality, CO levels, combustible gas, and water quality
- ThingSpeak Integration: Live data feeds from IoT sensors (Channel ID: 2925202)
- Automated Data Refresh: Updates every 30 seconds
- Visual Status Indicators: Color-coded device markers on interactive map
- Command Center: Central hub for coordinating all survival kits
- Alert Broadcasting: Send emergency messages to all survival kits
- Mesh Network Visualization: Shows connectivity between devices
- Route Planning: Optimal path calculation for emergency response
- Threshold Alerts: Automatic warnings when sensor values exceed safe ranges
- Real-Time Notifications: Instant alerts for critical conditions
- Message Logging: Complete communication history between devices
- Device Status Tracking: Battery levels, signal strength, and connectivity status
- 8 Survival Kits distributed across Syracuse, NY area
- 1 Command Center coordinating all operations
- Mesh Connectivity showing device-to-device communication paths
- Click-to-Connect functionality for establishing communication routes
Temperature: 15°C - 30°C
Humidity: 40% - 80%
Pressure: 980 - 1020 hPa
Air Quality: 0 - 500 IAQ
CO Level: 0 - 50 ppm
Combustible Gas: 0 - 1000 ppm
Water Quality: 0 - 1000 ppm TDS
- Frontend: Next.js 15.3.0 with React 19
- Mapping: Leaflet & React-Leaflet for interactive maps
- Styling: Tailwind CSS for responsive design
- TypeScript: Full type safety and better developer experience
- IoT Integration: ThingSpeak API for real-time sensor data
- Real-time Updates: Automatic data polling and state management
- Node.js 18+
- npm, yarn, pnpm, or bun
-
Clone the repository
git clone <repository-url> cd survival-kit
-
Install dependencies
npm install # or yarn install # or pnpm install
-
Start the development server
npm run dev # or yarn dev # or pnpm dev # or bun dev
-
Open the application Navigate to http://localhost:3000 in your browser
- Real-time device locations around Syracuse, NY
- Color-coded status indicators
- Mesh network connectivity visualization
- Click devices to establish communication routes
- Broadcast emergency messages to all survival kits
- Real-time message composition and sending
- Command center controls
- Automatic sensor value monitoring
- Instant alerts for out-of-range readings
- Historical alert tracking (last 20 alerts)
- Complete communication history
- Device-to-device message routing
- Timestamp tracking (last 10 messages)
The application connects to ThingSpeak for live IoT data. Configure your API credentials using environment variables:
- Create a
.env.local
file in the root directory:
NEXT_PUBLIC_THINGSPEAK_CHANNEL_ID=your_channel_id
NEXT_PUBLIC_THINGSPEAK_API_KEY=your_api_key
- Update
src/app/components/thingspeak.ts
to use environment variables:
const THINGSPEAK_CHANNEL_ID = process.env.NEXT_PUBLIC_THINGSPEAK_CHANNEL_ID;
const THINGSPEAK_API_KEY = process.env.NEXT_PUBLIC_THINGSPEAK_API_KEY;
.env.local
to your .gitignore
file.
Survival kit locations and configurations are managed in src/app/components/devices.ts
. Each device includes:
- GPS coordinates
- Sensor thresholds
- Network connectivity
- Status monitoring
survival-kit/
├── src/app/
│ ├── components/
│ │ ├── Map.tsx # Interactive Leaflet map
│ │ ├── AlertPanel.tsx # Emergency alert system
│ │ ├── ThresholdAlertsPanel.tsx # Sensor monitoring
│ │ ├── MessageLogPanel.tsx # Communication history
│ │ ├── devices.ts # Device configurations
│ │ └── thingspeak.ts # IoT data integration
│ ├── types/ # TypeScript definitions
│ ├── styles/ # CSS styling
│ └── page.tsx # Main dashboard
The system automatically generates alerts for:
- Temperature outside 15-30°C range
- Humidity below 40% or above 80%
- Dangerous CO levels (>50 ppm)
- Poor air quality (>500 IAQ)
- Water contamination (>1000 ppm TDS)
- Sensors detect out-of-range values
- Automatic threshold alert generated
- Message sent to Command Center
- Alert logged in dashboard
- Optional manual broadcast to all kits
- Live IoT Data: ThingSpeak platform integration
- Simulated Networks: Mesh connectivity simulation
- Real-time Updates: 30-second refresh intervals
- Historical Tracking: Message and alert history
- Weather API integration
- Predictive analytics for sensor trends
- Mobile app companion
- Advanced routing algorithms
- Integration with emergency services
- Multi-channel ThingSpeak support
The dashboard is fully responsive and works on:
- Desktop computers
- Tablets
- Mobile devices
- Various screen resolutions
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request