Skip to content

Ravikumar-2016/SaviourWeb

Repository files navigation

Live Demo GitHub

Next.js React TypeScript Firebase TailwindCSS Leaflet Framer Motion


Launch App Β Β  Fork


πŸ“‹ Table of Contents


🌟 About

Purpose Focus

SAVIOUR is a comprehensive disaster management platform designed to save lives and strengthen community resilience during emergencies. Built with modern web technologies, it enables real-time coordination, instant alerts, and efficient resource management.

🎯 Mission

"When disaster strikes, every second counts. SAVIOUR connects communities, coordinates resources, and saves lives through technology."


✨ Features

πŸ†˜ Emergency SOS System

  • One-tap SOS Broadcast - Instantly alert your community with GPS location
  • 9 Emergency Types - Medical, Fire, Robbery, Accident, Domestic Violence, Natural Disaster, Missing Person, Public Disturbance, Other
  • 3-Level Priority System - High/Medium/Low urgency categorization
  • Image Attachments - Upload evidence or situation photos
  • SOS Management - Create, edit, view, and delete your SOS requests
  • Real-time Status Tracking - Track responders and SOS status
  • 5-Second Cancel Window - Prevent accidental alerts

πŸ—ΊοΈ Interactive Navigation & Mapping

  • Leaflet-based Maps - Visualize all SOS requests on interactive map
  • Real-time SOS Markers - Color-coded by urgency level
  • Emergency Type Filtering - Filter map markers by disaster type
  • Click-to-Respond - View SOS details and respond directly from map
  • Profile-based Location - Auto-center map on user's city
  • Responder Tracking - See who responded to each emergency

🌀️ Advanced Weather Intelligence

  • Dual API System - WeatherAPI.com (primary) + OpenWeatherMap (fallback)
  • 5-Day Combined Forecast - Merges data from both APIs
  • 24-Hour Hourly Predictions - Detailed hourly weather data
  • Current Conditions Widget - Temperature, humidity, wind, UV index
  • Profile-based Location - Automatic weather for user's city
  • Source Transparency - Shows which API provided each forecast
  • Sunrise/Sunset Times - Daily astronomical data

πŸ‘₯ Community Hub & Chat

  • City-based Chat Rooms - Connect with people in your area
  • Real-time Messaging - Instant message delivery via Firebase
  • Media Sharing - Share images, videos, and documents (Base64)
  • Active User Counter - See how many are online in your city
  • Persistent History - Messages stored in Firestore
  • User Identification - Display names and avatars

πŸ“¦ Resource Management

  • Resource Offers - Share supplies (Medical, Food, Shelter, etc.)
  • Resource Requests - Request needed supplies with urgency levels
  • 8 Categories - Medical, Food/Water, Shelter, Rescue, Communication, Transportation, Tools, Power/Fuel
  • City-based Matching - Connect with resources in your area
  • Status Tracking - Available, Claimed, Fulfilled, Pending
  • Contact Integration - Direct phone contact with resource providers

πŸ“ž Emergency Contacts

  • National Emergency Numbers - Quick access to 112, 100, 101, 102
  • Personal Emergency Contacts - Add family/friends as emergency contacts
  • One-tap Calling - Direct call integration
  • Location Sharing - Share GPS location via Google Maps link
  • WhatsApp Integration - Send SOS message with location
  • SMS Emergency Alerts - Send emergency SMS to contacts

πŸ“š Comprehensive Safety Guides

  • 12 Disaster Types Covered:
    • 🩺 First Aid Tutorial
    • 🌊 Flood Safety
    • 🌏 Earthquake Safety
    • πŸ”₯ Fire Safety
    • πŸŒ€ Cyclone Safety
    • πŸ§ͺ Chemical Safety
    • ⚑ Electrical Safety
    • 🌩️ Lightning Safety
    • ⛰️ Landslide Safety
    • 🌊 Tsunami Safety
    • ❄️ Extreme Cold Safety
    • 🌑️ Extreme Heat Safety
  • Video Tutorials - Embedded safety videos
  • Step-by-step Protocols - Clear action guides
  • Search Functionality - Quick find safety topics

πŸ” Secure Authentication & Profile

  • Firebase Authentication - Email/Password + Google Sign-in
  • Profile Management - Complete user profiles with location
  • Location Validation - OpenStreetMap Nominatim geocoding
  • First-time User Flow - Guided profile completion
  • Protected Routes - Dashboard requires authentication
  • Session Persistence - Stay logged in across sessions
  • Context-based Auth - Global auth state management

