- π About
- β¨ Features
- ποΈ Architecture & Flow
- π οΈ Tech Stack
- π Project Structure
- π Quick Start
- π₯ Firebase Setup
- π Environment Variables
- π± Screenshots
- π€ Contributing
- π License
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.
"When disaster strikes, every second counts. SAVIOUR connects communities, coordinates resources, and saves lives through technology."
|
|
|
|
|
|
|
|
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 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 β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| 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 |
- Local Chat Rooms - Coordinate with neighbors
- Resource Sharing - Offer/request supplies
- Volunteer Network - Connect helpers
- Admin Dashboard - Manage community
- Disaster Guides - Step-by-step protocols
- Video Tutorials - First aid & safety
- Offline Access - Critical info without internet
- Multi-language - Inclusive support
- Firebase Auth - Google & Email login
- Role-based Access - User & Admin roles
- Data Encryption - Secure communications
- Privacy First - GDPR compliant
| Category | Technologies |
|---|---|
| Frontend | |
| Styling | |
| Backend & Database | |
| Maps & Location | |
| Weather APIs | |
| Forms & Validation | |
| State & Hooks | |
| Analytics |
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
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
- Node.js v18+ (Download)
- npm or yarn or pnpm
- Firebase Account (Create Free)
# 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π§ Click to expand Firebase configuration steps
- Go to Firebase Console
- Click "Create a project"
- Enter project name (e.g., "saviour-app")
- Enable Google Analytics (optional)
- In Firebase Console, go to Authentication > Sign-in method
- Enable Email/Password
- Enable Google provider
β οΈ IMPORTANT: Add your domain to Authorized domains:localhost(for development)saviour-web.vercel.app(for production)- Your custom domain (if any)
- Go to Firestore Database > Create database
- Start in production mode
- Choose a location closest to your users
- Go to Project Settings > General
- Under "Your apps", click Web icon (
</>) - Register app and copy the config values
Copy the Firebase config values to your .env.local file.
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.localto version control!
The main landing page showcasing the disaster management platform with a modern, animated design featuring Hero section, Feature showcase, and Contact form.
Real-time dashboard with weather widget, quick action buttons (Create SOS, View Map, Resources, Community), safety stats (SOS Raised/Responded), and safety guides.
- 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
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
Comprehensive weather page with:
- Current conditions (temp, feels like, humidity, wind, UV)
- 24-hour hourly forecast
- 5-day daily forecast (combined from WeatherAPI + OpenWeatherMap)
City-based real-time chat with media sharing (images, videos, documents), user avatars, and message history.
Three tabs: Available Offers, My Offers, My Requests with 8 resource categories and urgency-based prioritization.
National emergency numbers (112, 100, 101, 102) + personal emergency contacts with location sharing.
12 comprehensive safety guides with search, video tutorials, and step-by-step protocols.
User profile with location validation (OpenStreetMap Nominatim), photo, and contact information.
π‘ Tip: Visit our live demo to explore all features in action!
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- Follow the existing code style
- Write meaningful commit messages
- Update documentation as needed
- Test your changes thoroughly
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