# cmput301-w25/project-vibecheck architecture

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

- Interactive diagram: https://gitdiagram.com/cmput301-w25/project-vibecheck
- Repository: https://github.com/cmput301-w25/project-vibecheck

## Overview

##### Project Type & Purpose
- The project is an Android mobile application (built using the Gradle Kotlin DSL) for “VibeCheck” – a mood/social app – which includes multiple screens such as Home, Login, SignUp, Profile, Mood Events, Mood History, and Comments.
- The README (even though brief) and the file structure confirm that this app’s core functionality is around mood events and user interactions, with separate screens (activities/fragments) dealing with login, history, comments, etc.

##### Analyzing the File Structure
- The top-level “code” directory holds the actual project source, and within it the “app” directory represents the Android module.
- The “src/main/java/com/example/vibecheck” directory contains packages grouped by feature: “ui/home”, “ui/login”, “ui/signup”, “ui/profile”, “ui/moodevents”, “ui/history”, and “ui/comments”. This shows a feature-based organization of code.
- Core utility classes exist (e.g., MoodUtils.java, NetworkStatusChecker.java) which likely support reusable logic and connectivity checks.
- The presence of “AndroidManifest.xml” and various XML layout files in “res” indicates the UI components are defined following Android standards.
- Multiple Gradle configuration files (build.gradle.kts, gradlew, gradle-wrapper.properties, etc.) support build and dependency management.

##### Relationships and Interactions
- Flow of user actions (like tapping a “Like” or “Send Comment”) leading through the UI to update underlying models.
- In testing, show how test suites interact with the core functionality (e.g., login, mood events).

##### Architectural Patterns and Design Principles
- Although the project’s structure suggests a standard Android application design, you might highlight patterns such as:
- Activity/Fragment design pattern for screen management.
- A ViewModel-based approach (indicated by HomeScreenViewModel) to separate UI logic.
- Possibly a modular design if different screens could be seen as separate “features.”
- Separation of concerns between UI, utility functions, and test code.

##### Technologies & Frameworks
- Integration with external design prototypes or documentation (e.g., Figma links in the README) to highlight design alignment.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% UI/Presentation Layer
    subgraph "UI/Presentation Layer"
        %% Home Feature
        subgraph "Home Feature"
            HA["HomeActivity"]:::ui
            HF["HomeFragment"]:::ui
            HVM["HomeScreenViewModel"]:::ui
            HSPA["HomeScreenPostAdapter"]:::ui
        end
        %% Authentication
        subgraph "Authentication"
            LA["LoginActivity"]:::ui
            SA["SignUpActivity"]:::ui
        end
        %% Profile Screen
        subgraph "Profile Screen"
            PA["ProfileActivity"]:::ui
        end
        %% Mood Events
        subgraph "Mood Events"
            AMEA["AddMoodEventActivity"]:::ui
            EMEA["EditMoodEventActivity"]:::ui
            M["Mood"]:::ui
            MMDF["MyMoodDisplayFragment"]:::ui
            UMDF["UserMoodDisplayFragment"]:::ui
        end
        %% Mood History
        subgraph "Mood History"
            MHA["MoodHistoryActivity"]:::ui
            MH["MoodHistory"]:::ui
            MFF["MoodFilterFragment"]:::ui
            MHE["MoodHistoryEntry"]:::ui
            MHEA["MoodHistoryEntryAdapter"]:::ui
        end
        %% Comments
        subgraph "Comments"
            C["Comment"]:::ui
            CA["CommentAdapter"]:::ui
        end
    end

    %% Business / Utility Layer
    subgraph "Business/Utility Layer"
        MU["MoodUtils"]:::business
        NSC["NetworkStatusChecker"]:::business
        U["User"]:::business
    end

    %% Data and Resource Layer
    subgraph "Data/Resource Layer"
        RES["XML Layouts/Assets"]:::resource
    end

    %% Testing & Build Infrastructure
    subgraph "Testing & Build/Configuration"
        Test["Tests (Unit/Instrumentation)"]:::test
        Build["Build+Config Files"]:::build
    end

    %% Relationships
    %% UI Components interacting with Business Logic
    HVM -->|"calls"| MU
    HVM -->|"calls"| NSC
    LA -->|"calls"| NSC

    %% UI Components utilizing Resources
    HA -->|"loads"| RES
    LA -->|"loads"| RES
    PA -->|"loads"| RES

    %% Testing interactions with Business Logic
    Test -->|"tests"| MU
    Test -->|"tests"| NSC
    Test -->|"tests"| U

    %% Build and Configuration triggering UI and Business components
    Build -->|"builds"| HA
    Build -->|"builds"| LA
    Build -->|"builds"| PA
    Build -->|"builds"| MU

    %% Click Events for UI/Presentation Layer - Home Feature
    click HA "https://github.com/cmput301-w25/project-vibecheck/tree/main/code/app/src/main/java/com/example/vibecheck/ui/home"
    click HF "https://github.com/cmput301-w25/project-vibecheck/tree/main/code/app/src/main/java/com/example/vibecheck/ui/home"
    click HVM "https://github.com/cmput301-w25/project-vibecheck/tree/main/code/app/src/main/java/com/example/vibecheck/ui/home"
    click HSPA "https://github.com/cmput301-w25/project-vibecheck/tree/main/code/app/src/main/java/com/example/vibecheck/ui/home"

    %% Click Events for Authentication
    click LA "https://github.com/cmput301-w25/project-vibecheck/tree/main/code/app/src/main/java/com/example/vibecheck/ui/login"
    click SA "https://github.com/cmput301-w25/project-vibecheck/tree/main/code/app/src/main/java/com/example/vibecheck/ui/signup"

    %% Click Event for Profile Screen
    click PA "https://github.com/cmput301-w25/project-vibecheck/tree/main/code/app/src/main/java/com/example/vibecheck/ui/profile"

    %% Click Events for Mood Events
    click AMEA "https://github.com/cmput301-w25/project-vibecheck/tree/main/code/app/src/main/java/com/example/vibecheck/ui/moodevents"
    click EMEA "https://github.com/cmput301-w25/project-vibecheck/tree/main/code/app/src/main/java/com/example/vibecheck/ui/moodevents"
    click M "https://github.com/cmput301-w25/project-vibecheck/tree/main/code/app/src/main/java/com/example/vibecheck/ui/moodevents"
    click MMDF "https://github.com/cmput301-w25/project-vibecheck/tree/main/code/app/src/main/java/com/example/vibecheck/ui/moodevents"
    click UMDF "https://github.com/cmput301-w25/project-vibecheck/tree/main/code/app/src/main/java/com/example/vibecheck/ui/moodevents"

    %% Click Events for Mood History
    click MHA "https://github.com/cmput301-w25/project-vibecheck/tree/main/code/app/src/main/java/com/example/vibecheck/ui/history"
    click MH "https://github.com/cmput301-w25/project-vibecheck/tree/main/code/app/src/main/java/com/example/vibecheck/ui/history"
    click MFF "https://github.com/cmput301-w25/project-vibecheck/tree/main/code/app/src/main/java/com/example/vibecheck/ui/history"
    click MHE "https://github.com/cmput301-w25/project-vibecheck/tree/main/code/app/src/main/java/com/example/vibecheck/ui/history"
    click MHEA "https://github.com/cmput301-w25/project-vibecheck/tree/main/code/app/src/main/java/com/example/vibecheck/ui/history"

    %% Click Events for Comments
    click C "https://github.com/cmput301-w25/project-vibecheck/tree/main/code/app/src/main/java/com/example/vibecheck/ui/comments"
    click CA "https://github.com/cmput301-w25/project-vibecheck/tree/main/code/app/src/main/java/com/example/vibecheck/ui/comments"

    %% Click Events for Business/Utility Layer
    click MU "https://github.com/cmput301-w25/project-vibecheck/tree/main/code/app/src/main/java/com/example/vibecheck"
    click NSC "https://github.com/cmput301-w25/project-vibecheck/tree/main/code/app/src/main/java/com/example/vibecheck"
    click U "https://github.com/cmput301-w25/project-vibecheck/tree/main/code/app/src/main/java/com/example/vibecheck"

    %% Click Event for Data and Resource Layer
    click RES "https://github.com/cmput301-w25/project-vibecheck/tree/main/code/app/src/main/res"

    %% Click Events for Testing & Build Configuration
    click Test "https://github.com/cmput301-w25/project-vibecheck/tree/main/code/app/src/test"
    click Build "https://github.com/cmput301-w25/project-vibecheck/blob/main/code/app/build.gradle.kts"

    %% Styles
    classDef ui fill:#AED6F1,stroke:#3498DB,stroke-width:2px,color:#1A5276;
    classDef business fill:#FAD7A0,stroke:#E67E22,stroke-width:2px,color:#9C640C;
    classDef resource fill:#D5F5E3,stroke:#27AE60,stroke-width:2px,color:#145A32;
    classDef test fill:#F5B7B1,stroke:#E74C3C,stroke-width:2px,color:#641E16;
    classDef build fill:#D2B4DE,stroke:#8E44AD,stroke-width:2px,color:#4A235A;
```