πŸ—οΈ Architecture & Flow

Application Flow

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        USER ENTRY POINTS                        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Landing Page (/) β†’ HeroSection + Features + Contact            β”‚
β”‚       ↓                                                         β”‚
β”‚  Auth Required β†’ Login/Signup (Firebase Auth)                   β”‚
β”‚       ↓                                                         β”‚
β”‚  Profile Setup (First-time users must set city)                 β”‚
β”‚       ↓                                                         β”‚
β”‚  Dashboard (Protected Route)                                    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     DASHBOARD MODULES                           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”             β”‚
β”‚  β”‚  Dashboard  β”‚  β”‚   Profile   β”‚  β”‚     SOS     β”‚             β”‚
β”‚  β”‚   Overview  β”‚  β”‚  Management β”‚  β”‚   System    β”‚             β”‚
β”‚  β”‚ β€’ Weather   β”‚  β”‚ β€’ Edit Info β”‚  β”‚ β€’ Create    β”‚             β”‚
β”‚  β”‚ β€’ Stats     β”‚  β”‚ β€’ Location  β”‚  β”‚ β€’ Manage    β”‚             β”‚
β”‚  β”‚ β€’ Actions   β”‚  β”‚ β€’ Avatar    β”‚  β”‚ β€’ Track     β”‚             β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜             β”‚
β”‚                                                                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”             β”‚
β”‚  β”‚   Weather   β”‚  β”‚  Community  β”‚  β”‚  Emergency  β”‚             β”‚
β”‚  β”‚   Center    β”‚  β”‚    Chat     β”‚  β”‚   Contacts  β”‚             β”‚
β”‚  β”‚ β€’ Current   β”‚  β”‚ β€’ Messages  β”‚  β”‚ β€’ National  β”‚             β”‚
β”‚  β”‚ β€’ Hourly    β”‚  β”‚ β€’ Media     β”‚  β”‚ β€’ Personal  β”‚             β”‚
β”‚  β”‚ β€’ Daily     β”‚  β”‚ β€’ Users     β”‚  β”‚ β€’ Share     β”‚             β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜             β”‚
β”‚                                                                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”             β”‚
β”‚  β”‚ Navigation  β”‚  β”‚  Resources  β”‚  β”‚   Safety    β”‚             β”‚
β”‚  β”‚    Map      β”‚  β”‚   Sharing   β”‚  β”‚   Guides    β”‚             β”‚
β”‚  β”‚ β€’ SOS Map   β”‚  β”‚ β€’ Offers    β”‚  β”‚ β€’ 12 Types  β”‚             β”‚
β”‚  β”‚ β€’ Respond   β”‚  β”‚ β€’ Requests  β”‚  β”‚ β€’ Videos    β”‚             β”‚
β”‚  β”‚ β€’ Filter    β”‚  β”‚ β€’ Contact   β”‚  β”‚ β€’ Search    β”‚             β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜             β”‚
β”‚                                                                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    DATA FLOW ARCHITECTURE                       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                 β”‚
β”‚  Client (Next.js)  ←→  API Routes  ←→  External APIs            β”‚
β”‚       ↕                    ↕                                    β”‚
β”‚  Firebase Firestore (Real-time DB)                              β”‚
β”‚       ↕                                                         β”‚
β”‚  Firebase Auth (Authentication)                                 β”‚
β”‚                                                                 β”‚
β”‚  Collections:                                                   β”‚
β”‚  β€’ users - User profiles with location                          β”‚
β”‚  β€’ sos_requests - Emergency SOS data                            β”‚
β”‚  β€’ chats_users/{city}/messages - Community chat                 β”‚
β”‚  β€’ personal_contacts - Emergency contacts                       β”‚
β”‚  β€’ resources_offers - Resource sharing                          β”‚
β”‚  β€’ resources_requests - Resource needs                          β”‚
β”‚  β€’ notifications - User notifications                           β”‚
β”‚                                                                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Key Technical Highlights

Feature Implementation
Real-time Updates Firebase Firestore onSnapshot listeners
Authentication Firebase Auth with Context Provider
Location Services OpenStreetMap Nominatim API for geocoding
Weather Data Dual API (WeatherAPI + OpenWeatherMap) with fallback
Maps Leaflet with React-Leaflet wrapper
Animations Framer Motion for smooth transitions
State Management React hooks + Context API
UI Components shadcn/ui + Radix UI primitives
Styling Tailwind CSS with dark mode support
Form Handling React Hook Form + Zod validation

