How tomwyr/lol-champion-rotation-mobile works
Main Components
• Mobile Frontend (Flutter UI):
• Represented in the “lib/ui” directory. This includes various screens such as the champion rotation page, details page, notifications, search, settings, etc.
• Business Logic & State Management:
• Found in “lib/core” (models, state, stores) and “lib/dependencies”. This layer handles the app’s state via various “stores” (for app state, champion details, rotations, etc.) and enforces business rules.
• Using a pattern visual cue (e.g., MVC/MVVM-like separation) to emphasize its role.
• Data & Service Layer:
• In “lib/data” you have API client code and various “services” (authentication, FCM, permissions, app store service). This layer is responsible for communicating with external services, likely including the related backend service.
• How this layer interfaces with the business logic to update state and supply data.
• Assets & Resources:
• Includes the “assets” folder (images) and platform resource configurations (Android’s resources and iOS’ Assets, storyboards).
• Platform Specific Layers:
• Android and iOS directories encapsulate native configuration and build scripts. They are the entry points for native build and deployment.
• CI/CD Pipelines:
• The “.github/workflows” directory with deployment workflows (deploy-android.yml and deploy-ios.yml) indicates that deployments for both platforms are automated and integrated with the main codebase.
Relationships and Interactions
• The UI layer interacts with the Business Logic layer (the “stores” and “state” modules) by triggering events and observing changes.
• The Business Logic layer communicates with the Data & Service layer to fetch champion rotations, notifications, and other data; this service layer in turn may communicate with a backend through REST APIs.
• Assets (graphics and configurations) are used by both UI and native modules.
• Platform-specific code in the Android and iOS directories encapsulates the native entry points while calling into the Flutter portions of the app.
• CI/CD pipelines trigger build, test, and deployment processes for both platforms.
Important Architectural Patterns
• State Management and Observer Pattern:
• The use of “stores” in the lib/core/stores and the well-organized UI components suggests an architecture where UI elements subscribe to state updates.
• Separation of Concerns:
• Clear division between UI presentation (lib/ui), business logic (lib/core), and data access (lib/data) promotes a modular and maintainable design.
• Platform Abstraction:
• Utilizing Flutter allows the core logic and UI to be code-shared while still providing native build/configuration (Android and iOS directories).
• Dependency Injection:
• The “lib/dependencies” folder may point to patterns where services are centrally registered and injected where needed.
• “Mobile Frontend (Flutter)”, “Business Logic & State Management”, “Data & Service Layer”, “Native Platform Integrations (Android / iOS)”, “CI/CD and Deployment Pipelines”, and “External Services (Backend API)”.
• User actions flowing from the UI to the State layer.
• Asynchronous API calls from the Business Logic to the Data services.
• Configuration flow from the CI/CD pipelines to the mobile build pipelines.
• Use annotations to highlight key technologies or frameworks:
• Mention Flutter/Dart, usage of Firebase Cloud Messaging (FCM), and any dependency injection patterns indicated by the “dependencies” folder.