Installation
This guide will help you get Quantum Trader up and running on your local machine using Docker.
Prerequisites
Section titled “Prerequisites”Before you begin, ensure you have the following installed:
- Docker (20.10+) and Docker Compose (2.0+)
- Git for cloning the repository
- Node.js (18+) if you want to run the frontend in development mode
Quick Start
Section titled “Quick Start”-
Clone the repository
Terminal window git clone https://github.com/your-org/quantum-trader.gitcd quantum-trader -
Copy the environment file
Terminal window cp .env.example .env -
Configure environment variables
Edit
.envand add your API keys:Terminal window # Required: At least one data providerPOLYGON_API_KEY=your_polygon_api_key# Optional: Additional providersALPHA_VANTAGE_API_KEY=your_av_key# Database (defaults work for local development)DB_PASSWORD=your_secure_password -
Start all services
Terminal window docker compose up -d -
Verify installation
Check that all containers are running:
Terminal window docker compose psYou should see:
Service Port Status frontend 8500 Running api 8501 Running timescaledb 8502 Running pgadmin 8503 Running -
Access the dashboard
Open http://localhost:8500 in your browser.
Port Configuration
Section titled “Port Configuration”All ports are configurable via environment variables:
| Service | Default Port | Environment Variable |
|---|---|---|
| Frontend (Dashboard) | 8500 | FRONTEND_PORT |
| API (FastAPI) | 8501 | API_PORT |
| TimescaleDB | 8502 | DB_PORT |
| pgAdmin | 8503 | PGADMIN_PORT |
| Adminer | 8504 | ADMINER_PORT |
Data Provider Setup
Section titled “Data Provider Setup”Quantum Trader supports multiple data providers. You need at least one configured.
Polygon.io (Recommended)
Section titled “Polygon.io (Recommended)”- Sign up at polygon.io
- Get your free API key from the dashboard
- Add to
.env:Terminal window POLYGON_API_KEY=your_key_here
Alpha Vantage (Backup)
Section titled “Alpha Vantage (Backup)”- Get a free key at alphavantage.co
- Add to
.env:Terminal window ALPHA_VANTAGE_API_KEY=your_key_here
Database Initialization
Section titled “Database Initialization”The database schema is automatically created on first run. To verify:
# Check API healthcurl http://localhost:8501/health
# Should return: {"status": "healthy", "database": "connected"}Development Mode
Section titled “Development Mode”For frontend development with hot reload:
# Keep backend running in Dockerdocker compose up -d api timescaledb
# Run frontend in dev modecd frontendnpm installnpm run dev# Run everything except frontend in Dockerdocker compose up -d api timescaledb pgadmin
# Frontend with hot reloadcd frontendnpm installnpm run dev
# Backend with auto-reload (optional)cd backendpip install -r requirements.txtuvicorn app.main:app --reload --port 8501Troubleshooting
Section titled “Troubleshooting”Container won’t start
Section titled “Container won’t start”Check logs for the failing service:
docker compose logs apidocker compose logs timescaledbDatabase connection errors
Section titled “Database connection errors”Ensure TimescaleDB is fully initialized before the API starts:
# Restart with fresh containersdocker compose downdocker compose up -d timescaledbsleep 10 # Wait for DB to initializedocker compose up -dPort conflicts
Section titled “Port conflicts”If ports are already in use, modify .env:
FRONTEND_PORT=3000API_PORT=3001DB_PORT=5433Then restart:
docker compose downdocker compose up -dNext Steps
Section titled “Next Steps”- Quick Start - Add your first ticker and run a backtest
- Configuration - All environment variables explained