How prasanth866/watchtower works
WatchTower serves a browser dashboard for live crypto analysis, threshold alerts, and simulated trading. Users authenticate, then the frontend requests REST data and subscribes to a WebSocket price feed; they can configure alerts or transact against a virtual portfolio. Backend workers collect market data and process alert/email side effects, while PostgreSQL and Redis provide durable and low-latency state. The graph preserves documented chart caching and trading capabilities; unsampled routers and workers are included only where README or source-index evidence supports their role.
Main entry points: App.tsx Dashboard shell · api.ts HTTP and WebSocket client · main.py FastAPI application · database.py PostgreSQL state
Components 25
Dashboard
- Dashboard shell
frontend/src/App.tsx - Authentication UI
frontend/src/components/AuthLayout.tsx - Market analysis
frontend/src/components/CoinAnalysis.tsx - Alert controls
frontend/src/components/TriggerEngine.tsx - Trading terminal
frontend/src/components/TradingTerminal.tsx - Toast notifications
frontend/src/components/ToastProvider.tsx - HTTP and WebSocket client
frontend/src/api.ts
API and Services
- FastAPI application
backend/main.py - Authentication routes
backend/api/auth.py - Coin and chart routes
backend/api/coins_router.py - Trigger routes
backend/api/trigger_router.py - Paper trading routes
backend/api/paper_trading_router.py - Health monitoring
backend/api/health.py - Trigger services
backend/services/trigger_services.py - Authentication service
backend/services/auth_service.py
Market and Alerts
- Market data worker
backend/workers/crypto.py - Price broadcaster
backend/services/broadcaster.py - Event processing
backend/services/event_processing_service.py - Email queue worker
backend/workers/email_worker.py - Email delivery
backend/services/email_service.py
Runtime State
- PostgreSQL state
backend/core/database.py - Redis cache and Pub/Sub
Other components
- Dashboard user
- CoinGecko
- Brevo email API
Connections 35
- Dashboard user → Dashboard shell: uses
frontend/src/App.tsx - Dashboard shell → Authentication UI: shows
frontend/src/App.tsx - Dashboard shell → Market analysis: shows
frontend/src/App.tsx - Dashboard shell → Alert controls: shows
frontend/src/App.tsx - Dashboard shell → Trading terminal: shows
frontend/src/App.tsx - Dashboard shell → HTTP and WebSocket client: connects feed
frontend/src/App.tsx - Authentication UI → HTTP and WebSocket client: calls
frontend/src/components/AuthLayout.tsx - Market analysis → HTTP and WebSocket client: requests data
frontend/src/components/CoinAnalysis.tsx - Alert controls → HTTP and WebSocket client: manages alerts
frontend/src/components/TriggerEngine.tsx - Trading terminal → HTTP and WebSocket client: places trades
frontend/src/components/TradingTerminal.tsx - Dashboard shell → Toast notifications: renders
frontend/src/App.tsx - HTTP and WebSocket client → FastAPI application: HTTP and WS
- FastAPI application → Authentication routes: routes
- FastAPI application → Coin and chart routes: routes
- FastAPI application → Trigger routes: routes
- FastAPI application → Paper trading routes: routes
- FastAPI application → Health monitoring: routes
- Authentication routes → Authentication service: delegates
- Authentication service → PostgreSQL state: reads users
- Trigger routes → Trigger services: delegates
backend/api/trigger_router.py - Trigger services → PostgreSQL state: uses models
backend/services/trigger_services.py - Paper trading routes → PostgreSQL state: uses models
backend/api/paper_trading_router.py - Coin and chart routes → Redis cache and Pub/Sub: caches charts
- Coin and chart routes → CoinGecko: proxies charts
README.md - Market data worker → CoinGecko: collects prices
README.md - Market data worker → Price broadcaster: publishes events
- Price broadcaster → Redis cache and Pub/Sub: uses Pub/Sub
backend/services/broadcaster.py - Price broadcaster → Event processing: dispatches events
backend/services/broadcaster.py - Price broadcaster → HTTP and WebSocket client: streams prices
README.md - Event processing → Trigger services: checks thresholds
- Event processing → Email queue worker: queues alerts
- Email queue worker → Email delivery: sends pending
backend/workers/email_worker.py - Email delivery → PostgreSQL state: reads queue
backend/services/email_service.py - Email delivery → Brevo email API: delivers mail
README.md - Health monitoring → PostgreSQL state: checks database