debugging web ui

This commit is contained in:
Dobromir Popov
2025-08-05 15:58:51 +03:00
parent 622d059aae
commit bf4d43f6f7
8 changed files with 571 additions and 58 deletions

View File

@ -2,6 +2,55 @@
COBY (Cryptocurrency Order Book Yielder) is a comprehensive data collection and aggregation subsystem designed to serve as the foundational data layer for trading systems. It collects real-time order book and OHLCV data from multiple cryptocurrency exchanges, aggregates it into standardized formats, and provides both live data feeds and historical replay capabilities.
## Kickstart
🌐 Web Dashboard Access:
URL: http://localhost:8080/ (same port as the API)
The FastAPI application serves both:
API endpoints at http://localhost:8080/api/...
Web dashboard at http://localhost:8080/ (root path)
📁 Dashboard Files:
The dashboard is served from static files located at:
HTML: COBY/web/static/index.html
Static assets: COBY/web/static/ directory
🔧 How it's configured:
In COBY/api/rest_api.py, the FastAPI app mounts static files:
# Mount static files for web dashboard (since we removed nginx)
static_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), "web", "static")
if os.path.exists(static_path):
app.mount("/static", StaticFiles(directory=static_path), name="static")
# Serve index.html at root for dashboard
app.mount("/", StaticFiles(directory=static_path, html=True), name="dashboard")
🚀 To access the dashboard:
Start the application: python COBY/main.py --debug
Open browser: Navigate to http://localhost:8080/
API health check: http://localhost:8080/health
📊 Dashboard Features:
The dashboard (COBY/web/static/index.html) includes:
System status monitoring
Exchange connection status
Performance metrics (CPU, memory, throughput, latency)
Real-time updates via WebSocket
Responsive design
🔌 WebSocket Connection:
The dashboard connects to WebSocket on port 8081 for real-time updates:
WebSocket URL: ws://localhost:8081/dashboard
So to summarize:
Web Dashboard: http://localhost:8080/
API: http://localhost:8080/api/...
WebSocket: ws://localhost:8081/
## 🏗️ Architecture
The system follows a modular architecture with clear separation of concerns: