# kossy205/projecthub- architecture

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

- Interactive diagram: https://gitdiagram.com/kossy205/projecthub-
- Repository: https://github.com/kossy205/projecthub-

## Overview

##### Main Components
- User Interface (UI) Layer:
- This includes all the Android activities (e.g., SplashActivity, IntroActivity, SignInActivity, SignUpActivity, MainActivity, CreateBoardActivity, CardDetailsActivity, etc.) grouped under the “activities” package.
- The UI is further supported by various layouts (XML files in the res/layout directory) and view resources such as drawables and menus.
- Data Handling & Business Logic:
- The core data management is done via Firebase. In the “firebase” package, the FirestoreClass handles all Firestore-related operations while the “model” package contains data models such as Board, Card, Task, User, and SelectedMembers.
- Adapters (in the “adapters” package) and dialogs (in the “dialogs” package) mediate between the data and UI layers.
- Utility functions and constants (in the “utils” package) support the business logic.
- Asynchronous Operations and Services:
- Kotlin Coroutines facilitate asynchronous operations for better performance and battery efficiency.
- The “fcm” package includes the MyFirebaseMessagingService, which is responsible for handling Firebase Cloud Messaging, a service that interacts with external systems to push notifications.
- External Services:
- Firebase Authentication is used for user management.
- Firebase Cloud Firestore is used for data persistence and task storage.

##### Out the Relationships and Interactions
- The Application Startup:
- The entry point is the SplashActivity, which then directs the user to either IntroActivity or SignInActivity based on authentication.
- Authentication Flow:
- The SignInActivity and SignUpActivity handle user authentication using Firebase Auth.
- Main User Operations:
- After authentication, the MainActivity manages the list of boards/tasks.
- Navigation between screens (e.g., to create a board or view task details) is handled via intents navigating between activities.
- Data Operations:
- Each activity interacts with Firestore through the FirestoreClass to create, read, update, and delete (CRUD) operations for Boards, Cards, Tasks, etc.
- Adapters are used to populate dynamic content in lists (e.g., boards, task lists, member lists).
- Notification Flow:
- The MyFirebaseMessagingService in the fcm package listens for and handles incoming notifications, ensuring the UI is updated accordingly.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% UI Layer
    subgraph "User Interface Layer"
        UI1["SplashActivity, SignInActivity, SignUpActivity, MainActivity, etc."] 
        UI2["Layouts & Resources (XML, Drawables, Menus)"]
    end

    %% Data & Business Logic Layer
    subgraph "Data Handling & Business Logic"
        DB1["FirestoreClass"]
        DB2["Data Models (Board, Card, Task, User, SelectedMembers)"]
        DB3["Adapters"]
        DB4["Dialogs"]
        DB5["Utils & Constants"]
    end

    %% Asynchronous Operations & Notification Services
    subgraph "Asynchronous Operations & Notification"
        ASYNC["Kotlin Coroutines"]
        FCM["MyFirebaseMessagingService"]
    end

    %% External Services
    subgraph "External Services"
        EXT1["Firebase Auth"]
        EXT2["Firebase Cloud Firestore"]
    end

    %% Relationships
    UI1 -->|"uses"| UI2
    UI1 -->|"triggers data ops"| DB1
    UI1 -->|"initiates auth"| EXT1
    UI1 -->|"displays dialogs"| DB4
    UI1 -->|"populates lists via"| DB3

    DB1 -->|"performs CRUD"| EXT2
    DB1 -->|"utilizes"| DB2
    DB1 -->|"relies on"| DB5
    DB1 -.->|"async calls"| ASYNC

    FCM -->|"sends notifications to"| UI1

    %% Click Events for Component Mapping
    click UI1 "https://github.com/kossy205/projecthub-/tree/master/app/src/main/java/com/ProjectHub/activities"
    click UI2 "https://github.com/kossy205/projecthub-/tree/master/app/src/main/res/layout"
    click DB1 "https://github.com/kossy205/projecthub-/blob/master/app/src/main/java/com/ProjectHub/firebase/FirestoreClass.kt"
    click DB2 "https://github.com/kossy205/projecthub-/tree/master/app/src/main/java/com/ProjectHub/model"
    click DB3 "https://github.com/kossy205/projecthub-/tree/master/app/src/main/java/com/ProjectHub/adapters"
    click DB4 "https://github.com/kossy205/projecthub-/tree/master/app/src/main/java/com/ProjectHub/dialogs"
    click DB5 "https://github.com/kossy205/projecthub-/blob/master/app/src/main/java/com/ProjectHub/utils/Constants.kt"
    click FCM "https://github.com/kossy205/projecthub-/blob/master/app/src/main/java/com/ProjectHub/fcm/MyFirebaseMessagingService.kt"

    %% Styles
    classDef ui fill:#ADD8E6,stroke:#000,stroke-width:1px;
    classDef data fill:#90EE90,stroke:#000,stroke-width:1px;
    classDef async fill:#FFD700,stroke:#000,stroke-width:1px;
    classDef external fill:#FFB6C1,stroke:#000,stroke-width:1px;

    class UI1,UI2 ui;
    class DB1,DB2,DB3,DB4,DB5 data;
    class ASYNC,FCM async;
    class EXT1,EXT2 external;
```
