How mbta/mobile_app works
High-Level Architecture (Top Layer)
• Three main components in a horizontal layout:
• iOS App (left)
• Shared KMM Module (center)
• Android App (right)
Core Components (Middle Layer)
a. Data Layer:
• Repositories (shared/repositories/)
• Network Clients (network/)
• Phoenix Channels (phoenix/)
• Cache System (cache/)
• Local Storage (DataStore)
b. Business Logic Layer:
• Use Cases (usecases/)
• Model Objects (model/)
• Dependency Injection (dependencyInjection/)
c. Infrastructure:
• MapBox Integration
• Custom Layer Generators (map/style/)
• Route/Stop Features Builders
Platform-Specific Implementations (Bottom Layer)
Split into two sections:
iOS Side:
• SwiftUI Views (iosApp/Pages/)
• ViewModels
• Native MapBox Bridge
• Analytics Integration
Android Side:
• Compose UI Components (androidApp/component/)
• ViewModels
• Native MapBox Bridge
• Analytics Integration
External Services (Side Panel)
Connections to:
• MBTA Backend API
• Mapbox Services
• Sentry Error Logging
• Firebase App Check
• Phoenix Channels (WebSocket)
• Real-time data flow (WebSocket connections)
• REST API calls
• Internal communication between layers
• Platform-specific bridge communications
Key Components to Highlight
• Real-time transit updates system
• Rendering pipeline
• Multi-language support
• Error handling and monitoring
• Location services integration
• Route/Stop data management
Security Layer
• Firebase App Check integration
• Mapbox key management
• API authentication
State Management
• Repository pattern implementation
• Shared state handling between platforms
• Cache management
Real-time Features
• Phoenix WebSocket channels
• Vehicle tracking
• Service alerts
• Predictions
Error Handling
• Sentry integration
• Error banner system
• Network connectivity monitoring
Use these visual conventions:
• Clear labels for all components and connections