- Add cleanup-chromium.sh script for manual zombie process cleanup
- Add docker-entrypoint.sh with signal handlers for graceful shutdown
- Add lib/process-cleanup.ts for automatic cleanup on app termination
- Enhanced forceCleanup() method in tradingview-automation.ts:
- Individual page closing before browser termination
- Force kill remaining processes with SIGKILL
- Reset operation locks after cleanup
- Improved browser launch args to prevent zombie processes:
- Better crash reporter handling
- Enhanced background process management
- Removed problematic --single-process flag
- Updated Dockerfile to use new entrypoint with cleanup handlers
- Set DOCKER_ENV environment variable for container detection
- Add proper signal handling (SIGINT, SIGTERM, SIGQUIT)
- Automatic cleanup of temporary Puppeteer profiles
Resolves zombie Chromium process accumulation issue
- Add comprehensive debug logging to checkLoginStatus Strategy 1
- Enhanced authentication variable detection with detailed console output
- Added debug logging for window.is_authenticated and window.user checks
- Improved error visibility for authentication detection issues
- Added health API endpoint for debugging and monitoring
- Enhanced Dockerfile with better caching and debugging capabilities
Authentication detection now shows detailed logs when checking:
- window.is_authenticated variable presence and value
- window.user object detection and structure
- Helps identify why auth detection sees user data but doesn't return true
- Fix TypeScript errors in enhanced-screenshot.ts and tradingview-automation.ts
- Add proper type assertions for page.screenshot() path parameter
- Ensure compatibility with strict TypeScript compilation
- Verify Docker Compose V2 deployment working on port 9000
- Application successfully containerized and production-ready
- All build processes pass without TypeScript errors
Ready for easy deployment on any machine with Docker & Docker Compose V2
✨ Features Added:
- Real-time event subscription using Drift SDK EventSubscriber
- Periodic fallback monitoring for position changes
- Interactive UI controls for starting/stopping monitoring
- Comprehensive data source status tracking
- Multi-source trade aggregation and deduplication
🔧 Backend Implementation:
- EventSubscriber integration with OrderActionRecord events
- Fallback to periodic monitoring (30s intervals) if events fail
- Real-time trade cache management (last 100 trades)
- Enhanced data availability status with monitoring state
- Improved trade history from 5+ different API sources
🎨 Frontend Enhancements:
- Live monitoring toggle button (🔴 Start Live / 🟢 Live)
- Real-time status panel showing active monitoring state
- Trade counter and last activity timestamps
- Clear cache functionality for real-time trades
- Enhanced status modal with monitoring details
🔗 API Endpoints:
- POST /api/drift/realtime-monitoring - Control monitoring
- GET /api/drift/realtime-monitoring - Check status
- GET /api/drift/data-status - Enhanced with monitoring state
🐳 Docker Integration:
- Updated container configuration for persistent monitoring
- Environment variable support for real-time features
- Database persistence for captured trades
💾 Database & Storage:
- Automatic storage of real-time detected trades
- Deduplication logic to prevent synthetic/duplicate trades
- Persistent cache across container restarts
🚀 Usage:
- Click 'Start Live' button in Trading History panel
- Monitor will attempt EventSubscriber, fallback to periodic checks
- All future trades automatically captured and stored
- Status panel shows monitoring state and trade statistics
This implements comprehensive real-time trading monitoring for Drift Protocol with robust fallback mechanisms and professional UI integration.
- Add settings manager to persist symbol, timeframe, and layouts
- Support multiple layouts for comprehensive chart analysis
- Remove debug screenshots for cleaner logs
- Update AI analysis with professional trading prompt
- Add multi-screenshot analysis for better trading insights
- Update analyze API to use saved settings and multiple layouts