# hassanolaa/halaqah-qurania architecture

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

- Interactive diagram: https://gitdiagram.com/hassanolaa/halaqah-qurania
- Repository: https://github.com/hassanolaa/halaqah-qurania

## Overview

##### Main Components
- Frontend Client: Represent the Flutter application as the core frontend layer. Indicate that it spans multiple target platforms (mobile, web, desktop) by labeling or grouping platform-specific deployments (Android, iOS, Windows, macOS, Linux, Web).
- Feature Modules: Identify each major feature represented in the lib/features directory:
– Auth (handles user authentication screens and state management)
– Home (main landing/home screen functionality)
– Muslim_features (includes modules for Quran reading, Tasbeh, Duaa, Hadith, etc.)
– Navi (handles navigation-related views/screens)
– UserInfo (manages user profile and settings)
– Chat (implements messaging functionalities, likely with real-time/Firebase components)
– Videocall (contains UI and state management for video conferencing, streaming, screen sharing, and whiteboard functionalities)
- Core Modules: Highlight the lib/core folder modules (localization, routing, theming) that serve as utility-level services across features.
- External Services: Include Firebase as a supporting external service used for chat, authentication, real-time streams, and possibly videoconferencing back-ends.
- Business Logic Layer: Emphasize the state management components (Cubits and related states), which coordinate the business logic across different feature modules.
- Data/Networking Layer: Represent the network layers (found in each feature such as Auth/data, Home/data, etc.) that handle API interactions, fetching models, and possibly caching/local storage.

##### Relationships and Interactions
- Cubit controllers to their respective data/network components to show the data flow and API calls.
- Routing module (from lib/core/routing) as a central navigation coordinator for UI transitions.
- External connections (like Firebase and any other backend services) interacting with the data/network layer.

##### Architectural Patterns and Design Principles
- Separation of concerns (UI, Business Logic, Data) which reflects an MV* or Clean Architecture principle.
- Recognize the feature-based modularization where each feature encapsulates its own UI, business logic, and data access, promoting reusability and maintainability.
- Cross-platform considerations by showing platform-specific code (Android, iOS, etc.) feeding into the unified Flutter codebase in lib/.

##### Relevant Technologies and Frameworks
- Flutter SDK as the primary framework.
- State management using Cubit (a lightweight Bloc pattern).
- Firebase services for handling aspects like real-time chat and videoconferencing.
- Theming and routing utilities in the core module.
- Platform-specific configurations (Android’s MainActivity, iOS’s AppDelegate, etc.) showing the native layer entry points.

