Add FastAPI backend for energy trading system

Implements FastAPI backend with ML model support for energy trading,
including price prediction models and RL-based battery trading policy.
Features dashboard, trading, backtest, and settings API routes with
WebSocket support for real-time updates.
This commit is contained in:
2026-02-12 00:59:26 +07:00
parent a22a13f6f4
commit fe76bc7629
72 changed files with 2931 additions and 0 deletions

24
backend/.env.example Normal file
View File

@@ -0,0 +1,24 @@
APP_NAME=Energy Trading API
APP_VERSION=1.0.0
DEBUG=true
HOST=0.0.0.0
PORT=8000
DATA_PATH=~/energy-test-data/data/processed
CORS_ORIGINS=http://localhost:3000,http://localhost:5173
WS_HEARTBEAT_INTERVAL=30
CELERY_BROKER_URL=redis://localhost:6379/0
CELERY_RESULT_BACKEND=redis://localhost:6379/0
MODELS_PATH=models
RESULTS_PATH=results
BATTERY_MIN_RESERVE=0.10
BATTERY_MAX_CHARGE=0.90
ARBITRAGE_MIN_SPREAD=5.0
MINING_MARGIN_THRESHOLD=5.0