AI Crisis Navigator automatically monitors global disaster events, analyzes their severity using AI, and provides real-time visualization and recommendations for emergency response teams. The system processes data from NASA EONET, ReliefWeb, and GDACS, then uses Google Gemini AI to generate severity assessments and response guidance.
- Real-time Data Ingestion: Automatically fetches disaster events from NASA EONET API (every 10 minutes)
- AI-Powered Analysis: Uses Google Gemini AI to analyze disasters and assign severity scores (1-10 scale)
- Interactive Map: Leaflet-based map with color-coded markers showing disaster locations and severity
- Live Updates: WebSocket-based real-time synchronization of disasters, statistics, and activities
- Response Recommendations: AI-generated evacuation guidance, resource priorities, and immediate actions
- Activity Feed: Real-time log of system events and disaster updates
- Filtering & Search: Filter disasters by processing status and severity level
- Bulk Processing: Process multiple unanalyzed disasters simultaneously
- Framework: React 18 with TypeScript
- Routing: Wouter for lightweight client-side routing
- State Management: TanStack Query for server state management
- UI Components: Radix UI primitives with shadcn/ui component library
- Styling: Tailwind CSS with custom CSS variables for theming
- Maps: Leaflet for interactive mapping with disaster visualization
- Real-time: WebSocket connection for live data synchronization
- Runtime: Node.js with Express.js server
- Language: TypeScript with ES modules
- API Design: RESTful endpoints with WebSocket support
- Data Ingestion: NASA EONET API, ReliefWeb API, GDACS API
- AI Processing: Google Gemini AI for disaster analysis
- Database: PostgreSQL (Neon) with Drizzle ORM (currently using in-memory storage)
- Frontend Build: Vite for fast development and optimized production builds
- Backend Build: esbuild for server-side bundling
- Development: tsx for TypeScript execution in development
- Database Migrations: Drizzle Kit for schema management
- Node.js 20 or higher
- npm or yarn package manager
- PostgreSQL database (optional, currently using in-memory storage)
- Google Gemini API key
-
Clone the repository
git clone <repository-url> cd CrisisNavigator
-
Install dependencies
npm install
-
Set up environment variables
Create a
.envfile in the root directory with the following variables:# Required GEMINI_API_KEY=your_google_gemini_api_key GOOGLE_API_KEY=your_google_api_key # Alternative to GEMINI_API_KEY # Optional - Database (currently using in-memory storage) DATABASE_URL=postgresql://user:password@host:port/database # Optional - Server Configuration PORT=5000 NODE_ENV=development # Optional - AI Model Configuration GEMINI_MODEL=gemini-2.5-flash-lite # Optional - Data Ingestion DISASTER_MAX_AGE_DAYS=30 ENABLE_RELIEFWEB=1 ENABLE_GDACS=1 RELIEFWEB_DAYS=30 GDACS_DAYS=30 RELIEFWEB_APPNAME=crisis-navigator-demo/0.1
-
Set up database (optional)
If you want to use PostgreSQL instead of in-memory storage:
npm run db:push
Start the development server with hot reload:
npm run devThe application will be available at http://localhost:5000
Build the application for production:
npm run buildStart the production server:
npm startRun TypeScript type checking:
npm run checkGET /api/disasters- Get all disasters (filtered by max age)GET /api/disasters/:id- Get a specific disaster by IDGET /api/stats- Get system statisticsGET /api/activities- Get recent activities (limit query param)POST /api/ingest- Manually trigger NASA data ingestionPOST /api/analyze- Manually trigger AI analysis processingPOST /api/process-all- Bulk process all unanalyzed disasters
Connect to /ws for real-time updates:
stats- System statistics updatesdisasters- Disaster list updatesactivities- Activity feed updates
- Data Ingestion: Periodic fetching from NASA EONET API (every 10 minutes)
- Data Processing: Events are normalized and stored
- AI Analysis: Gemini AI analyzes unprocessed events (every 30 seconds)
- Storage: Processed data and analysis results are persisted
- Real-time Distribution: WebSocket broadcasts updates to connected clients (every 15 seconds)
- Client Rendering: React components display interactive maps and analysis
Disasters are assigned severity scores on a 1-10 scale:
- Low (1-3): Small, localized events with minimal impact
- Medium (4-6): Events with measurable impact but under control
- High (7-10): Major disasters requiring significant response (requires 2+ high-severity criteria)
High-severity criteria include:
- 1+ confirmed fatalities
- 1,000+ people displaced
- Major infrastructure failure
- Emergency declarations with external aid
- Rapid uncontrolled escalation
- Economic loss > $100M USD
*Either GEMINI_API_KEY or GOOGLE_API_KEY must be set.