Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

DisasterPrep - Interactive Disaster Preparedness Platform

A comprehensive disaster preparedness and emergency management system designed for schools and colleges. This platform provides interactive learning modules, real-time alerts, emergency coordination, and gamification features to enhance disaster preparedness education and response.

๐ŸŒŸ Features

Interactive Learning Modules

  • Gaming Modules on disaster types (earthquake, flood, fire, cyclone, tsunami, etc.)
  • Interactive Quizzes with immediate feedback and scoring
  • Animated Simulations for realistic disaster scenarios
  • Region-specific Content tailored to local disaster risks

Gamification System

  • Badges & Achievements for completing modules and milestones
  • Points System with leaderboards for healthy competition
  • Progress Tracking with detailed analytics
  • Streak Rewards for consistent learning

Real-Time Communication & Alerts

  • Weather Alerts integrated with IMD/NDMA APIs
  • Emergency SOS Button for instant alerts to teachers/admin
  • Push Notifications for critical updates
  • AI-based Scenario Simulation for training

Institutional Dashboard

  • Preparedness Score calculation based on NDMA guidelines
  • Student/Staff Participation tracking in drills and training
  • Compliance Reports and analytics
  • Emergency Response Coordination

Parent & Guardian Features

  • Real-time Alerts about child's safety during emergencies
  • Progress Monitoring of child's learning journey
  • Emergency Notifications with location updates

Emergency Management

  • SOS System with GPS location tracking
  • Disaster Response Team Coordination
  • Emergency Contact Management
  • Drill Scheduling & Management

๐Ÿš€ Technology Stack

Backend

  • Node.js with Express.js
  • MongoDB with Mongoose ODM
  • Socket.io for real-time communication
  • JWT for authentication
  • Axios for external API integration
  • Nodemailer for email notifications

Frontend

  • React 18 with functional components and hooks
  • React Router for navigation
  • Tailwind CSS for styling
  • Framer Motion for animations
  • Lucide React for icons
  • React Hot Toast for notifications
  • Recharts for data visualization

External Integrations

  • Weather API (OpenWeatherMap)
  • NDMA API for disaster alerts
  • SMS Service (Twilio) for emergency notifications
  • Email Service for parent notifications

๐Ÿ“‹ Prerequisites

  • Node.js (v14 or higher)
  • MongoDB (v4.4 or higher)
  • npm or yarn package manager

๐Ÿ› ๏ธ Installation

1. Clone the Repository

git clone <repository-url>
cd disaster-preparedness-system

2. Install Dependencies

# Install root dependencies
npm install

# Install server dependencies
cd server
npm install

# Install client dependencies
cd ../client
npm install

3. Environment Configuration

Create a .env file in the server directory:

NODE_ENV=development
PORT=5000
MONGODB_URI=mongodb://localhost:27017/disaster-preparedness
CLIENT_URL=http://localhost:3000
JWT_SECRET=your_jwt_secret_key_here
JWT_EXPIRE=7d

# Email configuration
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USER=your_email@gmail.com
EMAIL_PASS=your_app_password

# Weather API
WEATHER_API_KEY=your_weather_api_key
WEATHER_API_URL=https://api.openweathermap.org/data/2.5

# NDMA API (if available)
NDMA_API_KEY=your_ndma_api_key
NDMA_API_URL=https://api.ndma.gov.in

# SMS Service (Twilio)
TWILIO_ACCOUNT_SID=your_twilio_account_sid
TWILIO_AUTH_TOKEN=your_twilio_auth_token
TWILIO_PHONE_NUMBER=your_twilio_phone_number

4. Start the Application

# Start both server and client concurrently
npm run dev

# Or start them separately:
# Terminal 1 - Backend
npm run server

# Terminal 2 - Frontend
npm run client

The application will be available at:

๐Ÿ“ฑ User Roles & Permissions

Student

  • Access to learning modules and quizzes
  • View personal progress and achievements
  • Participate in emergency drills
  • Send emergency SOS alerts
  • View leaderboard and badges

Teacher

  • All student permissions
  • Create and manage emergency alerts
  • View class progress and analytics
  • Conduct emergency drills
  • Access institutional dashboard

Administrator

  • All teacher permissions
  • Manage users and institutions
  • Configure system settings
  • View comprehensive analytics
  • Manage emergency response teams

Parent/Guardian

  • Monitor child's learning progress
  • Receive emergency notifications
  • View child's safety status
  • Access emergency contact information

