How mbta/ride_along works
Main System Components
a) Web Layer:
• Phoenix web framework (indicated by Phoenix endpoints and controllers)
• LiveView components for real-time updates
• API endpoints for trip information
• Authentication system
b) Core Services:
• ETA Calculator with ML Component (XGBoost model)
• MQTT Communication System
• Route Service Integration
• Rider Notification System
• SQL Processing Pipeline
c) External Services:
• ActiveMQ (Message Queue)
• OpenRouteService (for routing)
• Webhook System (for rider notifications)
Component Relationships
a) Data Flow:
• Vehicle location updates → MQTT → ETA Calculator
• ETA Calculator → Route Cache → Web Layer
• SQL Parser → Publisher → Message Queue
• Message Queue → MQTT Listener → Internal Services
b) Service Dependencies:
• ETA Calculator ↔ XGBoost Model
• Web Layer ↔ Authentication
• Route Cache ↔ OpenRouteService
Additional Elements
Include:
• System boundaries
• Load balancer (if applicable)
• Monitoring components (telemetry)
• Cache layers
• Security boundaries
Specific Implementation Notes
• Real-time nature of the system (LiveView + MQTT)
• ML integration for ETA prediction
• Caching strategy for routes
• Message queue-based architecture
• Authentication flow
• API endpoints structure
Remember to:
• Use consistent symbols
• Notes for critical components
• Scaling points
• Failure recovery paths