##### Important Note
- The focus should be on representing as many elements as possible to capture the project’s complexity while maintaining clarity.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Platform Layer
    subgraph "Platform Layer"
        FC["Frontend Client"]:::client
    end

    %% Feature Modules
    subgraph "Auth Feature Module"
        A_UI["Auth UI"]:::ui
        A_Cubit["Auth Cubit"]:::cubit
        A_Data["Auth Data Layer"]:::data
        A_UI -->|"trigger"| A_Cubit
        A_Cubit -->|"fetch"| A_Data
    end

    subgraph "Home Feature Module"
        H_UI["Home UI"]:::ui
        H_Cubit["Home Cubit"]:::cubit
        H_Data["Home Data Layer"]:::data
        H_UI -->|"trigger"| H_Cubit
        H_Cubit -->|"fetch"| H_Data
    end

    subgraph "Muslim Features Module"
        MF_Category_UI["Muslim Category UI"]:::ui
        MF_Main_UI["Muslim Main UI"]:::ui
        MF_Cubit["Muslim Features Cubit"]:::cubit
        MF_Data["Muslim Features Data Layer"]:::data
        MF_Category_UI -->|"select"| MF_Cubit
        MF_Main_UI -->|"trigger"| MF_Cubit
        MF_Cubit -->|"fetch"| MF_Data
    end

    subgraph "Navi Feature Module"
        N_UI["Navi UI"]:::ui
    end

    subgraph "UserInfo Feature Module"
        UI_UI["UserInfo UI"]:::ui
        UI_Cubit["UserInfo Cubit"]:::cubit
        UI_Data["UserInfo Data Layer"]:::data
        UI_UI -->|"trigger"| UI_Cubit
        UI_Cubit -->|"fetch"| UI_Data
    end

    subgraph "Chat Feature Module"
        C_UI["Chat UI"]:::ui
        C_Cubit["Chat Cubit"]:::cubit
        C_Data["Chat Data Layer"]:::data
        C_UI -->|"trigger"| C_Cubit
        C_Cubit -->|"fetch"| C_Data
    end

    subgraph "Videocall Feature Module"
        VC_UI["Videocall UI"]:::ui
        VC_Cubit["Videocall Cubit"]:::cubit
        VC_Data["Videocall Data Layer"]:::data
        VC_UI -->|"trigger"| VC_Cubit
        VC_Cubit -->|"fetch"| VC_Data
    end

    %% Core Modules
    subgraph "Core Modules"
        Core_Local["Core Localization"]:::core
        Core_Route["Core Routing"]:::core
        Core_Theme["Core Theming"]:::core
    end

    %% External Services (Firebase)
    subgraph "External Services"
        FB_Config["Firebase Config"]:::external
        FB_Options["Firebase Options"]:::external
    end

    %% Interactions between layers
    FC -->|"launches"| A_UI
    FC -->|"launches"| H_UI
    FC -->|"launches"| MF_Category_UI
    FC -->|"launches"| MF_Main_UI
    FC -->|"launches"| N_UI
    FC -->|"launches"| UI_UI
    FC -->|"launches"| C_UI
    FC -->|"launches"| VC_UI

    %% Integration with Core Routing
    A_UI -->|"navigates"| Core_Route
    H_UI -->|"navigates"| Core_Route
    MF_Category_UI -->|"navigates"| Core_Route
    MF_Main_UI -->|"navigates"| Core_Route
    N_UI -->|"navigates"| Core_Route
    UI_UI -->|"navigates"| Core_Route
    C_UI -->|"navigates"| Core_Route
    VC_UI -->|"navigates"| Core_Route

    %% External Service interactions
    C_Data -->|"sync"| FB_Config
    C_Data -->|"sync"| FB_Options
    VC_Data -->|"stream"| FB_Config
    VC_Data -->|"stream"| FB_Options

    %% Click Events
    click FC "https://github.com/hassanolaa/halaqah-qurania/blob/main/lib/main.dart"
    
    click A_UI "https://github.com/hassanolaa/halaqah-qurania/tree/main/lib/features/Auth/ui"
    click A_Cubit "https://github.com/hassanolaa/halaqah-qurania/tree/main/lib/features/Auth/cubit/cubit"
    click A_Data "https://github.com/hassanolaa/halaqah-qurania/tree/main/lib/features/Auth/data"
    
    click H_UI "https://github.com/hassanolaa/halaqah-qurania/tree/main/lib/features/Home/ui"
    click H_Cubit "https://github.com/hassanolaa/halaqah-qurania/tree/main/lib/features/Home/Cubit/cubit"
    click H_Data "https://github.com/hassanolaa/halaqah-qurania/tree/main/lib/features/Home/data"
    
    click MF_Category_UI "https://github.com/hassanolaa/halaqah-qurania/tree/main/lib/features/Muslim_features/category/ui"
    click MF_Main_UI "https://github.com/hassanolaa/halaqah-qurania/tree/main/lib/features/Muslim_features/muslim_features/ui"
    click MF_Cubit "https://github.com/hassanolaa/halaqah-qurania/tree/main/lib/features/Muslim_features/muslim_features/cubit/cubit"
    click MF_Data "https://github.com/hassanolaa/halaqah-qurania/tree/main/lib/features/Muslim_features/muslim_features/data"
    
    click N_UI "https://github.com/hassanolaa/halaqah-qurania/blob/main/lib/features/Navi/ui/screen/navi.dart"
    
    click UI_UI "https://github.com/hassanolaa/halaqah-qurania/tree/main/lib/features/UserInfo/ui"
    click UI_Cubit "https://github.com/hassanolaa/halaqah-qurania/tree/main/lib/features/UserInfo/cubit/cubit"
    click UI_Data "https://github.com/hassanolaa/halaqah-qurania/tree/main/lib/features/UserInfo/data"
    
    click C_UI "https://github.com/hassanolaa/halaqah-qurania/tree/main/lib/features/chat/ui"
    click C_Cubit "https://github.com/hassanolaa/halaqah-qurania/tree/main/lib/features/chat/cubit/cubit"
    click C_Data "https://github.com/hassanolaa/halaqah-qurania/tree/main/lib/features/chat/data"
    
    click VC_UI "https://github.com/hassanolaa/halaqah-qurania/tree/main/lib/features/videocall/ui"
    click VC_Cubit "https://github.com/hassanolaa/halaqah-qurania/tree/main/lib/features/videocall/cubit/cubit"
    click VC_Data "https://github.com/hassanolaa/halaqah-qurania/tree/main/lib/features/videocall/data"
    
    click Core_Local "https://github.com/hassanolaa/halaqah-qurania/tree/main/lib/core/local"
    click Core_Route "https://github.com/hassanolaa/halaqah-qurania/tree/main/lib/core/routing"
    click Core_Theme "https://github.com/hassanolaa/halaqah-qurania/tree/main/lib/core/theming"
    
    click FB_Config "https://github.com/hassanolaa/halaqah-qurania/blob/main/firebase.json"
    click FB_Options "https://github.com/hassanolaa/halaqah-qurania/blob/main/lib/firebase_options.dart"

    %% Styles
    classDef client fill:#D6EAF8,stroke:#1B4F72,stroke-width:2px;
    classDef ui fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef cubit fill:#A9DFBF,stroke:#145A32,stroke-width:2px;
    classDef data fill:#F9E79F,stroke:#7D6608,stroke-width:2px;
    classDef core fill:#D5DBDB,stroke:#566573,stroke-width:2px;
    classDef external fill:#F5B7B1,stroke:#922B21,stroke-width:2px;
```