Disaster Response Team

  • Receive emergency alerts
  • Coordinate with institutions
  • Access real-time emergency data
  • Manage emergency responses

๐ŸŽฏ Key Features in Detail

Learning Modules

  • Interactive Content: Engaging multimedia content with animations
  • Adaptive Learning: Content adjusts based on user's age and knowledge level
  • Progress Tracking: Detailed tracking of learning progress and time spent
  • Assessment: Quizzes and simulations to test knowledge retention

Emergency Management

  • Real-time Alerts: Instant notifications for weather and disaster alerts
  • SOS System: One-click emergency alert with GPS location
  • Coordination: Seamless communication between institutions and response teams
  • Drill Management: Scheduled and ad-hoc emergency drills

Analytics & Reporting

  • Preparedness Scores: Calculated based on NDMA compliance guidelines
  • Participation Metrics: Track engagement in learning and drills
  • Performance Analytics: Detailed insights into learning effectiveness
  • Compliance Reports: Generate reports for regulatory compliance

๐Ÿ”ง API Endpoints

Authentication

  • POST /api/auth/register - User registration
  • POST /api/auth/login - User login
  • GET /api/auth/me - Get current user
  • PUT /api/auth/profile - Update profile
  • POST /api/auth/change-password - Change password

Learning Modules

  • GET /api/learning/modules - Get all modules
  • GET /api/learning/modules/:id - Get specific module
  • POST /api/learning/modules/:id/start - Start module
  • POST /api/learning/modules/:id/quiz - Submit quiz
  • POST /api/learning/modules/:id/simulation - Submit simulation

Gamification

  • GET /api/gamification/leaderboard - Get leaderboard
  • GET /api/gamification/badges - Get available badges
  • GET /api/gamification/user-badges - Get user's badges
  • POST /api/gamification/check-badges - Check for new badges

Emergency Management

  • POST /api/emergency/sos - Send emergency SOS
  • GET /api/emergency/active - Get active emergencies
  • POST /api/emergency/:id/respond - Respond to emergency

Alerts

  • GET /api/alerts/weather - Get weather alerts
  • GET /api/alerts/ndma - Get NDMA alerts
  • GET /api/alerts/institution - Get institution alerts
  • POST /api/alerts/institution - Create institution alert

๐ŸŽจ UI/UX Features

Responsive Design

  • Mobile-first approach with responsive layouts
  • Touch-friendly interface for mobile devices
  • Accessible design following WCAG guidelines

Interactive Elements

  • Smooth animations and transitions
  • Real-time updates without page refresh
  • Intuitive navigation and user flows

Visual Feedback

  • Progress indicators and loading states
  • Toast notifications for user actions
  • Color-coded status indicators

๐Ÿ”’ Security Features

  • JWT-based authentication
  • Role-based access control
  • Input validation and sanitization
  • Rate limiting for API endpoints
  • CORS configuration
  • Helmet.js for security headers

๐Ÿ“Š Database Schema

Core Models

  • User: User profiles and authentication
  • Institution: School/college information
  • LearningModule: Educational content
  • UserProgress: Learning progress tracking
  • Badge: Achievement system
  • EmergencyAlert: Emergency notifications
  • UserBadge: User achievements

๐Ÿš€ Deployment

Production Build

# Build the client
cd client
npm run build

# Start production server
cd ../server
npm start

Environment Variables

Ensure all production environment variables are properly configured:

  • Database connection strings
  • API keys for external services
  • Email and SMS service credentials
  • JWT secrets and expiration times

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ“ž Support

For support and questions:

  • Create an issue in the repository
  • Contact the development team
  • Check the documentation

๐Ÿ”ฎ Future Enhancements

  • Mobile app development (React Native)
  • AI-powered personalized learning paths
  • Integration with more weather and disaster APIs
  • Advanced analytics and machine learning insights
  • Multi-language support
  • Offline mode for emergency situations
  • Integration with IoT devices for real-time monitoring

๐Ÿ™ Acknowledgments

  • NDMA (National Disaster Management Authority) for guidelines
  • IMD (India Meteorological Department) for weather data
  • Open source community for various libraries and tools
  • Educational institutions for feedback and requirements

DisasterPrep - Building a safer tomorrow through education and preparedness! ๐Ÿ›ก๏ธ

About

trying to work in servers

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages