Skip to content

Getting Started

This guide walks you through setting up the QGTM.AI trading platform for local development in under 15 minutes.

Prerequisites

Tool Version Install
Python 3.12+ python.org or brew install python@3.12
uv latest curl -LsSf https://astral.sh/uv/install.sh \| sh
Docker 24+ docker.com
Git 2.40+ brew install git
Node.js 20+ brew install node (for the web terminal)

1. Clone and Install

git clone https://github.com/QGTMAI/trading.git
cd trading

Create and activate the virtual environment:

uv venv
source .venv/bin/activate
uv pip install -e ".[dev]"

2. Configure Environment

cp .env.example .env

Edit .env and fill in at minimum:

  • ALPACA_API_KEY / ALPACA_SECRET_KEY — get paper keys at alpaca.markets
  • DATABASE_URL — defaults to local SQLite for dev, PostgreSQL for production
  • REDIS_URL — optional for local dev, required for production

3. Start Infrastructure

docker compose -f infra/compose/docker-compose.yml up -d

This starts PostgreSQL, Redis, and any other dependent services.

4. Run Tests

pytest

All 1400+ tests should pass. If any fail, check that Docker services are running and .env is configured.

5. Start the Platform

Start the API server:

uvicorn qgtm_api.main:app --reload --port 8000

The API docs are available at http://localhost:8000/docs (Swagger UI).

6. Verify

curl http://localhost:8000/api/v1/universe | python -m json.tool

You should see the full list of 42 commodity ETFs in the trading universe.

Next Steps