Skip to content

About

Paper-first NSE/BSE algorithmic trading platform (FastAPI + Flutter)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

AutoTradeX

AutoTradeX

Paper-first algorithmic trading desk for Indian retail equities (NSE / BSE).
JWT auth · broker adapters · RSI/EMA backtests · paper execution · risk gates · kill-switch

stack fastapi flutter paper ci


Tech stack

Layer Technology Role
API Python 3.12 · FastAPI · Uvicorn Auth, strategies, backtest, orders, risk
ORM / migrations SQLAlchemy 2 · Alembic Schema + multi-tenant models
Database PostgreSQL + TimescaleDB (SQLite local fallback) Relational + ohlc_1m bars
Cache Redis (optional) Sessions / marks — degrades gracefully
Client Flutter (Windows · Web · Mobile) Desk UI: dashboard, strategies, backtest, orders
Brokers Zerodha Kite · Angel One SmartAPI · MOCK Adapter protocol; MOCK for local paper
Infra Docker Compose Postgres/Timescale + Redis + API
CI / Release GitHub Actions Tests on push · Releases + notes on version tags
┌─────────────┐     JWT      ┌──────────────────┐     adapters     ┌────────────┐
│  Flutter    │ ───────────► │  FastAPI /api/v1 │ ───────────────► │ Zerodha /  │
│  desk UI    │ ◄─────────── │  risk · paper    │ ◄─────────────── │ Angel/MOCK │
└─────────────┘   JSON/SSE   └────────┬─────────┘                  └────────────┘
                                      │
                          ┌───────────┴───────────┐
                          │ Postgres/Timescale    │
                          │ (+ Redis optional)    │
                          └───────────────────────┘

Quick start

Backend

cd backend
py -3 -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -r requirements.txt
copy ..\.env.example .env
python -m app.scripts.seed_data
python -m uvicorn app.main:app --reload --port 8000

After activation use python, not py -3 — the Windows launcher skips the venv.

Flutter client

cd frontend
flutter pub get
flutter run -d windows --dart-define=API_BASE=http://127.0.0.1:8000

Docker

copy .env.example .env
docker compose up --build

Product flow

  1. Register / login → JWT
  2. Connect MOCK broker (auto on Flutter register)
  3. Seed OHLC → run RSI / EMA backtest
  4. Create & start PAPER strategy (TP / SL)
  5. Place paper orders · hit kill-switch when needed

LIVE stays off until LIVE_TRADING_ENABLED=true and real broker keys are set.


Releases (automatic on push)

Every push to master / main (except commits marked [skip release]) will:

  1. Bump the patch version in VERSION + Flutter pubspec.yaml
  2. Tag vX.Y.Z and push it
  3. Build Android APK + Windows ZIP (EXE bundle)
  4. Publish a GitHub Release with auto-generated notes + installers
  5. Update backend/app/data/client_release.json so older apps see a mandatory update

Set repository variable API_BASE (Settings → Variables) to your production API URL so release builds point at the right backend. Set GITHUB_REPO=owner/AutoTradeX in .env so the API can also resolve latest assets from GitHub.

Mandatory update

Flutter calls GET /api/v1/app/update?client_version=… on launch. If the installed build is behind latest_version, the UI blocks with download buttons for APK / Windows ZIP until the user upgrades.

Local tip: keep client_release.json latest_version equal to the running app (0.1.0) so force-update does not fire during development. Set FORCE_CLIENT_UPDATE=false to disable the gate entirely.


Tests

cd backend
python -m pytest -q

Docs


Built paper-first. Real capital only after risk, compliance, and broker readiness.

About

Paper-first NSE/BSE algorithmic trading platform (FastAPI + Flutter)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages