How albinpk/tasque works
Main Components
• Mobile Application UI: Illustrate the Flutter front-end that includes screens such as the Dashboard, Task List, Task Details, and Authentication screens.
• State Management: Include the Bloc (Cubit) layer managing reactive state changes.
• Data Layer (Repositories):
• Local Database Component: ObjectBox used for local persistent storage.
• Remote Data Source: Firebase Firestore syncing tasks in real time.
• Repository Abstractions: Separate modules such as task_repository.dart and task_sync_repository.dart backed by the repository pattern.
• Core Utilities: Highlight common utilities (themes, routing, notifications, logger) present under the “core” module.
• Feature Modules: Identify the separate feature directories (e.g., “src/features/auth” and “src/features/task”) that encapsulate domain-specific business logic and UI.
• External Services: Firebase Authentication and Google Sign-In for user authentication.
• Navigation: The “GoRouter” navigation arrangement, with a centralized control in routes.dart.
Relationships and Data Flow
• User Interactions on the UI trigger actions handled by the Cubit (business logic) layer.
• The Cubit interacts with repository classes in the data layer, which abstract access to both the local ObjectBox database and Firebase Firestore.
• The repositories also handle synchronization between local and remote data sources.
• External services (Firebase Auth, Google Sign-In, and Firestore) are shown connecting with the repository layer for authentication and real-time data synchronization.
• The core utilities (routing, themes, and notifications) serve as shared services used across different features.
Architectural Patterns and Important Design Principles
• Feature-based Modularity: The project is divided into “features”, “core”, and “shared” components which clearly separate concerns.
• Repository Pattern: Abstracts data access via local (ObjectBox) and remote (Firebase) repositories.
• Reactive State Management: Using Bloc (Cubit) for a predictable and scalable state flow.
• Separation of UI and Business Logic: Leveraging the clean architecture where UI components and business logic do not directly interact with data sources.
• Monorepo Structure: Managed with Melos, ensuring that shared components and multiple packages are managed centrally.
Relevant Technologies and Frameworks
• Flutter: The primary framework for building the UI.
• Bloc (Cubit): For state management.
• GoRouter: For navigation and deep linking.
• ObjectBox: For local database storage.
• Firebase Firestore & Firebase Auth: For remote data storage and user authentication.
• Google Sign-In: Supporting user authentication.
• Additional UI/UX libraries: Lottie for animations, form_builder_validators for validations, etc.
Putting It All Together
• Branch into two main layers: "Presentation Layer" and "Data/Business Logic Layer".
• Under the Presentation Layer: Show the different screens (Dashboard, Task List, Task Details, Authentication) and a navigation component indicating GoRouter.
• In the Business Logic Layer: Represent the Bloc (Cubit) layer that processes user input and handles state changes.
• A Local Data Source (ObjectBox) block.
• A Remote Data Source block (Firebase Firestore and Firebase Auth).