A full-stack platform for managing options trading strategies, automated bots, backtesting, and live trading with broker integrations (e.g. Schwab) and market data (Polygon).
- About
- Features
- Tech Stack
- Installation
- Usage
- Configuration
- Screenshots
- API Documentation
- Acknowledgements
This project provides an intuitive interface for managing options trading: defining strategies, running backtests, and operating live or demo trading bots. It combines a FastAPI backend with a React frontend, Celery for async tasks, and integrations with market data and brokerage APIs.
Key goals:
- Centralize strategy design, backtesting, and live/demo trading in one place.
- Support multiple brokers and data sources via configurable integrations.
- Offer a clear UI for monitoring bots, accounts, and trading logs.
- Strategy management – Create, edit, and version trading strategies.
- Backtesting – Run historical strategy tests with configurable parameters.
- Trading bots – Deploy and manage automated bots with live or demo accounts.
- Trading accounts – Connect and manage brokerage accounts (e.g. Schwab).
- Trading logs & history – View orders, executions, and task history.
- User auth & OAuth – Authentication with optional Google OAuth and email (EmailJS).
- Market data – Integration with Polygon (and other providers) for quotes and history.
| Category | Technologies |
|---|---|
| Languages | Python, TypeScript |
| Backend | FastAPI, Uvicorn, Celery, Redis (broker) |
| Frontend | React, Vite, Tailwind CSS, Ant Design, Recharts, Lightweight Charts |
| Database | PostgreSQL, SQLAlchemy |
| Tools | Docker (optional), dotenv, OAuth (Google), EmailJS |
# Clone the repository
git clone https://github.com/yourusername/OptionTrading_Platform.git
# Navigate to the project directory
cd OptionTrading_PlatformBackend:
cd backend
python -m venv venv
# On Windows: venv\Scripts\activate
# On macOS/Linux: source venv/bin/activate
pip install -r requirements.txtFrontend:
cd frontend
npm install # or: bun installCelery worker (optional, for async tasks):
cd backend
mkdir logs
celery -A celery_app.celery_app worker --pool=eventlet --concurrency=10 --loglevel=INFO1. Start the backend API:
cd backend
uvicorn main:app --host 0.0.0.0 --port 80002. Start the frontend dev server:
cd frontend
npm run dev # or: bun run dev3. Open in browser:
👉 http://localhost:5173 (frontend)
👉 http://localhost:8000 (API)
👉 http://localhost:8000/docs (Swagger UI)
Create a .env file in the backend directory (see backend/env.example):
DATABASE_URL=postgresql://username:password@localhost:5432/db_name
FRONTEND_URL=http://localhost:5173
DEBUG=true
SECRET_KEY=your-secret-key-change-in-production
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=60
# Email (EmailJS)
EMAILJS_PUBLIC_KEY=
EMAILJS_RRIVATE_KEY=
EMAILJS_RESET_TEMPLATE_ID=
EMAILJS_SERVICE_ID=
# Market data & domain
POLYGON_API_KEY=
DOMAIN=Ensure PostgreSQL is running and the database exists; the app creates tables on startup.
Screenshots are stored in the doc/images folder.
![]() |
![]() |
| Screenshot 1 | Screenshot 2 |
![]() |
![]() |
| Screenshot 3 | Screenshot 4 |
![]() |
![]() |
| Screenshot 5 | Screenshot 6 |
![]() |
|
| Screenshot 7 |
The API is served at /api/v1. Main endpoint groups:
| Method | Endpoint (prefix /api/v1) |
Description |
|---|---|---|
| - | /auth |
Authentication (login, register, OAuth) |
| - | /users |
User profile and management |
| - | /strategies |
Strategy CRUD |
| - | /backtest |
Backtest runs and results |
| - | /bot |
Trading bot configuration and control |
| - | /demo |
Demo account / demo trading |
| - | /live_trade |
Live trading operations |
| - | /schwab |
Schwab brokerage integration |
Interactive docs: http://localhost:8000/docs (Swagger UI).
More detail: see the doc folder and API docs linked there.
- Inspiration or resources used
- Libraries, icons, or tutorials referenced
- Collaborators or contributors
.png)
.png)
.png)
.png)
.png)
.png)
.png)