An interactive platform for understanding how small economic changes cascade into major macroeconomic outcomes.
- Node.js 18+ and npm
- Python 3.10+
- Redis (optional — app works without it, just no caching)
cd backend
pip install -r requirements.txt
uvicorn main:app --reload --port 8000cd frontend
npm install
npm run devdocker-compose up --buildGet a free key at https://fred.stlouisfed.org/docs/api/api_key.html
# backend/.env
FRED_API_KEY=your_key_hereWithout a key the app runs on realistic synthetic baseline data.
shockwave-ai/
shockwave-ai/
├── frontend/ # Vite + React app
│ └── src/
│ ├── components/
│ │ ├── reality/ # Reality mode panels
│ │ ├── simulation/ # Policy levers, graph, timeline
│ │ ├── prediction/ # Risk scores, narratives, SHAP
│ │ └── shared/ # Gauges, cards
│ ├── hooks/ # useRealityData, useSimulation, usePrediction
│ ├── services/ # API client, WebSocket manager
│ ├── engine/ # Client-side sim fallback
│ └── App.jsx
│
└── backend/ # FastAPI server
├── main.py
├── simulation/ # Causal graph propagation engine
├── ml/ # DTW, XGBoost, HMM, scoring
├── data/ # FRED + synthetic data ingestion
├── api/ # Route handlers
└── explainability/ # SHAP + narrative builder
| Method | Path | Description |
|---|---|---|
| GET | /reality/snapshot | Current economic state + risk scores |
| GET | /reality/history | Historical indicator time series |
| POST | /simulate/run | Run ShockWave AI propagation |
| POST | /predict/score | ML risk scoring |
| POST | /predict/explain | SHAP explanation + narrative |
| GET | /crises/library | Historical crisis library |
| WS | /simulate/stream | Real-time step streaming |