# shayann07/to-do-list-offline architecture

> Architecture diagram of the GitHub repository shayann07/to-do-list-offline, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shayann07/to-do-list-offline
- Repository: https://github.com/shayann07/to-do-list-offline

## Overview

##### Project type and purpose
- Type: Android mobile application (single installable APK)
- Purpose: Offline first to-do list manager using MVVM and Room

##### File structure
- Two Gradle modules:
– app (the main Android application)
– library (a reusable BlurView UI component)
- Inside app:
– data/local: Room database (AppDatabase.kt), DAOs, entity models
– data/repository: Repository abstraction for data access
– ui/fragments & MainActivity: Presentation layer
– ui/viewmodel: ViewModels exposing LiveData to the UI
– utils: Helper classes (AlarmManagerHelper, Notification, etc.)
- Tests:
– unit tests under app/src/test
– instrumentation tests under app/src/androidTest
- Build scripts, configuration:
– Gradle Kotlin DSL (build.gradle.kts), proguard, versions.toml

##### README
- Confirms MVVM, Room, LiveData, RecyclerViews
- Describes three UI categories (Morning, Afternoon, Tonight)
- Emphasizes 100% offline operation

a. Presentation Layer
– MainActivity
– UI Fragments (TodayFragment, NewReminderFragment, etc.)
– RecyclerView adapters
b. ViewModel Layer
– Single ViewModel class per screen (e.g., ViewModel.kt)
– Exposes LiveData<List<Task>>
c. Data Layer
– Repository (Repository.kt)
– Room Database (AppDatabase)
– DAO (TasksDao)
– Data models/entities (Tasks.kt)
d. Utility & External Libraries
– AlarmManagerHelper & Notification utils
– BlurView library module (external UI component)
e. Build & Test
– Gradle build system
– Unit and instrumentation test bins

##### Relationships & interactions
- User taps in UI (Fragments) → Fragment calls ViewModel
- ViewModel requests data from Repository
- Repository uses DAO to query/update Room DB
- DAO returns entities → Repository → ViewModel → LiveData updates UI
- Utilities invoked (AlarmManagerHelper schedules alarms via Android AlarmManager; Notification triggers system notifications)
- Library module supplies BlurView UI component used in layouts

