Skip to content

Architecture

┌─────────────────────────────────────────────────┐
│ Frontend (React + Mantine UI) │
│ Dashboard, Charts, Strategy Builder │
│ Port 8500 │
└────────────────────────┬────────────────────────┘
│ REST API
┌────────────────────────▼────────────────────────┐
│ FastAPI Backend │
│ Strategies, Backtests, Data Collection │
│ Port 8501 │
└──────────┬─────────────────────────┬────────────┘
│ │
┌──────────▼──────────┐ ┌────────▼─────────────┐
│ TimescaleDB │ │ Data Providers │
│ Time-series DB │ │ Polygon, yfinance │
│ Port 8502 │ │ Alpha Vantage │
└─────────────────────┘ └──────────────────────┘

Stack: React, TypeScript, Mantine UI, TanStack Query

Responsibilities:

  • User interface
  • Chart rendering (Lightweight Charts)
  • State management
  • API communication

Stack: FastAPI, Python 3.11+, Pydantic v2

Responsibilities:

  • REST API endpoints
  • Strategy execution
  • Backtesting engine
  • Data collection orchestration

Stack: TimescaleDB (PostgreSQL + time-series extension)

Features:

  • Optimized for OHLCV data
  • Automatic partitioning
  • Compression for old data
  • Fast time-range queries
Data Provider → Backend → TimescaleDB
Frontend → API Request → Load Data → Execute Strategy → Return Results
Frontend (Rule Builder) → API → Store in DB → Available for Backtests
TableDescription
tickersTracked symbols
ohlcv_dataPrice/volume data
strategiesStrategy definitions
backtestsBacktest results
tradesIndividual trades
tasksBackground jobs
  • Hypertables for time-series data
  • Indexes on (symbol, time, interval)
  • Data retention policies
  • Async endpoints
  • Connection pooling
  • Response caching
  • React Query caching
  • Virtualized lists
  • Lazy loading