Skip to content

Installation

This guide will help you get Quantum Trader up and running on your local machine using Docker.

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
  1. Clone the repository

    Terminal window
    git clone https://github.com/your-org/quantum-trader.git
    cd quantum-trader
  2. Copy the environment file

    Terminal window
    cp .env.example .env
  3. Configure environment variables

    Edit .env and add your API keys:

    Terminal window
    # Required: At least one data provider
    POLYGON_API_KEY=your_polygon_api_key
    # Optional: Additional providers
    ALPHA_VANTAGE_API_KEY=your_av_key
    # Database (defaults work for local development)
    DB_PASSWORD=your_secure_password
  4. Start all services

    Terminal window
    docker compose up -d
  5. Verify installation

    Check that all containers are running:

    Terminal window
    docker compose ps

    You should see:

    ServicePortStatus
    frontend8500Running
    api8501Running
    timescaledb8502Running
    pgadmin8503Running
  6. Access the dashboard

    Open http://localhost:8500 in your browser.

All ports are configurable via environment variables:

ServiceDefault PortEnvironment Variable
Frontend (Dashboard)8500FRONTEND_PORT
API (FastAPI)8501API_PORT
TimescaleDB8502DB_PORT
pgAdmin8503PGADMIN_PORT
Adminer8504ADMINER_PORT

Quantum Trader supports multiple data providers. You need at least one configured.

  1. Sign up at polygon.io
  2. Get your free API key from the dashboard
  3. Add to .env:
    Terminal window
    POLYGON_API_KEY=your_key_here
  1. Get a free key at alphavantage.co
  2. Add to .env:
    Terminal window
    ALPHA_VANTAGE_API_KEY=your_key_here

The database schema is automatically created on first run. To verify:

Terminal window
# Check API health
curl http://localhost:8501/health
# Should return: {"status": "healthy", "database": "connected"}

For frontend development with hot reload:

Terminal window
# Keep backend running in Docker
docker compose up -d api timescaledb
# Run frontend in dev mode
cd frontend
npm install
npm run dev

Check logs for the failing service:

Terminal window
docker compose logs api
docker compose logs timescaledb

Ensure TimescaleDB is fully initialized before the API starts:

Terminal window
# Restart with fresh containers
docker compose down
docker compose up -d timescaledb
sleep 10 # Wait for DB to initialize
docker compose up -d

If ports are already in use, modify .env:

Terminal window
FRONTEND_PORT=3000
API_PORT=3001
DB_PORT=5433

Then restart:

Terminal window
docker compose down
docker compose up -d