Web Services and External Integrations

This document covers the web server infrastructure, external API integrations, and web service architecture of the cryptocurrency trading signals platform. It details how the system exposes HTTP endpoints, communicates with external services like Telegram and Binance, and handles webhook notifications.

For information about the AI agent system that processes user requests through web interfaces, see AI Agent Swarm System. For details about the signal processing pipeline that these web services support, see Signal Processing Pipeline.

The platform uses a Hono-based web server as its primary HTTP service layer, running on port 30050. The server provides REST API endpoints for frontend applications and handles WebSocket connections for real-time communication.

The platform integrates with multiple external services for market data, notifications, and AI processing. Each integration is encapsulated in dedicated service classes that handle authentication, rate limiting, and error recovery.

The web server exposes multiple API endpoints organized by functionality. Each route module handles specific aspects of the trading platform.

Route Purpose Key Endpoints
/health Health monitoring Health check endpoint
/session WebSocket sessions Real-time communication
/status System status Platform status information
/openai AI integration Agent communication endpoints
/info System information Platform metadata
/price Market data Price and market information
/wallet Trading operations Order management, balance
/report Market reports Signal and analysis reports

The platform implements comprehensive error handling through the ErrorService, which captures global exceptions and provides error reporting mechanisms.

Individual services implement specific error handling patterns:

  • Telegram Service: Logs errors with context data and continues operation
  • Webhook Service: Includes retry logic and detailed error logging
  • Signal Processing: Handles tool errors and provides fallback mechanisms

The platform uses Docker for deployment with health checks and environment-based configuration.

The platform uses environment variables for configuration, with prefix-based loading for frontend applications:

  • CC_TELEGRAM_TOKEN - Telegram bot authentication
  • CC_TELEGRAM_CHANNEL - Target Telegram channel
  • CC_WEBHOOK_URL - External webhook endpoint
  • CC_SIGNAL_CHECK_TTL - Signal processing timeout