πŸ‘₯ Community Hub

  • Local Chat Rooms - Coordinate with neighbors
  • Resource Sharing - Offer/request supplies
  • Volunteer Network - Connect helpers
  • Admin Dashboard - Manage community

πŸ“š Safety Resources

  • Disaster Guides - Step-by-step protocols
  • Video Tutorials - First aid & safety
  • Offline Access - Critical info without internet
  • Multi-language - Inclusive support

πŸ” Secure Platform

  • Firebase Auth - Google & Email login
  • Role-based Access - User & Admin roles
  • Data Encryption - Secure communications
  • Privacy First - GDPR compliant

πŸ› οΈ Tech Stack

Category Technologies
Frontend Next.js React TypeScript
Styling TailwindCSS Framer shadcn/ui Radix UI
Backend & Database Firebase Firestore Vercel
Maps & Location Leaflet React-Leaflet OpenStreetMap
Weather APIs WeatherAPI OpenWeatherMap
Forms & Validation React Hook Form Zod
State & Hooks React Context Custom Hooks
Analytics Vercel Analytics

Dependencies Overview

Core Framework:     Next.js 15.3, React 18.2, TypeScript 5
UI Components:      shadcn/ui, Radix UI, Lucide Icons, Heroicons
Styling:            TailwindCSS 3.4, Framer Motion, tailwind-merge
Authentication:     Firebase Auth (Email + Google), NextAuth.js
Database:           Firebase Firestore (Real-time)
Maps:               Leaflet, React-Leaflet
Weather:            WeatherAPI.com, OpenWeatherMap
Forms:              React Hook Form, Zod validation
HTTP Client:        Axios
Date Handling:      date-fns
Charts:             Recharts
Utilities:          clsx, class-variance-authority

πŸ“ Project Structure

saviour/
β”œβ”€β”€ πŸ“‚ public/                    # Static assets & safety videos
β”‚   └── πŸ“‚ safety-videos/         # Tutorial videos for safety guides
β”œβ”€β”€ πŸ“‚ src/
β”‚   β”œβ”€β”€ πŸ“‚ app/                   # Next.js App Router
β”‚   β”‚   β”œβ”€β”€ πŸ“„ layout.tsx         # Root layout with providers
β”‚   β”‚   β”œβ”€β”€ πŸ“„ page.tsx           # Landing page (Hero, Features, Contact)
β”‚   β”‚   β”œβ”€β”€ πŸ“„ globals.css        # Global styles
β”‚   β”‚   β”œβ”€β”€ πŸ“„ providers.tsx      # Auth & theme providers
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ api/               # API routes
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“‚ weather/       # Weather API (dual source)
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“‚ weather-widget/# Dashboard weather widget
β”‚   β”‚   β”‚   └── πŸ“‚ send-email/    # Contact form email handler
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ auth/              # Authentication pages
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“‚ login/         # Login page
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“‚ signup/        # Signup page
β”‚   β”‚   β”‚   └── πŸ“‚ error/         # Auth error page
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ dashboard/         # Protected dashboard routes
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ layout.tsx     # Dashboard layout with sidebar
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ page.tsx       # Dashboard overview
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“‚ profile/       # User profile management
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“‚ sos/           # SOS create & manage
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“‚ weather/       # Weather forecasts
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“‚ community/     # City-based chat
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“‚ emergency/     # Emergency contacts
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“‚ navigation/    # SOS map view
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“‚ resources/     # Resource sharing
β”‚   β”‚   β”‚   └── πŸ“‚ safety/        # Safety guides
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ about/             # About page
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ services/          # Services page
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ contact/           # Contact page
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ privacy/           # Privacy policy
β”‚   β”‚   └── πŸ“‚ terms/             # Terms of service
β”‚   β”œβ”€β”€ πŸ“‚ components/
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ Safety/            # 12 disaster-specific safety guides
β”‚   β”‚   β”‚   β”œβ”€β”€ First-Aid-Tutorial.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Flood-Safety.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Earthquake-Safety.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Fire-Safety.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Cyclone-Safety.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Chemical-Safety.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Electrical-Safety.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Lightning-Safety.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Landslide-Safety.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Tsunami-Safety.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Extreme-Cold-Safety.tsx
β”‚   β”‚   β”‚   └── Extreme-Heat-Safety.tsx
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ ui/                # shadcn/ui components
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ weather/           # Weather display components
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ Modals/            # Modal components (SOSEditModal)
β”‚   β”‚   β”œβ”€β”€ πŸ“„ HeroSection.tsx    # Landing hero
β”‚   β”‚   β”œβ”€β”€ πŸ“„ FeatureSection.tsx # Features showcase
β”‚   β”‚   β”œβ”€β”€ πŸ“„ community-chat.tsx # Chat component
β”‚   β”‚   β”œβ”€β”€ πŸ“„ MapWrapper.tsx     # Leaflet map component
β”‚   β”‚   β”œβ”€β”€ πŸ“„ Sidebar.tsx        # Dashboard sidebar
β”‚   β”‚   └── πŸ“„ ...                # Other components
β”‚   β”œβ”€β”€ πŸ“‚ hooks/                 # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ πŸ“„ useUserCity.ts     # User location hook
β”‚   β”‚   β”œβ”€β”€ πŸ“„ use-toast.ts       # Toast notifications
β”‚   β”‚   β”œβ”€β”€ πŸ“„ use-mobile.tsx     # Mobile detection
β”‚   β”‚   └── πŸ“„ useResponsive.ts   # Responsive utilities
β”‚   β”œβ”€β”€ πŸ“‚ lib/                   # Utilities & config
β”‚   β”‚   β”œβ”€β”€ πŸ“„ firebase.ts        # Firebase initialization
β”‚   β”‚   β”œβ”€β”€ πŸ“„ auth-context.tsx   # Auth context provider
β”‚   β”‚   β”œβ”€β”€ πŸ“„ sidebarItems.ts    # Sidebar navigation config
β”‚   β”‚   β”œβ”€β”€ πŸ“„ utils.ts           # Utility functions
β”‚   β”‚   └── πŸ“„ env.ts             # Environment helpers
β”‚   └── πŸ“‚ types/                 # TypeScript definitions
β”‚       └── πŸ“„ user.ts            # User type definitions
β”œβ”€β”€ πŸ“„ middleware.ts              # Next.js middleware
β”œβ”€β”€ πŸ“„ next.config.js             # Next.js configuration
β”œβ”€β”€ πŸ“„ tailwind.config.js         # Tailwind configuration
β”œβ”€β”€ πŸ“„ tsconfig.json              # TypeScript configuration
β”œβ”€β”€ πŸ“„ components.json            # shadcn/ui configuration
└── πŸ“„ package.json               # Dependencies & scripts

πŸš€ Quick Start

Prerequisites

Installation

# 1. Clone the repository
git clone https://github.com/Ravikumar-2016/SaviourWeb.git
cd SaviourWeb/saviour

# 2. Install dependencies
npm install

# 3. Setup environment variables
cp .env.example .env.local
# Edit .env.local with your API keys

# 4. Start development server
npm run dev

# 5. Open in browser
# http://localhost:3000

πŸ”₯ Firebase Setup

πŸ”§ Click to expand Firebase configuration steps

Step 1: Create Firebase Project

  1. Go to Firebase Console
  2. Click "Create a project"
  3. Enter project name (e.g., "saviour-app")
  4. Enable Google Analytics (optional)

Step 2: Enable Authentication

  1. In Firebase Console, go to Authentication > Sign-in method
  2. Enable Email/Password
  3. Enable Google provider
  4. ⚠️ IMPORTANT: Add your domain to Authorized domains:
    • localhost (for development)
    • saviour-web.vercel.app (for production)
    • Your custom domain (if any)

Step 3: Create Firestore Database

  1. Go to Firestore Database > Create database
  2. Start in production mode
  3. Choose a location closest to your users

Step 4: Get Configuration

  1. Go to Project Settings > General
  2. Under "Your apps", click Web icon (</>)
  3. Register app and copy the config values

Step 5: Add to Environment

Copy the Firebase config values to your .env.local file.


πŸ” Environment Variables

Create a .env.local file in the root directory:

# ═══════════════════════════════════════════════════════════
# πŸ”₯ FIREBASE CONFIGURATION (Required)
# ═══════════════════════════════════════════════════════════
NEXT_PUBLIC_FIREBASE_API_KEY=your_firebase_api_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your-project-id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your-project.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=123456789
NEXT_PUBLIC_FIREBASE_APP_ID=1:123456789:web:abcdef123456
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=G-XXXXXXXXXX

