# trantienvn/lichhocictu architecture

> Architecture diagram of the GitHub repository trantienvn/lichhocictu, 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/trantienvn/lichhocictu
- Repository: https://github.com/trantienvn/lichhocictu

## Overview

##### Main Components
- Android UI Layer: This includes Activities (e.g., LoginActivity, AboutActivity, WeekActivity, and StudentInfoActivity) and Fragments (such as AddScheduleFragment, TestScheduleFragment, etc.) found under the “views” directory. These components handle user interactions and display data.
- Data Layer:
– Data Sources: Under the “datas” directory you have various packages for handling data. This includes files for integration with external services (e.g., GoogleCalendar.kt, GoogleSignOut.kt), local data management using SQLite (SqLite.kt), and custom data parsing and DOM-based sources (domHTML and parseData packages).
– Models: The “models” directory encapsulates data structures (e.g., NotificationID, RawCalendarCollection, StudentCalendarCollection, TestScheduleCollection, etc.) that represent business objects.
- Service & Notification Layer: Services (FirebaseMessengerService, AppService, ServiceState) and notification handling (AppNotification) are responsible for background operations and alerting users.
- External Libraries/Integrations: Notice the inclusion of external JARs (such as “jxl-2.6.12.1.jar”), Google services (google-services.json), Firebase integration, and configuration files (AndroidManifest.xml) that help integrate the app with external systems.

##### Relationships and Interactions
- The UI components (Activities and Fragments) initiate requests and trigger processes that are handed off to the data layer services.
- Data components fetch and manage data (from local SQLite databases and/or remote resources using DOM HTML and Excel parsing logic) and then supply processed models back to the UI.
- Service components manage background tasks (e.g., Firebase cloud messaging for notifications) and data synchronization, often interacting with both the UI and data sources.
- External APIs or services are integrated via dedicated classes (GoogleCalendar, domHTML/DomLogin, etc.) that encapsulate the logic for communications with external systems.

##### Architectural Patterns and Key Principles
- The structure loosely follows a Model-View-Controller (MVC) or Model-View-Presenter (MVP) pattern seen in many Android projects:
- Views (activities and fragments) communicate with:
- Models (data classes) via
- Controllers/Services (data sources, notifications, and data handling services).
- Modularization: The separation of concerns is clear, with distinct packages for UI, data sources, models, and services.
- Use of external libraries and services (Firebase, Google APIs) is integrated in a way that segments external dependencies from core application logic.

##### Technology Stack and Frameworks
- Android (Java/Kotlin): The “src/main/java” structure suggests Kotlin/Java language usage.
- Gradle: Build configuration is managed via Gradle files (“build.gradle”, “settings.gradle”, etc.).
- Firebase: Noted by the presence of FirebaseMessengerService.
- SQLite: Local database management is handled via SqLite.kt.
- Apache POI or JXL: External library (jxl-2.6.12.1.jar) appears to be used for Excel file handling.

##### Final Elements
- Every major module has a clear label along with submodules as needed.

Happy diagramming!

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% UI Layer
    subgraph "UI Layer"
        LoginActivity["LoginActivity"]:::ui
        AboutActivity["AboutActivity"]:::ui
        WeekActivity["WeekActivity"]:::ui
        StudentInfoActivity["StudentInfoActivity"]:::ui
        AddScheduleFragment["AddScheduleFragment"]:::ui
        TestScheduleFragment["TestScheduleFragment"]:::ui
    end

    %% Data Layer
    subgraph "Data Layer"
        %% Data Sources
        subgraph "Data Sources"
            subgraph "DOM-based Operations"
                DomDownloadExcel["DomDownloadExcel"]:::data
                DomLogin["DomLogin"]:::data
                DomSemesterSchedule["DomSemesterSchedule"]:::data
                DomTestListSchedule["DomTestListSchedule"]:::data
                DomTestSchedule["DomTestSchedule"]:::data
                DomUpdateSchedule["DomUpdateSchedule"]:::data
            end
            subgraph "Parsing and Excel"
                ConvertExcel["ConvertExcel"]:::data
                ParseExcel["ParseExcel"]:::data
                ParseScheduleJson["ParseScheduleJson"]:::data
            end
            SqLite["SqLite"]:::data
            subgraph "External Service Integration"
                GoogleCalendar["GoogleCalendar"]:::data
                GoogleSignOut["GoogleSignOut"]:::data
                FirebaseMessengerService["FirebaseMessengerService"]:::data
            end
        end

        %% Models
        subgraph "Models"
            NotificationID["NotificationID"]:::model
            RawCalendarCollection["RawCalendarCollection"]:::model
            StudentCalendarCollection["StudentCalendarCollection"]:::model
            TestScheduleCollection["TestScheduleCollection"]:::model
            TestScheduleSemesterCollection["TestScheduleSemesterCollection"]:::model
            TestScheduleTypeCollection["TestScheduleTypeCollection"]:::model
            TimeScheduleDetails["TimeScheduleDetails"]:::model
            UrlAddress["UrlAddress"]:::model
        end
    end

    %% Service & Notification Layer
    subgraph "Service & Notification Layer"
        AppNotification["AppNotification"]:::service
        AppService["AppService"]:::service
        ServiceState["ServiceState"]:::service
    end

    %% External Libraries/Configurations
    subgraph "External Libraries/Configurations"
        JXL["jxl-2.6.12.1.jar"]:::external
        GoogleServices["google-services.json"]:::external
        AndroidManifest["AndroidManifest.xml"]:::external
        BuildGradle["build.gradle"]:::external
    end

    %% Relationships from UI to Data Sources
    LoginActivity -->|"triggers"| DomLogin
    LoginActivity -->|"updates"| SqLite
    WeekActivity -->|"fetches_schedule"| DomDownloadExcel
    WeekActivity -->|"gets_data"| ParseExcel
    AddScheduleFragment -->|"updates_schedule"| DomUpdateSchedule
    TestScheduleFragment -->|"tests_schedule"| DomTestSchedule

    %% Relationships within Data Layer
    DomLogin -->|"processes"| NotificationID
    ParseExcel -->|"parses_to"| RawCalendarCollection
    SqLite -->|"stores"| StudentCalendarCollection
    DomUpdateSchedule -->|"updates"| TestScheduleCollection

    %% External Service Integration interacting with Services
    GoogleCalendar -->|"syncs"| AppService
    GoogleSignOut -->|"logs_out_via"| AppNotification
    FirebaseMessengerService -->|"notifies"| AppNotification

    %% Services communicating back to UI
    AppNotification -->|"notifies_UI"| StudentInfoActivity

    %% External Libraries/Configurations interactions
    BuildGradle -->|"builds"| AndroidManifest
    AndroidManifest -->|"configures"| LoginActivity

    %% Click Events for UI Components
    click LoginActivity "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/java/com/indieteam/mytask/views/LoginActivity.kt"
    click AboutActivity "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/java/com/indieteam/mytask/views/AboutActivity.kt"
    click WeekActivity "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/java/com/indieteam/mytask/views/WeekActivity.kt"
    click StudentInfoActivity "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/java/com/indieteam/mytask/views/StudentInfoActivity.kt"
    click AddScheduleFragment "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/java/com/indieteam/mytask/views/AddScheduleFragment.kt"
    click TestScheduleFragment "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/java/com/indieteam/mytask/views/TestScheduleFragment.kt"

    %% Click Events for DOM-based Data Sources
    click DomDownloadExcel "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/java/com/indieteam/mytask/datas/datasources/domHTML/DomDownloadExcel.kt"
    click DomLogin "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/java/com/indieteam/mytask/datas/datasources/domHTML/DomLogin.kt"
    click DomSemesterSchedule "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/java/com/indieteam/mytask/datas/datasources/domHTML/DomSemesterSchedule.kt"
    click DomTestListSchedule "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/java/com/indieteam/mytask/datas/datasources/domHTML/DomTestListSchedule.kt"
    click DomTestSchedule "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/java/com/indieteam/mytask/datas/datasources/domHTML/DomTestSchedule.kt"
    click DomUpdateSchedule "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/java/com/indieteam/mytask/datas/datasources/domHTML/DomUpdateSchedule.kt"

    %% Click Events for Parsing and Excel Data Sources
    click ConvertExcel "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/java/com/indieteam/mytask/datas/datasources/parseData/ConvertExcel.kt"
    click ParseExcel "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/java/com/indieteam/mytask/datas/datasources/parseData/ParseExcel.kt"
    click ParseScheduleJson "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/java/com/indieteam/mytask/datas/datasources/parseData/ParseScheduleJson.kt"

    %% Click Event for SQLite
    click SqLite "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/java/com/indieteam/mytask/datas/SqLite.kt"

    %% Click Events for External Service Integration
    click GoogleCalendar "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/java/com/indieteam/mytask/datas/GoogleCalendar.kt"
    click GoogleSignOut "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/java/com/indieteam/mytask/datas/GoogleSignOut.kt"
    click FirebaseMessengerService "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/java/com/indieteam/mytask/datas/services/FirebaseMessengerService.kt"

    %% Click Events for Service & Notification Layer
    click AppNotification "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/java/com/indieteam/mytask/datas/notifications/AppNotification.kt"
    click AppService "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/java/com/indieteam/mytask/datas/services/AppService.kt"
    click ServiceState "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/java/com/indieteam/mytask/datas/services/ServiceState.kt"

    %% Click Events for Models
    click NotificationID "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/java/com/indieteam/mytask/models/NotificationID.kt"
    click RawCalendarCollection "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/java/com/indieteam/mytask/models/RawCalendarCollection.kt"
    click StudentCalendarCollection "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/java/com/indieteam/mytask/models/StudentCalendarCollection.kt"
    click TestScheduleCollection "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/java/com/indieteam/mytask/models/TestScheduleCollection.kt"
    click TestScheduleSemesterCollection "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/java/com/indieteam/mytask/models/TestScheduleSemesterCollection.kt"
    click TestScheduleTypeCollection "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/java/com/indieteam/mytask/models/TestScheduleTypeCollection.kt"
    click TimeScheduleDetails "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/java/com/indieteam/mytask/models/TimeScheduleDetails.kt"
    click UrlAddress "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/java/com/indieteam/mytask/models/UrlAddress.kt"

    %% Click Events for External Libraries/Configurations
    click JXL "https://github.com/trantienvn/lichhocictu/blob/main/app/libs/jxl-2.6.12.1.jar"
    click GoogleServices "https://github.com/trantienvn/lichhocictu/blob/main/app/google-services.json"
    click AndroidManifest "https://github.com/trantienvn/lichhocictu/blob/main/app/src/main/AndroidManifest.xml"
    click BuildGradle "https://github.com/trantienvn/lichhocictu/blob/main/app/build.gradle"

    %% Styles
    classDef ui fill:#cce5ff,stroke:#004085,color:#004085,stroke-width:2px;
    classDef data fill:#d4edda,stroke:#155724,color:#155724,stroke-width:2px;
    classDef service fill:#fff3cd,stroke:#856404,color:#856404,stroke-width:2px;
    classDef external fill:#f8d7da,stroke:#721c24,color:#721c24,stroke-width:2px;
    classDef model fill:#e2e3e5,stroke:#6c757d,color:#6c757d,stroke-width:2px;
```
