# sonykar/usn.-android-group-project architecture

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

- Interactive diagram: https://gitdiagram.com/sonykar/usn.-android-group-project
- Repository: https://github.com/sonykar/usn.-android-group-project

## Overview

##### Key Components
- User Interface Layer: Represented by the various Activities (e.g., LoginActivity, SignUpActivity, CourseListActivity, etc.) and the supporting layouts (XML files under res/layout) and navigation components (MenuDrawer). This layer handles user interactions.
- Business Logic and Controllers: Shown as the controllers such as CourseController, CourseFilter, CourseSort, and the PictureController. These handle the main processing logic and mediate between the UI and data layers.
- Data Models: Include all model classes (e.g., Course, User, Category, Comment, etc.) located under the models package. These define the objects being manipulated across the system.
- Data Persistence/Database Layer: Indicated by the various database classes (e.g., CategoryDatabase, CourseDatabase, CommentDatabase, etc.) which interact with the underlying storage (likely backed by cloud services or local storage).
- External Services and Notifications: Include components related to notifications (FirebaseMessagingService, NotificationSender, APIService, etc.) and integration with Google services (google-services.json), showing how external events are managed.
- Utility and Miscellaneous: This covers adapters (that populate UI components like lists), constants, validations, and testing files (androidTest and test directories) used to ensure functionality and maintain code integrity.

##### Relationships and Interactions
- Notification & External Services: Outline how notifications are sent and received (Firebase services, API calls) and indicate integration with Google services.
- Utilities like Adapters: Show utility classes (adapters) as supporting the UI layer by binding data models to views.

##### Architectural Patterns to Highlight
- MVC-like Structure: Although Android architecture sometimes follows MVVM or MVP, here the separation between Activities (view), Controllers (logic), and Data classes (model) implies an MVC-like design.
- Testing Layer: Separate a unit/instrumentation testing section to indicate quality assurance supports.

##### Relevant Technologies and Frameworks
- Android SDK: All activities, layouts, and Android resource files imply the use of the Android framework.
- Firebase/Google Services: Presence of google-services.json and Firebase messaging classes suggest integration with Firebase or Google APIs.
- Gradle Build System: Shown through the build.gradle and settings.gradle files.
- Standard Java (or Kotlin) for business logic: Organize the code into packages for models, controllers, and utilities.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "User Interface Layer"
        UI_Activities("Activities (e.g., LoginActivity, SignUpActivity, etc.)"):::ui
        UI_Layouts("Layout Files (XML)"):::ui
        UI_Menu("MenuDrawer"):::ui
    end

    subgraph "Business Logic and Controllers"
        BL_Controllers("Controllers (CourseController, PictureController, etc.)"):::bl
    end

    subgraph "Data Models"
        DM_Models("Models (Course, User, Category, Comment, etc.)"):::data
        DM_Constants("Constants & Data Definitions"):::data
    end

    subgraph "Data Persistence/Database"
        DB_Database("Database Classes (CRUD operations)"):::db
    end

    subgraph "External Services and Notifications"
        ES_Notifications("Notifications & External Services"):::external
        ES_Google("Google Services Integration"):::external
    end

    subgraph "Utility and Miscellaneous"
        UT_Adapters("Adapters (UI Data Binding)"):::utility
        UT_Validations("Validations"):::utility
        UT_AndroidTest("Android Testing"):::utility
        UT_UnitTest("Unit Testing"):::utility
    end

    %% Relationships
    UI_Activities -->|"userInput"| BL_Controllers
    UI_Layouts -->|"renderUI"| UI_Activities
    UI_Menu -->|"assistNavigation"| UI_Activities

    BL_Controllers -->|"processData"| DM_Models
    BL_Controllers -->|"useConstants"| DM_Constants
    BL_Controllers <-->|"CRUD"| DB_Database
    BL_Controllers -->|"triggerNotify"| ES_Notifications

    ES_Notifications -->|"integrateWith"| ES_Google

    DM_Models -->|"bindsTo"| UT_Adapters
    UT_Adapters -->|"populates"| UI_Activities

    UT_Validations -->|"validate"| BL_Controllers

    UT_AndroidTest -->|"tests"| UI_Activities
    UT_AndroidTest -->|"tests"| BL_Controllers
    UT_AndroidTest -->|"tests"| DB_Database
    UT_AndroidTest -->|"tests"| ES_Notifications

    UT_UnitTest -->|"tests"| UI_Activities
    UT_UnitTest -->|"tests"| BL_Controllers
    UT_UnitTest -->|"tests"| DB_Database
    UT_UnitTest -->|"tests"| ES_Notifications

    %% Click Events
    click UI_Activities "https://github.com/sonykar/usn.-android-group-project/tree/main/app/src/main/java/com/example/mobproject/"
    click UI_Layouts "https://github.com/sonykar/usn.-android-group-project/tree/main/app/src/main/res/layout"
    click UI_Menu "https://github.com/sonykar/usn.-android-group-project/blob/main/app/src/main/java/com/example/mobproject/navigation/MenuDrawer.java"
    click BL_Controllers "https://github.com/sonykar/usn.-android-group-project/tree/main/app/src/main/java/com/example/mobproject/controllers"
    click DM_Models "https://github.com/sonykar/usn.-android-group-project/tree/main/app/src/main/java/com/example/mobproject/models"
    click DM_Constants "https://github.com/sonykar/usn.-android-group-project/tree/main/app/src/main/java/com/example/mobproject/constants"
    click DB_Database "https://github.com/sonykar/usn.-android-group-project/tree/main/app/src/main/java/com/example/mobproject/db"
    click ES_Notifications "https://github.com/sonykar/usn.-android-group-project/tree/main/app/src/main/java/com/example/mobproject/notifications"
    click ES_Google "https://github.com/sonykar/usn.-android-group-project/blob/main/app/google-services.json"
    click UT_Adapters "https://github.com/sonykar/usn.-android-group-project/tree/main/app/src/main/java/com/example/mobproject/adapters"
    click UT_Validations "https://github.com/sonykar/usn.-android-group-project/tree/main/app/src/main/java/com/example/mobproject/validations"
    click UT_AndroidTest "https://github.com/sonykar/usn.-android-group-project/tree/main/app/src/androidTest"
    click UT_UnitTest "https://github.com/sonykar/usn.-android-group-project/tree/main/app/src/test"

    %% Styles
    classDef ui fill:#AEDFF7,stroke:#1A85FF,stroke-width:2px;
    classDef bl fill:#FFEFAA,stroke:#FFC107,stroke-width:2px;
    classDef data fill:#C8E6C9,stroke:#43A047,stroke-width:2px;
    classDef db fill:#F8BBD0,stroke:#E91E63,stroke-width:2px;
    classDef external fill:#D1C4E9,stroke:#673AB7,stroke-width:2px;
    classDef utility fill:#FFCDD2,stroke:#E53935,stroke-width:2px;
```
