Scaffold for a trading system workspace.
trading-system/
├── backend/ # FastAPI
├── engine/ # Trading engine, separate process
├── shared/ # Shared Python code
├── research/ # Jupyter notebooks
├── frontend/ # Next.js
├── docker-compose.yml
├── .env.example
└── README.md
Copy the example environment file and fill in real secrets locally:
cp .env.example .envStart PostgreSQL 16 with TimescaleDB and Redis 7:
docker compose up -dPostgreSQL is exposed on localhost:5432.
Redis is exposed on localhost:6379.
Install backend dependencies with uv:
cd backend
uv syncRun database migrations:
uv run alembic upgrade headIngest market data for a ticker list:
uv run python -m app.scripts.ingest --tickers JNJ,KO,PG,MMM,WMTRun the FastAPI backend with uvicorn:
uv run uvicorn app.main:app --reloadUseful local API checks:
curl http://localhost:8000/api/stocks
curl -X POST http://localhost:8000/api/pipeline/runSwagger UI is available at http://localhost:8000/docs.
Create and activate the project virtual environment:
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtOn Windows:
.venv\Scripts\activate
pip install -r requirements.txtRegister the virtual environment as a Jupyter kernel:
python -m ipykernel install --user --name trading-system --display-name "Python (trading-system)"Install frontend dependencies:
cd frontend
npm installRegenerate API types whenever the FastAPI schema changes:
npm run gen:apiRun the Next.js app:
npm run devThe frontend runs at http://localhost:3000 and uses NEXT_PUBLIC_API_URL, defaulting to http://localhost:8000.