How etrobot/open-alpha-arena works
Project type and purpose
• This is a full-stack web application (“Open Alpha Arena”) that lets users configure and run AI-driven crypto trading bots.
• Frontend: A React+TypeScript SPA (Vite) that communicates over REST and WebSockets.
• Backend: A Python 3.10+ FastAPI service with multiple domain services (market data ingestion, AI decisioning, order scheduling/execution), a database layer, and external integrations (CCXT, OpenAI).
File structure
• Top-level:
• backend/ – FastAPI app (“main.py”), subdivided into api/, services/, repositories/, database/, schemas/, factors/, config/
• frontend/ – Vite React app (components/, lib/, main.tsx, index.html, config files)
• docker-compose.yml + Dockerfile + monorepo package.json/pnpm-workspace.yaml
• Patterns:
• MVC-ish: api/routes → services → repositories → database models
• Domain services: auto_trader, order_scheduler, ai_decision_service
• Repos abstract DB ops; SQLAlchemy or similar in backend/database/*
• WebSocket endpoint (“/ws”) for streaming updates, plus REST routes for CRUD and trading commands
Extract additional insights from README
• Dev servers: backend on 5611, frontend on 5621
• Backend uses Uvicorn (ASGI) with no special build step
• Dependencies: CCXT for market data, OpenAI API, FastAPI, uv (for sync with Python venv), pnpm for JS
Detail without over-splitting
• Major services (market_data, ai_decision, order_matching, scheduler).
• WebSocket gateway as a first-class element.
• Cron/scheduler triggers as timed events into services.