How rizaadi/valorantlab works
Project Overview & Main Components
• Following key components:
• Flutter Frontend: The Flutter application that includes the main entry point (lib/main.dart, lib/app.dart) and utilizes flavor files (lib/main_dev.dart, lib/flavors.dart) to manage different environments.
• Feature Modules: Notably, features are split into different sub-projects (e.g., features/agent and features/home). Each of these follows a layered structure (presentation, domain, data) per Clean Architecture.
• Core and Shared Libraries: The project includes centralized components in packages/core (constants, dependency injection with Get It, routes, styles, network, utilities) and shared modules (dependencies and i18n) that are consumed across features.
• Platform-Specific Code: Android and iOS directories contain native project configurations, build scripts, and resource files.
• Dependency Management & Automation: Tools like Melos (project bootstrap/multi-package management), Commitlint, Husky, and flavor management (Flutter Flavorizr) which are integral to the build and release process.
Layers & Relationships (Clean Architecture)
• Presentation Layer:
• Represents the UI components (screens and widgets).
• Located under each feature’s presentation folder (features/agent/lib/presentation/ and features/home/lib/presentation).
• Managed using Bloc State Management, with blocs (agent_bloc, agent_detail_bloc) coordinating user events and UI state.
• Domain Layer:
• Contains business logic (usecases, entities, and repository interfaces) for each feature.
• For example, in features/agent/lib/domain, you have usecases (get_agent_detail_usecase, get_agents_usecase) and entity definitions.
• Data Layer:
• Manages data sourcing and mapping. It is split into remote (HTTP-related API calls) and local data sources (using Isar Database).
• Includes mappers to convert between raw JSON, domain objects, and local storage models.
• The repositories (feature-specific implementations) link to the domain layer.
• Core/Shared Modules:
• These include global configurations, dependency injection (service locator pattern with Get It), network utilities, and style constants. They facilitate shared concerns across the presentation, domain, and data layers.
Architectural Patterns & Design Principles
• Clean Architecture: Ensuring separation of concerns between UI, business logic, and data.
• Modularization: Each feature (e.g., Agent, Home) is self-contained and managed separately, promoting independent development and testing.
• Dependency Injection: Using Get It and DI modules within packages/core to inject dependencies throughout the app.
• State Management: Utilizing Bloc to handle the state between UI and business logic.
• Platform Separation: Dividing configuration and resources between Android and iOS.