A real-time alert system that aggregates emergency alerts from various sources and provides location-based search capabilities.
- MongoDB integration for improved vector search capabilities
- Web scraping of emergency services websites
- Automated alert collection from multiple sources
- Local embeddings generation using Transformers.js
- Node.js 18+
- MongoDB 6.0+
- npm or yarn
-
Install MongoDB:
# macOS (using Homebrew) brew tap mongodb/brew brew install mongodb-community -
Create data directory:
mkdir -p data/db
-
Install dependencies:
npm install
-
Set up environment variables: Create a
.env.localfile with the following:MONGODB_URI=mongodb://localhost:27017/alert-system NEXT_PUBLIC_MAPBOX_API_KEY=your_mapbox_key ENABLE_SCRAPER_SCHEDULER=true SCRAPER_SCHEDULE=0 * * * * SCRAPER_API_KEY=your_scraper_key SCHEDULER_API_KEY=your_scheduler_key -
Initialize MongoDB:
npm run init-db
-
If migrating from DataStax:
npm run migrate
-
Start MongoDB:
npm run init-db
-
In a new terminal, start the development server:
npm run dev
-
Start the scraper service:
npm run scrape
The application will be available at http://localhost:3000
- MongoDB for storing alerts and vector embeddings
- Local embedding generation using Transformers.js
- Geospatial indexing for location-based queries
- Automated scraping of emergency services websites
- Configurable sources in
src/lib/scraper.js - Scheduled updates via API endpoint
/api/alerts: CRUD operations for alerts/api/query: Vector similarity search with location awareness/api/scheduler: Controls the web scraper service
- Mapbox API: For map rendering and geocoding services
- MongoDB Atlas: Database and vector search capabilities
- Web Scraping APIs: For automated collection of emergency alerts
- Transformers.js: Local embedding generation for semantic search
- Vector Similarity Search: Powered by MongoDB's vector search capabilities
- Natural Language Processing: Used for processing and understanding alert descriptions
- Semantic Search: Implemented using vector embeddings for intelligent alert querying
- Claude Sonnet assistant when coding
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request