# abhinrajp/taskpro_worker architecture

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

- Interactive diagram: https://gitdiagram.com/abhinrajp/taskpro_worker
- Repository: https://github.com/abhinrajp/taskpro_worker

## Overview

##### Main Components Identification

The system consists of several key components that should be represented:

a) Client Layer:
- Flutter Mobile Application (iOS & Android)
- UI Components (Views, Widgets)
- State Management (BLoC pattern)

b) Business Logic Layer:
- Authentication Services
- Booking Services
- Chat Services
- Revenue Services

c) Data Layer:
- Firebase Backend
- Local Storage (Hive)

##### Architectural Pattern

The application follows a clean architecture pattern with:
- View Layer (lib/View/)
- Controller Layer (lib/controller/)
- Services Layer (lib/Services/)
- Model Layer (lib/Model/)

##### Component Relationships

Following interactions:
**User Interface ↔ BLoC Controllers ↔ Services ↔ Firebase/External Services**

##### Detailed Components

Frontend (Flutter App):
- Authentication screens
- Home screen
- Chat functionality
- Profile management
- Settings
- Schedule management

Backend Services:
- Firebase Authentication
- Real-time Database/Firestore
- Firebase Cloud Messaging
- Storage Services

##### Key Features to Highlight

- Real-time messaging system
- Location services (MapView)
- Payment processing
- Schedule management
- User authentication flow

##### Implementation Details

Following architectural patterns:
- BLoC pattern implementation
- Service layer abstraction
- Model-View separation
- Theme management
- Route management

**[User Interface Layer]**
- ↓↑
**[BLoC Controllers Layer]**
- ↓↑
**[Services Layer]**
- ↓↑
**[External Services/Firebase Layer]**

- Component types
- State management flow

Keep the abstraction level high enough to understand the system architecture but detailed enough to show the important interactions between components. Focus on showing how the BLoC pattern manages state and how the services interact with Firebase backend.

Remember to highlight the mobile-specific aspects and cross-platform nature of the application, as it's built with Flutter for both iOS and Android platforms.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        UI[User Interface]
        subgraph Views
            AV["Authentication Views"]:::view
            CV["Chat Views"]:::view
            HV["Home Views"]:::view
            PV["Profile Views"]:::view
            SV["Settings Views"]:::view
        end
        subgraph Widgets
            MW["Message Widgets"]:::widget
            PW["Profile Widgets"]:::widget
            SW["Schedule Widgets"]:::widget
            SUW["Signup Widgets"]:::widget
        end
    end

    subgraph "State Management"
        AB["Authentication BLoC"]:::bloc
        MB["Map BLoC"]:::bloc
        TB["Theme BLoC"]:::bloc
        SB["Schedule BLoC"]:::bloc
    end

    subgraph "Services Layer"
        AS["Authentication Service"]:::service
        BS["Booking Service"]:::service
        CS["Chat Service"]:::service
        RS["Revenue Service"]:::service
    end

    subgraph "Data Layer"
        subgraph "Models"
            MM["Message Model"]:::model
            GM["General Model"]:::model
            UM["Update Model"]:::model
        end
        TM["Theme Management"]:::util
        CF["Custom Functions"]:::util
        UT["Utilities"]:::util
    end

    subgraph "External Services"
        FB[(Firebase)]:::external
        FCM["Firebase Cloud Messaging"]:::external
        FStore["Firestore"]:::external
    end

    UI --> Views
    UI --> Widgets
    Views --> AB
    Views --> MB
    Views --> TB
    Views --> SB
    AB --> AS
    MB --> BS
    SB --> BS
    AS --> FB
    BS --> FB
    CS --> FCM
    CS --> FStore
    RS --> FB

    %% Click Events
    click AS "https://github.com/Abhinrajp/taskpro_worker/blob/main/lib/Services/authservices.dart"
    click BS "https://github.com/Abhinrajp/taskpro_worker/blob/main/lib/Services/bookservices.dart"
    click CS "https://github.com/Abhinrajp/taskpro_worker/blob/main/lib/Services/chatservices.dart"
    click RS "https://github.com/Abhinrajp/taskpro_worker/blob/main/lib/Services/revenueservice.dart"
    click AV "https://github.com/Abhinrajp/taskpro_worker/tree/main/lib/View/authentication/"
    click CV "https://github.com/Abhinrajp/taskpro_worker/tree/main/lib/View/Chat/"
    click HV "https://github.com/Abhinrajp/taskpro_worker/tree/main/lib/View/Home/"
    click PV "https://github.com/Abhinrajp/taskpro_worker/tree/main/lib/View/Profile/"
    click SV "https://github.com/Abhinrajp/taskpro_worker/tree/main/lib/View/Settings/"
    click AB "https://github.com/Abhinrajp/taskpro_worker/tree/main/lib/controller/Authblock/Authbloc/"
    click MB "https://github.com/Abhinrajp/taskpro_worker/tree/main/lib/controller/Authblock/Mapbloc/"
    click TB "https://github.com/Abhinrajp/taskpro_worker/tree/main/lib/controller/Themeblock/"
    click SB "https://github.com/Abhinrajp/taskpro_worker/tree/main/lib/controller/Schedulebloc/"
    click MM "https://github.com/Abhinrajp/taskpro_worker/blob/main/lib/Model/messagemodel.dart"
    click GM "https://github.com/Abhinrajp/taskpro_worker/blob/main/lib/Model/model.dart"
    click UM "https://github.com/Abhinrajp/taskpro_worker/blob/main/lib/Model/updatemodel.dart"
    click MW "https://github.com/Abhinrajp/taskpro_worker/tree/main/lib/widgets/Message/"
    click PW "https://github.com/Abhinrajp/taskpro_worker/tree/main/lib/widgets/Profilewidgets/"
    click SW "https://github.com/Abhinrajp/taskpro_worker/tree/main/lib/widgets/Schedule/"
    click SUW "https://github.com/Abhinrajp/taskpro_worker/tree/main/lib/widgets/signupwidget/"
    click TM "https://github.com/Abhinrajp/taskpro_worker/blob/main/lib/Utilities/Theme/theme.dart"
    click CF "https://github.com/Abhinrajp/taskpro_worker/blob/main/lib/Functions/customfunctions.dart"
    click UT "https://github.com/Abhinrajp/taskpro_worker/blob/main/lib/Utilities/utilities.dart"

    %% Styling
    classDef view fill:#2196F3,stroke:#1976D2,color:white
    classDef widget fill:#42A5F5,stroke:#1976D2,color:white
    classDef bloc fill:#4CAF50,stroke:#388E3C,color:white
    classDef service fill:#FF9800,stroke:#F57C00,color:white
    classDef model fill:#9C27B0,stroke:#7B1FA2,color:white
    classDef util fill:#757575,stroke:#616161,color:white
    classDef external fill:#FF5722,stroke:#E64A19,color:white
```