# ═══════════════════════════════════════════════════════════
# 🌐 API KEYS (Server-side only - secure)
# ═══════════════════════════════════════════════════════════
WEATHER_API_KEY=your_weatherapi_key        # Primary weather source
OPENWEATHERMAP_API_KEY=your_openweathermap_key  # Fallback weather source
GEMINI_API_KEY=your_gemini_api_key

# ═══════════════════════════════════════════════════════════
# πŸ—ΊοΈ GOOGLE MAPS (Client-side - restrict in Google Console)
# ═══════════════════════════════════════════════════════════
NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=your_google_maps_key

# ═══════════════════════════════════════════════════════════
# πŸ”’ AUTH CONFIGURATION (Required)
# ═══════════════════════════════════════════════════════════
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your_super_secret_key_here
JWT_SECRET=your_jwt_secret_key
BASE_URL=http://localhost:3000

# ═══════════════════════════════════════════════════════════
# πŸ“§ EMAIL CONFIGURATION (Optional - for contact form)
# ═══════════════════════════════════════════════════════════
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASSWORD=your_app_password
SMTP_FROM_EMAIL=noreply@saviour.app
SMTP_FROM_NAME=Saviour Team
CONTACT_RECIPIENT_EMAIL=contact@saviour.app

⚠️ Important: Never commit .env.local to version control!


πŸ“± Screenshots

🏠 Home Page

The main landing page showcasing the disaster management platform with a modern, animated design featuring Hero section, Feature showcase, and Contact form.

πŸ“Š Dashboard Overview

Real-time dashboard with weather widget, quick action buttons (Create SOS, View Map, Resources, Community), safety stats (SOS Raised/Responded), and safety guides.

πŸ†˜ SOS Emergency System

  • Create SOS: 9 emergency types, 3 urgency levels, description, image upload
  • Manage SOS: View, edit, delete your SOS requests with status tracking
  • 5-second cancel: Prevent accidental emergency alerts

πŸ—ΊοΈ Navigation Map

Interactive Leaflet map showing all SOS requests with:

  • Color-coded markers (Red: High, Yellow: Medium, Blue: Low)
  • Emergency type filtering
  • Click-to-view details and respond

🌀️ Weather Center

Comprehensive weather page with:

  • Current conditions (temp, feels like, humidity, wind, UV)
  • 24-hour hourly forecast
  • 5-day daily forecast (combined from WeatherAPI + OpenWeatherMap)

πŸ‘₯ Community Chat

City-based real-time chat with media sharing (images, videos, documents), user avatars, and message history.

πŸ“¦ Resource Management

Three tabs: Available Offers, My Offers, My Requests with 8 resource categories and urgency-based prioritization.

πŸ“ž Emergency Contacts

National emergency numbers (112, 100, 101, 102) + personal emergency contacts with location sharing.

πŸ“š Safety Guides

12 comprehensive safety guides with search, video tutorials, and step-by-step protocols.

πŸ‘€ Profile Management

User profile with location validation (OpenStreetMap Nominatim), photo, and contact information.


πŸ’‘ Tip: Visit our live demo to explore all features in action!


🀝 Contributing

We welcome contributions! Here's how you can help:

# 1. Fork the repository
# 2. Create your feature branch
git checkout -b feature/AmazingFeature

# 3. Make your changes and commit
git commit -m '✨ Add AmazingFeature'

# 4. Push to your branch
git push origin feature/AmazingFeature

# 5. Open a Pull Request

πŸ“ Contribution Guidelines

  • Follow the existing code style
  • Write meaningful commit messages
  • Update documentation as needed
  • Test your changes thoroughly

πŸ“„ License

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

Copyright 2024-2026 Ravikumar & Saviour Team

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

⭐ Star this repository if it helped you!

Built with ❀️ by Ravikumar & the Saviour Team


🌐 Website β€’ πŸ“¦ GitHub β€’ πŸ› Report Bug β€’ πŸ’‘ Request Feature

About

SAVIOUR is a cutting-edge disaster management platform designed to save lives and enhance community resilience during emergencies. By harnessing modern web technologies, it provides real-time emergency coordination, instant alerts and notifications, and location-based resource tracking.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages