# sergioibz/task_manager_apex architecture

> Architecture diagram of the GitHub repository sergioibz/task_manager_apex, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sergioibz/task_manager_apex
- Repository: https://github.com/sergioibz/task_manager_apex

## Overview

##### Project type and purpose
- **Type**: Mobile application (Flutter)
- **Purpose**: A task-manager app (“Task Manager Apex”) demonstrating Clean Architecture, offline/online data sync, dependency injection and state management.

##### File structure
- Top-level native folders:
- android/… → Android project, Gradle build scripts
- ios/… → iOS Xcode project, CocoaPods
- Flutter code under lib/:
- config/ → app bootstrap (MyApp), DI container (GetIt), navigation router, network clients, theme, error definitions
- features/ → split by domain: “countries” and “task”
– data → data-sources (Hive, REST/GraphQL), models, mappers, repository impl
– domain → entities, repository interfaces, use-cases
– presentation → Riverpod providers (StateNotifiers) and UI screens/widgets
- Other:
- main.dart → Hive init, DI registration, runApp
- pubspec.yaml → dependencies (Riverpod, GetIt, Dio, graphql_client, Hive, SharedPreferences, Freezed, Json Serializable)

##### Extract README insights
- Layers follow Clean Architecture (data, domain, presentation)
- DI: GetIt
- State: Riverpod + StateNotifier
- Local persistence: Hive + SharedPreferences (one-time flag)
- Remote sync: REST (Dio) + GraphQL
- Codegen: Freezed + json_serializable

