How devbathani/task-management-app works
Main Components
• Flutter Frontend: Encompassing the cross-platform UI that runs on Android, iOS, and Web (as seen in directories like android, ios, and web).
• Domain Layer (lib/domain): Contains the core business logic, task entities, and use cases.
• Presentation Layer (lib/presentation): Houses the UI screens and widgets that manage the user interface.
• Infrastructure Layer (lib/infrastructure): Manages data-related operations including interactions with Firebase Firestore, local persistence (via Hive), and any networking.
• Core Utilities (lib/core & lib/utils): Provides common extensions, helper classes, and utility functions across the application.
• Dependency Injection (lib/injection): Manages service location and dependency management.
• Configuration & Generated Code (lib/configs and lib/gen): Provides configuration constants and auto-generated assets/resources.
• State Management (lib/providers): Implements the Provider-based state management, especially for the home or task module.
• Routing (lib/routing): Contains navigation setup and route definitions for app transitions.
• External Services: Firebase (Firebase Firestore, Firebase Core) and Hive for offline storage.
Detail the Relationships and Interactions
• The Presentation Layer interacts with the state management providers (from lib/providers) to react to user inputs and UI events.
• The Providers communicate with the Domain Layer to execute business logic (like task creation, deletion, or updates).
• The Domain Layer, which includes task entities and related use cases, is decoupled from the concrete implementations of data access. It sends/receives data via repositories.
• The Infrastructure Layer implements these repositories and interacts with external services like Firebase (for cloud syncing) and Hive (for offline storage).
• Dependency Injection (lib/injection) is crucial for linking the various layers together, ensuring that each component receives the required dependencies at runtime.
• Core and Utils provide shared functionality that is used in both the UI and business logic layers.
Architectural Patterns and Principles
• Domain-Driven Design (DDD): Notice the separation into domain, infrastructure, and presentation layers.
• MVVM/MVC-Like Separation: UI on one side and business logic/data handling on the other.
• Dependency Injection: Managing dependencies via a dedicated injection setup (as seen in lib/injection) for better decoupling and testability.
• Cross-Platform Mobile Development: Flutter for UI across Android, iOS, and Web environments.
• Offline-first Mobile App: Use of Hive for local data storage with synchronization to Firebase when online.