##### Architectural patterns & design principles
- MVVM separation of concerns
- Repository pattern abstracts data source
- Single source of truth in Room DB
- LiveData for reactive UI updates
- Gradle modularization (app vs. library)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        MA["MainActivity"]:::presentation
        AF["AllFragment"]:::presentation
        CF["CompletedFragment"]:::presentation
        FF["FlaggedFragment"]:::presentation
        HF["HomeFragment"]:::presentation
        NF["NewReminderFragment"]:::presentation
        OF["OutlookFragment"]:::presentation
        SF["ScheduledFragment"]:::presentation
        TDF["TaskDetailsFragment"]:::presentation
        TF["TodayFragment"]:::presentation
        ICF["iCloudFragment"]:::presentation
        TA["TaskAdapter"]:::presentation
    end

    %% ViewModel Layer
    subgraph "ViewModel Layer"
        direction TB
        VM["ViewModel"]:::viewmodel
    end

    %% Data Layer
    subgraph "Data Layer"
        direction TB
        Repo["Repository"]:::data
        DAO["TasksDao"]:::data
        DB["AppDatabase"]:::data
        Model["Tasks Entity"]:::data
    end

    %% Utility Layer
    subgraph "Utility Layer"
        direction TB
        AMH["AlarmManagerHelper"]:::utility
        NOTIF["Notification"]:::utility
        PTR["PullToRefreshUtil"]:::utility
        TE["ToastExtensions"]:::utility
    end

    %% External Library
    subgraph "External Library"
        direction TB
        BVMOD["BlurView Module"]:::external
        BVIEW["BlurView"]:::external
    end

    %% Android OS / Device
    subgraph "Android OS / Device"
        direction TB
        ALM["Android AlarmManager Service"]:::os
        STORAGE["Local Storage"]:::os
    end

    %% Data Flow
    MA -->|uses| AF
    AF -->|"binds to"| TA
    AF -->|"calls"| VM
    MA -->|"calls"| VM
    TA -->|"observes LiveData"| VM

    VM -->|"getTasks()"| Repo
    Repo -->|"query()"| DAO
    DAO -->|"reads/writes"| DB
    DAO -->|returns Entities| Repo
    Repo -->|returns List<Tasks>| VM
    VM -->|updates LiveData| AF

    AF -->|schedules| AMH
    AF -->|triggers| NOTIF
    AMH -->|uses| ALM
    NOTIF -->|writes| STORAGE

    AF -->|includes BlurView UI| BVIEW
    BVMOD -->|provides| BVIEW

    %% Click Events
    click MA "https://github.com/shayann07/to-do-list-offline/blob/master/app/src/main/java/com/shayan/remindersios/ui/MainActivity.kt"
    click AF "https://github.com/shayann07/to-do-list-offline/blob/master/app/src/main/java/com/shayan/remindersios/ui/fragments/AllFragment.kt"
    click CF "https://github.com/shayann07/to-do-list-offline/blob/master/app/src/main/java/com/shayan/remindersios/ui/fragments/CompletedFragment.kt"
    click FF "https://github.com/shayann07/to-do-list-offline/blob/master/app/src/main/java/com/shayan/remindersios/ui/fragments/FlaggedFragment.kt"
    click HF "https://github.com/shayann07/to-do-list-offline/blob/master/app/src/main/java/com/shayan/remindersios/ui/fragments/HomeFragment.kt"
    click NF "https://github.com/shayann07/to-do-list-offline/blob/master/app/src/main/java/com/shayan/remindersios/ui/fragments/NewReminderFragment.kt"
    click OF "https://github.com/shayann07/to-do-list-offline/blob/master/app/src/main/java/com/shayan/remindersios/ui/fragments/OutlookFragment.kt"
    click SF "https://github.com/shayann07/to-do-list-offline/blob/master/app/src/main/java/com/shayan/remindersios/ui/fragments/ScheduledFragment.kt"
    click TDF "https://github.com/shayann07/to-do-list-offline/blob/master/app/src/main/java/com/shayan/remindersios/ui/fragments/TaskDetailsFragment.kt"
    click TF "https://github.com/shayann07/to-do-list-offline/blob/master/app/src/main/java/com/shayan/remindersios/ui/fragments/TodayFragment.kt"
    click ICF "https://github.com/shayann07/to-do-list-offline/blob/master/app/src/main/java/com/shayan/remindersios/ui/fragments/iCloudFragment.kt"
    click TA "https://github.com/shayann07/to-do-list-offline/blob/master/app/src/main/java/com/shayan/remindersios/adapters/TaskAdapter.kt"
    click VM "https://github.com/shayann07/to-do-list-offline/blob/master/app/src/main/java/com/shayan/remindersios/ui/viewmodel/ViewModel.kt"
    click Repo "https://github.com/shayann07/to-do-list-offline/blob/master/app/src/main/java/com/shayan/remindersios/data/repository/Repository.kt"
    click DAO "https://github.com/shayann07/to-do-list-offline/blob/master/app/src/main/java/com/shayan/remindersios/data/local/dao/TasksDao.kt"
    click DB "https://github.com/shayann07/to-do-list-offline/blob/master/app/src/main/java/com/shayan/remindersios/data/local/AppDatabase.kt"
    click Model "https://github.com/shayann07/to-do-list-offline/blob/master/app/src/main/java/com/shayan/remindersios/data/models/Tasks.kt"
    click AMH "https://github.com/shayann07/to-do-list-offline/blob/master/app/src/main/java/com/shayan/remindersios/utils/AlarmManagerHelper.kt"
    click NOTIF "https://github.com/shayann07/to-do-list-offline/blob/master/app/src/main/java/com/shayan/remindersios/utils/Notification.kt"
    click PTR "https://github.com/shayann07/to-do-list-offline/blob/master/app/src/main/java/com/shayan/remindersios/utils/PullToRefreshUtil.kt"
    click TE "https://github.com/shayann07/to-do-list-offline/blob/master/app/src/main/java/com/shayan/remindersios/utils/ToastExtensions.kt"
    click BVMOD "https://github.com/shayann07/to-do-list-offline/tree/master/app/library/"
    click BVIEW "https://github.com/shayann07/to-do-list-offline/blob/master/app/library/src/main/java/eightbitlab/com/blurview/BlurView.java"

    %% Styles
    classDef presentation fill:#BBDEFB,stroke:#1E88E5,color:#0D47A1
    classDef viewmodel fill:#C8E6C9,stroke:#43A047,color:#1B5E20
    classDef data fill:#FFE0B2,stroke:#FB8C00,color:#E65100
    classDef utility fill:#ECEFF1,stroke:#90A4AE,color:#455A64
    classDef external fill:#E1BEE7,stroke:#8E24AA,color:#4A148C
    classDef os fill:#FFF9C4,stroke:#FDD835,color:#F57F17
```