- Blue rectangles for UI components
- Green for domain/use-cases
- Orange for data layer (data-sources, repositories)

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Android Shell"
        Android["Android"] 
    end
    subgraph "iOS Shell"
        iOS["iOS"]
    end
    Android --> FlutterEngine
    iOS --> FlutterEngine

    FlutterEngine["Flutter Engine"]
    FlutterEngine --> MyApp

    MyApp["MyApp"]:::app --> DIContainer
    click MyApp "https://github.com/sergioibz/task_manager_apex/blob/main/lib/config/app/my_app.dart"
    DIContainer["GetIt DI Container"]:::di
    click DIContainer "https://github.com/sergioibz/task_manager_apex/blob/main/lib/config/di/dependency_injection.dart"

    DIContainer --> PresentationLayer
    DIContainer --> DataLayer

    subgraph "Presentation Layer" 
        direction TB
        subgraph CountriesPresentation
            CountriesScreen["CountriesScreen"]:::presentation
            click CountriesScreen "https://github.com/sergioibz/task_manager_apex/blob/main/lib/features/countries/presentation/screens/countries_screen.dart"
            CountryInfoScreen["CountryInfoScreen"]:::presentation
            click CountryInfoScreen "https://github.com/sergioibz/task_manager_apex/blob/main/lib/features/countries/presentation/screens/country_info.dart"
            GetCountryInfoProvider["GetCountryInfoProvider"]:::presentation
            click GetCountryInfoProvider "https://github.com/sergioibz/task_manager_apex/blob/main/lib/features/countries/presentation/providers/get_country_info_provider.dart"
            GetCountryNameFlagProvider["GetCountryNameAndFlagProvider"]:::presentation
            click GetCountryNameFlagProvider "https://github.com/sergioibz/task_manager_apex/blob/main/lib/features/countries/presentation/providers/get_country_name_and_flag_provider.dart"
        end
        subgraph TaskPresentation
            TasksScreen["TasksScreen"]:::presentation
            click TasksScreen "https://github.com/sergioibz/task_manager_apex/blob/main/lib/features/task/presentation/screens/tasks_screen.dart"
            AddTaskScreen["AddTaskScreen"]:::presentation
            click AddTaskScreen "https://github.com/sergioibz/task_manager_apex/blob/main/lib/features/task/presentation/screens/add_task_scree.dart"
            EditTaskScreen["EditTaskScreen"]:::presentation
            click EditTaskScreen "https://github.com/sergioibz/task_manager_apex/blob/main/lib/features/task/presentation/screens/edit_task_screen.dart"
            TaskProvider["TaskProvider"]:::presentation
            click TaskProvider "https://github.com/sergioibz/task_manager_apex/blob/main/lib/features/task/presentation/providers/task_provider.dart"
            TaskFilterProvider["TaskFilterProvider"]:::presentation
            click TaskFilterProvider "https://github.com/sergioibz/task_manager_apex/blob/main/lib/features/task/presentation/providers/task_filter_provider.dart"
            ListTaskWidgets["ListTaskElements"]:::presentation
            click ListTaskWidgets "https://github.com/sergioibz/task_manager_apex/blob/main/lib/features/task/presentation/widgets/list_task_elements.dart"
            TaskErrorWidget["TaskErrorWidget"]:::presentation
            click TaskErrorWidget "https://github.com/sergioibz/task_manager_apex/blob/main/lib/features/task/presentation/widgets/task_error_widget.dart"
        end
    end

    subgraph "Domain Layer"
        direction TB
        subgraph CountriesDomain
            CountryEntity["CountryEntity"]:::domain
            click CountryEntity "https://github.com/sergioibz/task_manager_apex/blob/main/lib/features/countries/domain/entities/contry/country_entity.dart"
            CountryFlagEntity["CountryFlagEntity"]:::domain
            click CountryFlagEntity "https://github.com/sergioibz/task_manager_apex/blob/main/lib/features/countries/domain/entities/country_flag/contry_flag_entity.dart"
            GetCountryInfoUC["GetCountryInfoUseCase"]:::domain
            click GetCountryInfoUC "https://github.com/sergioibz/task_manager_apex/blob/main/lib/features/countries/domain/usecases/get_country_info.dart"
            GetCountryNameFlagUC["GetCountryNameAndFlagUseCase"]:::domain
            click GetCountryNameFlagUC "https://github.com/sergioibz/task_manager_apex/blob/main/lib/features/countries/domain/usecases/get_country_name_and_flag.dart"
            CountriesRepository["ICountriesRepository"]:::domain
            click CountriesRepository "https://github.com/sergioibz/task_manager_apex/blob/main/lib/features/countries/domain/repositories/countries_repository.dart"
        end
        subgraph TaskDomain
            TaskEntity["TaskEntity"]:::domain
            click TaskEntity "https://github.com/sergioibz/task_manager_apex/blob/main/lib/features/task/domain/entities/task_entity.dart"
            TaskUseCases["TaskUseCases"]:::domain
            click TaskUseCases "https://github.com/sergioibz/task_manager_apex/tree/main/lib/features/task/domain/usecases"
            TaskRepository["ITaskRepository"]:::domain
            click TaskRepository "https://github.com/sergioibz/task_manager_apex/blob/main/lib/features/task/domain/repositories/tastk_repository.dart"
        end
    end

    subgraph "Data Layer"
        direction TB
        subgraph CountriesData
            CountriesDSImpl["CountriesDataSourceImpl"]:::data
            click CountriesDSImpl "https://github.com/sergioibz/task_manager_apex/blob/main/lib/features/countries/data/datasources/countries_datasource_impl.dart"
            CountryModel["CountryModel"]:::data
            click CountryModel "https://github.com/sergioibz/task_manager_apex/blob/main/lib/features/countries/data/models/country/country_model.dart"
            CountryFlagModel["CountryFlagModel"]:::data
            click CountryFlagModel "https://github.com/sergioibz/task_manager_apex/blob/main/lib/features/countries/data/models/country_flag/country_flag_model.dart"
            CountryModelMapper["CountryModelMapper"]:::data
            click CountryModelMapper "https://github.com/sergioibz/task_manager_apex/blob/main/lib/features/countries/data/mappers/country_model_mapper.dart"
            CountryFlagMapper["CountryFlagModelMapper"]:::data
            click CountryFlagMapper "https://github.com/sergioibz/task_manager_apex/blob/main/lib/features/countries/data/mappers/country_flag_model_mapper.dart"
            CountriesRepoImpl["CountriesRepositoryImpl"]:::data
            click CountriesRepoImpl "https://github.com/sergioibz/task_manager_apex/blob/main/lib/features/countries/data/repositories/countries_repository_impl.dart"
        end
        subgraph TaskData
            HiveLocalDS["HiveLocalTaskDataSource"]:::data
            click HiveLocalDS "https://github.com/sergioibz/task_manager_apex/blob/main/lib/features/task/data/datasources/hive_local_task_data_source.dart"
            RemoteTaskDS["RemoteTaskDataSource"]:::data
            click RemoteTaskDS "https://github.com/sergioibz/task_manager_apex/blob/main/lib/features/task/data/datasources/remote_task_datasource.dart"
            RemoteTaskModel["RemoteTaskModel"]:::data
            click RemoteTaskModel "https://github.com/sergioibz/task_manager_apex/blob/main/lib/features/task/data/models/remote_task/remote_task_model.dart"
            RemoteTaskMapper["RemoteTaskMapper"]:::data
            click RemoteTaskMapper "https://github.com/sergioibz/task_manager_apex/blob/main/lib/features/task/data/mappers/remote_task_mapper.dart"
            TaskRepoImpl["TaskRepositoryImpl"]:::data
            click TaskRepoImpl "https://github.com/sergioibz/task_manager_apex/blob/main/lib/features/task/data/repositories/task_repository_impl.dart"
        end
    end

    subgraph "Config & Infra"
        direction TB
        RestClient["REST Client"]:::external
        click RestClient "https://github.com/sergioibz/task_manager_apex/blob/main/lib/config/network/rest_client.dart"
        GraphQLClient["GraphQL Client"]:::external
        click GraphQLClient "https://github.com/sergioibz/task_manager_apex/blob/main/lib/config/network/graph_client.dart"
        Router["Navigation Router"]:::external
        click Router "https://github.com/sergioibz/task_manager_apex/blob/main/lib/config/navigation/router.dart"
        Theme["Custom Theme"]:::external
        click Theme "https://github.com/sergioibz/task_manager_apex/blob/main/lib/config/theme/custom_theme.dart"
        FailureDef["Failure Definitions"]:::external
        click FailureDef "https://github.com/sergioibz/task_manager_apex/blob/main/lib/config/errors/failure.dart"
        SharedPref["SharedPreferences"]:::storage
    end

    subgraph "External Services"
        RESTAPI["REST API"]:::cloud
        GraphQLEndpoint["GraphQL Endpoint"]:::cloud
        HiveDB["Hive DB"]:::storage
    end

    %% Relationships
    PresentationLayer -->|uses| CountriesDomain
    PresentationLayer -->|uses| TaskDomain
    CountriesDomain -->|invoke| CountriesRepoImpl
    TaskDomain -->|invoke| TaskRepoImpl
    CountriesRepoImpl -->|reads/writes| CountriesDSImpl
    CountriesDSImpl -->|maps| CountryModel
    CountriesDSImpl -->|maps| CountryFlagModel
    CountriesRepoImpl -->|implements| CountriesRepository
    TaskRepoImpl -->|reads/writes| HiveLocalDS
    TaskRepoImpl -->|reads/writes| RemoteTaskDS
    HiveLocalDS -->|stores| HiveDB
    HiveLocalDS -->|flag check| SharedPref
    RemoteTaskDS -->|calls| RESTAPI
    RemoteTaskDS -->|calls| GraphQLEndpoint
    DIContainer -->|injected into| PresentationLayer
    DIContainer -->|injected into| DataLayer

    %% Clients to data sources
    RestClient --> RemoteTaskDS
    GraphQLClient --> RemoteTaskDS

    %% Styles
    classDef presentation fill:#D0E8FF,stroke:#0366D6;
    classDef domain fill:#DFF7D8,stroke:#1A7F37;
    classDef data fill:#FFE0B2,stroke:#E65100;
    classDef storage fill:#F0F0F0,stroke:#888888,stroke-dasharray: 5 5;
    classDef cloud fill:#E8F0FE,stroke:#4285F4;
    classDef di fill:#F3E5F5,stroke:#8E24AA,stroke-dasharray: 2 2;
    classDef app fill:#FFFFFF,stroke:#000000;
```
