Full-stack outage-risk prototype for HackAI 2026.
- Frontend: React + Vite dashboard (
src/JSX files) - Backend ingestion: Python data pipeline (
src/Python package)
- EIA grid operations data (demand / generation)
- DOE OE-417 disturbance summaries
- ORNL ODIN real-time outages (county-level)
The ingestion pipeline produces a unified CSV at data/outages_latest.csv.
- Create and activate a virtualenv:
python -m venv .venv
source .venv/bin/activate- Install Python deps:
pip install -r requirements.txt- Add
.envin project root:
EIA_API_KEY=your_eia_api_key_here
DEFAULT_REGION=USApython -m src.pipeline.build_dataset --region "USA" --hours 24 --output data/outages_latest.csvThe backend now supports a strict timestamp-ordered replay consumer for the official feed requirement.
Configuration via environment variables:
OFFICIAL_FEED_SOURCE:csv(default) orapiOFFICIAL_FEED_CSV_PATH: local dataset path (defaultdata/outages_latest.csv)OFFICIAL_FEED_REPLAY_URL: required whenOFFICIAL_FEED_SOURCE=apiOFFICIAL_FEED_CURSOR_PATH: persisted watermark cursor path (defaultbackend/.replay_cursor.json)
Replay endpoints:
GET /feed/replay/status: current cursor and pending docsPOST /feed/replay/nextwith{ "batch_size": N }: consume next N docs in timestamp order and run NLP -> risk -> alertPOST /feed/replay/reset: reset cursor to replay from the start
Example:
curl http://localhost:8000/feed/replay/status
curl -X POST http://localhost:8000/feed/replay/next -H "Content-Type: application/json" -d '{"batch_size": 3}'
curl -X POST http://localhost:8000/feed/replay/resetInstall Node dependencies:
npm installRun dev server:
npm run devBuild production bundle:
npm run build