π 1st Runner-up at CodeFest Revivation Hackathon π
A comprehensive disaster response platform built for the hackathon addressing Sri Lanka's critical disaster management challenges through AI-powered mobile and web applications.
The National Disaster Response Platform is a dual-platform solution consisting of:
- Mobile App: Citizen-facing React Native application for emergency reporting and real-time alerts
- Web Dashboard: Government administrative interface for disaster management and resource allocation
Sri Lanka faces critical gaps in disaster response:
- β Outdated communication systems
- β Resource allocation bottlenecks
- β Slow government notifications
- β Lack of citizen agency in reporting
- β Fragmented data across systems
- π SLUDI Authentication: Secure login using Sri Lanka's Digital Public Infrastructure
- π Real-time Location Services: GPS-based emergency reporting
- π¨ One-tap SOS: Emergency signal with automatic location capture
- π Incident Reporting: Food, shelter, medical, and danger reports with photo upload
- π€ AI Safety Assistant: Contextual chatbot for safety guidance
- πΊοΈ Risk Map: Color-coded disaster zones with real-time updates
- π Dashboard: Weather, risk assessment, and recent alerts
- π₯ Role-based Access: SLUDI authentication for government officials
- π Analytics Dashboard: Overview statistics and real-time monitoring
- π¨ SOS Monitor: Live emergency signal tracking with priority sorting
- πΊοΈ Reports Heatmap: Geographic visualization of citizen needs
- π¦ Resource Management: AI-powered supply allocation and tracking
- β‘ Real-time Updates: WebSocket connections for live data
- Mobile App: React Native with offline-first design
- Web Dashboard: React with responsive design
- Maps: React Native Maps / Google Maps API
- State Management: React Context API
- API Gateway: Express.js with middleware
- Database: MongoDB Atlas with geospatial indexing
- Authentication: SLUDI mock implementation
- Real-time: WebSocket connections
- AI Integration: Dialogflow/Rasa for chatbot
- NDX: Mock JSON APIs for disaster data
- SLUDI: OAuth2 mock for authentication
- PayDPI: Optional payment simulation
## π Quick Start
### Prerequisites
- Node.js (v16 or higher)
- MongoDB Atlas account
- React Native development environment
- Android Studio / Xcode (for mobile development)
### Backend Setup
1. **Clone the repository**
```bash
git clone https://github.com/disaster-response-sl/national-disaster-platform.git
cd national-disaster-platform
-
Install backend dependencies
cd src/web-dashboard/backend npm install -
Environment Configuration Create a
.envfile insrc/web-dashboard/backend/:PORT=5000 MONGO_URI=mongodb+srv://your-username:your-password@your-cluster.mongodb.net/disaster_platform JWT_SECRET=your-jwt-secret-key JWT_EXPIRES_IN=24h SLUDI_MOCK_ENABLED=true SLUDI_BASE_URL=http://localhost:5000/mock-sludi //.env full file provided in documentaion not provided here due to security reasons.
-
Start the backend server
npm start
-
Install mobile app dependencies
cd src/MobileApp npm install -
Install React Native dependencies
npx react-native install
-
Start Metro bundler
npx react-native start
-
Run on Android/iOS
# Android npx react-native run-android # iOS npx react-native run-ios
-
Install web dashboard dependencies
cd src/web-dashboard/frontend npm install -
Start the development server
npm start
- Citizen Login:
citizen001/123456 - Responder Login:
responder001/123456 - Admin Login:
admin001/123456
POST /api/mobile/login- User authenticationPOST /api/mobile/register- User registration
GET /api/mobile/disasters- Get active disastersPOST /api/mobile/disasters- Create new disaster
GET /api/mobile/sos-signals- Get recent SOS signalsPOST /api/mobile/sos- Send SOS signal
GET /api/mobile/reports- Get recent reportsPOST /api/mobile/reports- Submit new report
GET /api/mobile/resources- Get available resourcesPOST /api/mobile/resources- Add new resource
GET /api/mobile/chat-logs- Get chat historyPOST /api/mobile/chat- Send chat message
- Shalon - Software Architect & Lead Software engineer
- Gaindu - Mobile App & Web Dashboard Development
- Lehan - Web Dashboard Development
- Pavith - Web Dashboard Development
- Shalon: Technical architecture, Mobile app development, React Native, Backend implementation
- Gaindu & Shalon: Mobile app development, Web Dhasboard & Backend implementation
- Lehan & Pavith: Web dashboard development, Backend, React implementation
- All Members: Testing, documentation, and quality assurance
- β Repository setup and project structure
- β Static UI development for mobile and web
- β Database schema implementation
- β Mock data population
- β Backend API development
- β Frontend-backend integration
- β Real-time features implementation
- π AI chatbot integration
- π DPI integration (SLUDI, NDX, PayDPI)
- π Testing and bug fixes
- π Documentation completion
- π Demo preparation
- Faster Emergency Response: Real-time SOS and disaster alerts
- Optimized Resource Allocation: AI-powered supply distribution
- Enhanced Citizen Engagement: Two-way communication platform
- Transparent Operations: Public visibility into relief efforts
- Scalable Solution: Exportable to other disaster-prone regions
export const API_BASE_URL = 'http://10.0.2.2:5000'; // Android Emulator
// export const API_BASE_URL = 'http://localhost:5000'; // iOS Simulator- Base URL:
http://localhost:5000(development) - Authentication: Bearer token in Authorization header
- Content-Type:
application/json
- One-tap emergency button
- Automatic GPS location capture
- Priority level selection (High/Medium/Low)
- Message field for additional details
- Push notifications for new disasters
- Location-based risk assessment
- Weather integration
- Offline capability
- Natural language processing
- Contextual safety recommendations
- Pre-defined quick questions
- Emergency contact information
- SLUDI mock authentication
- Role-based access (Citizen/Responder)
- Secure token storage
- Current location weather
- Risk assessment based on nearby disasters
- Quick action buttons (SOS, Report, Chat)
- Recent alerts feed
- Available resources display
- Incident type selection
- Photo upload capability
- Location confirmation
- Status tracking
- Role-based access control
- Real-time statistics
- Geographic data visualization
- Resource management
- Create and update disasters
- Set severity levels
- Publish public alerts
- Status tracking
- Live emergency signal feed
- Priority-based sorting
- Geographic clustering
- Response assignment
- JWT token authentication
- Role-based access control
- Input validation and sanitization
- Secure API endpoints
- Environment variable protection
-
MongoDB Connection Error
- Verify MONGO_URI in .env file
- Check network connectivity
- Ensure IP whitelist in MongoDB Atlas
-
Mobile App API Connection
- Use
10.0.2.2for Android emulator - Use
localhostfor iOS simulator - Check backend server is running
- Use
-
GPS Location Issues
- Enable location permissions
- Check device GPS settings
- Verify location services are enabled
# Check backend logs
cd src/web-dashboard/backend
npm start
# Check mobile app logs
cd src/MobileApp
npx react-native log-android
npx react-native log-ios
# Reset database
npm run seedThis project is licensed under the Apache License 2.0 β you are free to use, modify, and distribute this software, provided that proper credit is given to the original developers and a copy of this license is included.
See the LICENSE file for full details.
- Sri Lanka Digital Public Infrastructure (DPI) team
- React Native and React communities
- MongoDB Atlas for database hosting
- OpenWeatherMap for weather data
- Google Maps for mapping services
Built with β€οΈ for Sri Lanka's disaster response needs
This platform demonstrates the potential of AI and modern technology in addressing critical national challenges.