Skip to content

Latest commit

 

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trading System

Scaffold for a trading system workspace.

Structure

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

Start Services

Copy the example environment file and fill in real secrets locally:

cp .env.example .env

Start PostgreSQL 16 with TimescaleDB and Redis 7:

docker compose up -d

PostgreSQL is exposed on localhost:5432. Redis is exposed on localhost:6379.

Set Up Backend

Install backend dependencies with uv:

cd backend
uv sync

Run database migrations:

uv run alembic upgrade head

Ingest market data for a ticker list:

uv run python -m app.scripts.ingest --tickers JNJ,KO,PG,MMM,WMT

Run the FastAPI backend with uvicorn:

uv run uvicorn app.main:app --reload

Useful local API checks:

curl http://localhost:8000/api/stocks
curl -X POST http://localhost:8000/api/pipeline/run

Swagger UI is available at http://localhost:8000/docs.

Python Research Environment

Create and activate the project virtual environment:

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

On Windows:

.venv\Scripts\activate
pip install -r requirements.txt

Register the virtual environment as a Jupyter kernel:

python -m ipykernel install --user --name trading-system --display-name "Python (trading-system)"

Set Up Frontend

Install frontend dependencies:

cd frontend
npm install

Regenerate API types whenever the FastAPI schema changes:

npm run gen:api

Run the Next.js app:

npm run dev

The frontend runs at http://localhost:3000 and uses NEXT_PUBLIC_API_URL, defaulting to http://localhost:8000.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages