A production-ready full-stack AI-powered disaster alert assistant that provides real-time disaster alerts in 8 Indian languages with AI simplification and safety instructions.
- Real-time Disaster Alerts: Fetches live data from USGS (Earthquakes), GDACS (Global Disasters), and INCOIS (Tsunami warnings)
- AI-Powered Simplification: Uses Google Gemini AI to convert complex technical alerts into simple, actionable language
- Multilingual Support: Available in 8 languages - English, Hindi, Marathi, Tamil, Telugu, Kannada, Bengali, Gujarati
- Geolocation-Based Alerts: Shows disasters near user's location
- Safety Instructions: AI-generated step-by-step safety guidance for each disaster type
- PWA Support: Works offline with service worker caching
- Interactive Map: Visual representation of disaster locations using Leaflet
- Scheduled Data Fetching: Automatic alert fetching every 30 minutes using APScheduler
- MongoDB Storage: Persistent storage of alerts with full translations
- Responsive Design: Mobile-first design with Tailwind CSS + ShadCN UI
- Type Safety: Pydantic models for backend validation
- i18n Integration: react-i18next for seamless language switching
ReadyIndia AI/
βββ backend/ # Node.js/Express Backend
β βββ models/ # Data models
β β βββ alert.js # Alert model with disaster types
β β βββ index.js # Model exports
β β βββ safety_step.js # Safety steps model
β βββ routers/ # API route handlers
β β βββ alerts.js # Alert CRUD operations
β β βββ ai.js # AI simplification endpoints
β β βββ languages.js # Language support
β β βββ index.js # Router exports
β βββ services/ # Business logic
β β βββ alert_fetcher.js # External API fetching
β β βββ gemini_client.js # Gemini AI integration
β β βββ index.js # Service exports
β β βββ logger.js # Logging utility
β β βββ translation_service.js # Translation handling
β βββ logs/ # Application logs
β βββ package.json # Node dependencies
β βββ server.js # Express/Node application
β βββ requirements.txt # (Legacy) Python dependencies reference
β
βββ frontend/ # React Frontend
β βββ public/
β β βββ index.html # HTML entry point
β β βββ manifest.json # PWA manifest
β β βββ service-worker.js # Offline caching
β βββ src/
β β βββ components/ # Reusable components
β β β βββ AlertCard.jsx
β β β βββ Footer.jsx
β β β βββ LanguageSwitcher.jsx
β β β βββ MapComponent.jsx
β β β βββ Navbar.jsx
β β β βββ ui/ # ShadCN UI components
β β βββ hooks/ # Custom React hooks
β β β βββ use-toast.js
β β βββ lib/ # Utility functions
β β β βββ utils.js
β β βββ pages/ # Route pages
β β β βββ AlertDetail.jsx
β β β βββ Alerts.jsx
β β β βββ Explain.jsx
β β β βββ Home.jsx
β β β βββ Settings.jsx
β β βββ i18n/ # i18n translation files
β β β βββ en.json
β β β βββ hi.json
β β βββ i18n.js # i18next configuration
β β βββ App.css # Global styles
β β βββ App.js # Main application
β β βββ index.css # Root styles
β β βββ index.js # React entry point
β βββ lingo/ # Lingo.dev translations (auto-generated)
β β βββ en.json
β β βββ hi.json
β β βββ .versions
β βββ plugins/ # Custom webpack plugins
β β βββ health-check/ # Health check plugin
β β βββ visual-edits/ # Visual edits plugin
β βββ craco.config.js # Create React App config
β βββ lingo.config.js # Lingo.dev configuration
β βββ tailwind.config.js # TailwindCSS config
β βββ postcss.config.js # PostCSS config
β βββ jsconfig.json # JavaScript config
β βββ components.json # Component registry
β βββ package.json # Node dependencies
β βββ .env # Environment variables
β βββ .env.local # Local overrides (git ignored)
β βββ README.md # Frontend documentation
β
βββ tests/ # Testing directory
β βββ __init__.py # Test initialization
β
βββ lingo.config.js # Root Lingo.dev configuration
βββ README.md # Project documentation
βββ package.json # Root package (if monorepo)
βββ .gitignore # Git ignore rules
- Node.js 22: JavaScript runtime
- Express.js: Fast, minimal web framework
- MongoDB: NoSQL database
- Google Gemini AI: Text simplification and translation
- APScheduler: Scheduled task execution (Node version)
- Axios: HTTP client for API calls
- Dotenv: Environment variable management
- React 19: UI library with hooks
- React Router: Client-side routing
- TailwindCSS: Utility-first CSS framework
- ShadCN UI: Beautiful component library
- Lingo.dev: AI-powered automatic multilingual translation
- Leaflet: Interactive maps
- Axios: HTTP client
- Sonner: Toast notifications
GET /api/alerts- Get all alerts (with filters)GET /api/alerts/{id}- Get specific alertGET /api/alerts/nearby- Get alerts near locationPOST /api/alerts- Create new alert
POST /api/ai/simplify- Simplify disaster alert text
GET /api/languages/{lang}- Get translations for languageGET /api/languages- Get all supported languages
-
USGS Earthquake Feed
- Real-time earthquake data
- Global coverage
- Magnitude, location, time information
-
GDACS (Global Disaster Alert and Coordination System)
- Multiple disaster types (floods, cyclones, earthquakes)
- RSS feed format
- Global disaster monitoring
-
INCOIS (Indian National Centre for Ocean Information Services)
- Tsunami warnings
- Seismic activity data
- Indian Ocean region focus
The application is designed for deployment on your preferred platform.
Both frontend and backend can be deployed as services:
- Backend: FastAPI on port 5000 (or configurable)
- Frontend: React on port 3000 (or configurable)
Backend (.env):
MONGO_URL=mongodb://localhost:27017
DB_NAME=readyindia_db
CORS_ORIGINS=*
GEMINI_API_KEY=<your-gemini-api-key>
USGS_API_URL=https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_day.geojson
INCOIS_API_URL=https://www.incois.gov.in/geoportal/webservices/seismology/seismology.json
GDACS_API_URL=https://www.gdacs.org/xml/rss.xmlFrontend (.env):
REACT_APP_BACKEND_URL=http://localhost:5000
GOOGLE_API_KEY=<your-google-api-key># Gemini AI converts complex alerts to simple language
result = await gemini_client.simplify_alert(alert_text)
# Returns: { "simple": "...", "steps": [...] }# Automatic translation to 7 Indian languages
translations = await translation_service.translate_to_all_languages(text)
# Returns: { "hi": "...", "mr": "...", "ta": "...", ... }# Runs every 30 minutes
scheduler.add_job(fetch_and_process_alerts, 'interval', minutes=30)- Service worker caches static assets
- Offline fallback page
- Installable on mobile devices
- Manifest.json for app metadata
// Get alerts within radius
GET /api/alerts/nearby?lat=20.5937&lon=78.9629&radius_km=500- Primary: Orange (#ea580c) - Urgency and safety
- Secondary: Red (#dc2626) - Critical alerts
- Success: Green (#16a34a) - Safety instructions
- Neutral: Gray shades for text and backgrounds
- Headings: Playfair Display (serif) - Elegance and authority
- Body: Inter (sans-serif) - Readability and modernity
- Built with ShadCN UI for consistency
- Fully accessible with ARIA labels
- Responsive breakpoints (mobile, tablet, desktop)
- Hero section with tagline
- Feature cards
- Call-to-action buttons
- Interactive map with markers
- Filter by disaster type and severity
- Nearby alerts based on geolocation
- Grid of alert cards
- Full alert information
- AI-simplified summary
- Step-by-step safety instructions
- Location map
- Text input for custom alerts
- AI simplification
- Multi-language tabs
- Safety steps generation
- Language selection
- Location preferences
- Notification settings (planned)
- About information
- Environment variables for sensitive data
- CORS configuration
- Input validation with Pydantic
- No hardcoded credentials
- Async/await throughout backend
- MongoDB indexing on query fields
- Caching of translations
- Lazy loading of map components
- Optimized images and assets
- Unit tests for models and services
- Integration tests for API endpoints
- Mock external API calls
- Test data validation
- Component testing with data-testid attributes
- E2E testing with Playwright
- Responsive design testing
- Accessibility testing
{
id: string,
type: "earthquake" | "flood" | "cyclone" | ...,
severity: "low" | "medium" | "high" | "critical",
raw_text: string,
ai_summary: string,
ai_steps: string[],
languages: {
hi: { simple: string, steps: string[] },
mr: { ... },
// ... other languages
},
location: string,
latitude: float,
longitude: float,
magnitude: float (optional),
source: "USGS" | "GDACS" | "INCOIS",
created_at: datetime
}- Push Notifications: Real-time browser notifications for critical alerts
- User Accounts: Personalized alert preferences
- Alert History: Track past disasters and responses
- Community Reports: User-submitted disaster reports
- SMS Integration: Send alerts via SMS for offline users
- Voice Alerts: Audio announcements in regional languages
- Evacuation Routes: AI-suggested safe routes
- Emergency Contacts: Quick access to helpline numbers
This project is built as a demonstration of full-stack development capabilities and disaster management solutions.
- USGS for earthquake data
- GDACS for global disaster alerts
- INCOIS for tsunami warnings
- Google Gemini for AI capabilities
- Lingo.dev for automatic multilingual translation
Built with β€οΈ for India's safety and preparedness