# l1a-crew/zzekak_client architecture

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

- Interactive diagram: https://gitdiagram.com/l1a-crew/zzekak_client
- Repository: https://github.com/l1a-crew/zzekak_client

## Overview

##### Main Architecture Components

a) Presentation Layer (UI)
- Location: /app/lib/screen/*
- Different screens (login, home, splash, etc.)
- Widget components (/app/lib/common_widget)

b) Core Layer
- Location: /core/lib/*
- Contains business logic and domain models
- Houses core exceptions and interfaces

c) Data Layer
- Location: /data/lib/*
- API implementations
- Repository implementations
- Infrastructure components

##### Key Components

a) Frontend Components:
- Flutter UI Components
- Screen Modules (Login, Home, Splash, etc.)
- Common Widgets
- Routes Management (/app/lib/routes)

b) Business Logic:
- DI Container (show dependency injection flow)
- Core Models
- Authentication Flow
- Permission Handling

c) Data Management:
- API Services
- Repository Pattern Implementation
- Local Storage
- Token Management

##### Interactions and Flows

- User Authentication Flow
- API Communication
- Data Flow between layers
- Dependency Injection paths

##### Technical Details

Technical elements:

- Firebase Integration (noted by firebase_options.dart)
- Platform-specific implementations (iOS/Android)
- External Service Connections
- Local Storage Management

##### Specific Implementation Notes

- Authentication Module
- User Management
- Permission Handling
- API Communication

##### Bottom Layer: Data & External Services

- Clean Architecture patterns
- Dependency flow (always inward)
- Clear separation between layers
- Cross-cutting concerns (DI, logging, etc.)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and Classes
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef core fill:#2ecc71,stroke:#27ae60,color:white
    classDef data fill:#f1c40f,stroke:#f39c12,color:black
    classDef external fill:#e74c3c,stroke:#c0392b,color:white
    classDef infra fill:#95a5a6,stroke:#7f8c8d,color:white

    %% UI Layer
    subgraph UI
        Screens["UI Screens"]:::ui
        CommonWidgets["Common Widgets"]:::ui
        Routes["Routes Management"]:::ui
        PermissionHandler["Permission Handler"]:::ui
        FirebaseConfig["Firebase Config"]:::ui
    end

    %% Core Layer
    subgraph Core
        CoreExceptions["Core Exceptions"]:::core
        DomainModels["Domain Models"]:::core
        RepoInterfaces["Repository Interfaces"]:::core
        TokenModel["Auth Token Model"]:::core
        UserModel["User Model"]:::core
    end

    %% Data Layer
    subgraph Data
        APIImpl["API Implementation"]:::data
        DataInfra["Data Infrastructure"]:::data
        HttpClient["HTTP Client"]:::data
        AuthAPI["Auth API"]:::data
        UserRepo["User Repository"]:::data
        TokenProvider["Token Provider"]:::data
    end

    %% External Services
    Firebase["Firebase Services"]:::external
    ExternalAPIs["External APIs"]:::external

    %% Dependency Injection
    DIContainer["DI Container"]:::infra

    %% Relationships
    Screens --> CommonWidgets
    Screens --> Routes
    Screens --> PermissionHandler
    Screens --> DomainModels
    DIContainer --> APIImpl
    DIContainer --> DataInfra
    DIContainer --> RepoInterfaces
    APIImpl --> HttpClient
    APIImpl --> ExternalAPIs
    AuthAPI --> TokenProvider
    UserRepo --> UserModel
    FirebaseConfig --> Firebase
    DataInfra --> CoreExceptions
    TokenProvider --> TokenModel

    %% Click Events
    click Screens "https://github.com/L1A-crew/zzekak_client/tree/main//app/lib/screen/*"
    click CommonWidgets "https://github.com/L1A-crew/zzekak_client/tree/main//app/lib/common_widget/*"
    click Routes "https://github.com/L1A-crew/zzekak_client/blob/main//app/lib/routes/app_routes.dart"
    click CoreExceptions "https://github.com/L1A-crew/zzekak_client/tree/main//core/lib/exception/*"
    click DomainModels "https://github.com/L1A-crew/zzekak_client/tree/main//core/lib/model/*"
    click RepoInterfaces "https://github.com/L1A-crew/zzekak_client/tree/main//core/lib/repository/*"
    click APIImpl "https://github.com/L1A-crew/zzekak_client/tree/main//data/lib/api/*"
    click DataInfra "https://github.com/L1A-crew/zzekak_client/tree/main//data/lib/infra/*"
    click HttpClient "https://github.com/L1A-crew/zzekak_client/blob/main//data/lib/io/dio_http_client_impl.dart"
    click AuthAPI "https://github.com/L1A-crew/zzekak_client/tree/main//data/lib/api/auth_api/*"
    click PermissionHandler "https://github.com/L1A-crew/zzekak_client/tree/main//app/lib/module/permission/*"
    click DIContainer "https://github.com/L1A-crew/zzekak_client/blob/main//app/lib/di/app_di_config.dart"
    click FirebaseConfig "https://github.com/L1A-crew/zzekak_client/blob/main//app/lib/firebase_options.dart"
    click UserModel "https://github.com/L1A-crew/zzekak_client/blob/main//core/lib/model/user/user_model.dart"
    click UserRepo "https://github.com/L1A-crew/zzekak_client/tree/main//data/lib/repository/user_repository/*"
    click TokenModel "https://github.com/L1A-crew/zzekak_client/blob/main//core/lib/model/auth_token/auth_token.dart"
    click TokenProvider "https://github.com/L1A-crew/zzekak_client/blob/main//core/lib/repository/token_provider/token_provider.dart"

    %% Legend
    subgraph Legend
        UI_Legend["UI Components"]:::ui
        Core_Legend["Core Components"]:::core
        Data_Legend["Data Components"]:::data
        External_Legend["External Services"]:::external
        Infra_Legend["Infrastructure"]:::infra
    end
```
