This guide is for developers who want to run, extend, or contribute to openecon-data.
Use this guide for:
- local setup
- environment configuration
- development workflow
- testing
- deployment references
- contribution process
If you only want to use the product, start with:
- Node.js 18+ and npm 9+
- Python 3.9+
- OpenRouter API key (required)
- FRED and Comtrade API keys (recommended)
Clone and run setup script:
Linux/macOS:
git clone https://github.com/hanlulong/openecon-data.git
cd openecon-data
./scripts/setup.shWindows PowerShell:
git clone https://github.com/hanlulong/openecon-data.git
cd openecon-data
.\scripts\setup.ps1Windows CMD:
git clone https://github.com/hanlulong/openecon-data.git
cd openecon-data
scripts\setup.batCreate .env in repo root and set:
# Required
LLM_PROVIDER=openrouter
LLM_MODEL=openai/gpt-4o-mini
OPENROUTER_API_KEY=sk-or-...
JWT_SECRET=<random-string>
# Recommended
FRED_API_KEY=...
COMTRADE_API_KEY=...
# Optional (Supabase for production-style auth)
SUPABASE_URL=...
SUPABASE_ANON_KEY=...
SUPABASE_SERVICE_KEY=...Notes:
backend/data/indicators.dbis created if missing.backend/data/faiss_indexis created/rebuilt on demand when vector search is enabled.- In development, Supabase is optional (mock auth path is available).
Run both services:
source backend/.venv/bin/activate
npm run devOr run separately:
# Backend
source backend/.venv/bin/activate
npm run dev:backend
# Frontend
npm run dev:frontendDefault URLs:
- Frontend:
http://localhost:5173 - Backend:
http://localhost:3001 - MCP endpoint:
http://localhost:3001/mcp
Hosted endpoint:
https://data.openecon.ai/mcp
Local endpoint:
http://localhost:3001/mcp
Codex:
codex mcp add openecon-data-local --url http://localhost:3001/mcp
codex mcp get openecon-data-localClaude Code:
claude mcp add --transport sse openecon-data-local http://localhost:3001/mcp --scope user
claude mcp get openecon-data-localBackend:
cd backend
source .venv/bin/activate
python -m unittest discover -s backend/testsFrontend:
npm run test --workspace=packages/frontendAdditional references:
openecon-data has:
- FastAPI backend in
backend/ - React + TypeScript frontend in
packages/frontend/ - Provider integrations in
backend/providers/ - Query orchestration and routing in
backend/services/
Detailed references:
Primary references:
Production checklist:
- Generate strong
JWT_SECRET. - Configure
ALLOWED_ORIGINSfor your domain. - Set production auth configuration (Supabase keys).
- Build frontend and run backend with production settings.
- Put HTTPS reverse proxy in front of backend.
- Fork the repository.
- Create a branch:
git checkout -b feature/<name>. - Make changes with tests and docs updates.
- Run relevant test suites.
- Open a pull request to
main.
More details: