# felixwiemuth/simplereminder architecture

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

- Interactive diagram: https://gitdiagram.com/felixwiemuth/simplereminder
- Repository: https://github.com/felixwiemuth/simplereminder

## Overview

##### And Label Main Components
- UI Layer:
- Activities and Fragments (e.g., RemindersListActivity, ReminderDialogActivity, SettingsActivity, and various fragments such as NotificationSettingsFragment, RemindersListFragment, and UISettingsFragment).
- Layout resources under app/src/main/res/layout that show how different screens and dialogs (like AddReminderDialogActivity and EditReminderDialogActivity) are designed.

- Domain / Business Logic Layer:
- Reminder Manager and Reminder Storage classes (ReminderManager, ReminderStorage) and the Reminder data model (in the “data” package).
- Related logic classes for managing reminder state (the util package includes AlarmManagerUtil, DateSerializer, DateTimeUtil, etc).

- Service/Background Layer:
- Broadcast receivers and services that handle system events (BootReceiver, ReminderBroadcastReceiver, QuickTileService).
- These components are crucial to managing alarms and notifications (e.g., scheduling via AlarmManager).

- Utility and Helper Components:
- Utility classes (like OneTimeClickListener, UIUtils, ImplementationError) that support UI and core functionalities.

- Configuration and Build:
- Gradle files (build.gradle, settings.gradle, gradle.properties) indicate project dependencies and build configuration.
- The AndroidManifest.xml, which is the entry point for Android’s app lifecycle management, specifying services, receivers, and activities.

##### Relationships and Interactions
- Data Flow:
- A user interacts with the UI (e.g., clicking “Add Reminder” triggers an Activity which calls ReminderManager and ReminderStorage to save reminder details).
- The ReminderManager schedules notifications using AlarmManager, which then triggers the ReminderBroadcastReceiver when a reminder is due.

- Component Interactions:
- UI activities and fragments communicate with backend logic (domain layer) to create, update, or fetch reminders.
- Broadcast receivers like BootReceiver ensure that alarms or scheduled reminders are re-established after events such as device reboot.
- QuickTileService is an entry point from the quick settings menu that directly opens an add reminder dialog.

##### Architectural Patterns and Design Principles
- Layered Architecture:
- The structure follows separation of concerns, where the UI layer is isolated from business logic and background services.

- Event-driven / Observer:
- Broadcast Receivers listen for system events (e.g., boot, alarm triggers) and ensure the correct flow of reminder notifications.

- Modular Design:
- Even though it doesn’t strictly enforce MVC/MVVM, the separation into UI, domain, and utility components suggests a modular design with clear responsibilities.

##### Relevant Technologies and Frameworks
- Android-specific components (Activities, Services, BroadcastReceivers, Notifications).
- Kotlin and Java are used across various parts of the application.
- Gradle is used for build configuration, which might also include dependency management for libraries used for UI, networking, or database operations (if applicable).

## Diagram (Mermaid)

```mermaid
graph TD
    U["User"]:::user

    subgraph "UI Layer"
        A1["RemindersListActivity"]:::ui
        A2["ReminderDialogActivity"]:::ui
        A3["SettingsActivity"]:::ui
        F1["NotificationSettingsFragment"]:::ui
        F2["RemindersListFragment"]:::ui
        F3["UISettingsFragment"]:::ui
        L["Layout Resources"]:::ui
    end

    subgraph "Domain / Business Logic"
        D1["ReminderManager"]:::domain
        D2["ReminderStorage"]:::domain
        D3["Reminder (Data Model)"]:::domain
    end

    subgraph "Utility & Helpers"
        U1["AlarmManagerUtil"]:::util
        U2["DateSerializer"]:::util
        U3["DateTimeUtil"]:::util
        U4["OneTimeClickListener"]:::util
        U5["UIUtils"]:::util
        U6["ImplementationError"]:::util
    end

    subgraph "Service / Background"
        S1["BootReceiver"]:::service
        S2["ReminderBroadcastReceiver"]:::service
        S3["QuickTileService"]:::service
    end

    subgraph "Configuration & Build"
        C1["AndroidManifest.xml"]:::config
        C2["app/build.gradle"]:::config
        C3["build.gradle"]:::config
        C4["settings.gradle"]:::config
        C5["gradle.properties"]:::config
    end

    U -->|"triggers"| A1
    A1 -->|"calls"| D1
    F2 -->|"fetches"| D1
    A2 -->|"createsUpdates"| D1
    A3 -->|"opens"| F3

    D1 -->|"schedules"| U1
    D1 -->|"stores"| D2
    D1 -->|"uses"| D3

    U1 -->|"triggers"| S2
    S1 -->|"reEstablishes"| U1

    S2 -->|"notifies"| A1
    S3 -->|"launches"| A2

    classDef ui fill:#AED6F1,stroke:#2471A3,stroke-width:2px;
    classDef domain fill:#ABEBC6,stroke:#1E8449,stroke-width:2px;
    classDef util fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef service fill:#FAD7A0,stroke:#D35400,stroke-width:2px;
    classDef config fill:#EBDEF0,stroke:#7D3C98,stroke-width:2px;
    classDef user fill:#D6EAF8,stroke:#21618C,stroke-width:2px;

    click A1 "https://github.com/felixwiemuth/simplereminder/blob/develop/app/src/main/java/felixwiemuth/simplereminder/ui/reminderslist/RemindersListActivity.kt"
    click A2 "https://github.com/felixwiemuth/simplereminder/blob/develop/app/src/main/java/felixwiemuth/simplereminder/ui/ReminderDialogActivity.kt"
    click A3 "https://github.com/felixwiemuth/simplereminder/blob/develop/app/src/main/java/felixwiemuth/simplereminder/ui/SettingsActivity.kt"

    click F1 "https://github.com/felixwiemuth/simplereminder/blob/develop/app/src/main/java/felixwiemuth/simplereminder/ui/NotificationSettingsFragment.kt"
    click F2 "https://github.com/felixwiemuth/simplereminder/blob/develop/app/src/main/java/felixwiemuth/simplereminder/ui/reminderslist/RemindersListFragment.kt"
    click F3 "https://github.com/felixwiemuth/simplereminder/blob/develop/app/src/main/java/felixwiemuth/simplereminder/ui/UISettingsFragment.kt"

    click L "https://github.com/felixwiemuth/simplereminder/tree/develop/app/src/main/res/layout"

    click D1 "https://github.com/felixwiemuth/simplereminder/blob/develop/app/src/main/java/felixwiemuth/simplereminder/ReminderManager.kt"
    click D2 "https://github.com/felixwiemuth/simplereminder/blob/develop/app/src/main/java/felixwiemuth/simplereminder/ReminderStorage.kt"
    click D3 "https://github.com/felixwiemuth/simplereminder/blob/develop/app/src/main/java/felixwiemuth/simplereminder/data/Reminder.kt"

    click U1 "https://github.com/felixwiemuth/simplereminder/blob/develop/app/src/main/java/felixwiemuth/simplereminder/util/AlarmManagerUtil.kt"
    click U2 "https://github.com/felixwiemuth/simplereminder/blob/develop/app/src/main/java/felixwiemuth/simplereminder/util/DateSerializer.kt"
    click U3 "https://github.com/felixwiemuth/simplereminder/blob/develop/app/src/main/java/felixwiemuth/simplereminder/util/DateTimeUtil.java"
    click U4 "https://github.com/felixwiemuth/simplereminder/blob/develop/app/src/main/java/felixwiemuth/simplereminder/util/OneTimeClickListener.kt"
    click U5 "https://github.com/felixwiemuth/simplereminder/blob/develop/app/src/main/java/felixwiemuth/simplereminder/ui/util/UIUtils.kt"
    click U6 "https://github.com/felixwiemuth/simplereminder/blob/develop/app/src/main/java/felixwiemuth/simplereminder/util/ImplementationError.java"

    click S1 "https://github.com/felixwiemuth/simplereminder/blob/develop/app/src/main/java/felixwiemuth/simplereminder/BootReceiver.kt"
    click S2 "https://github.com/felixwiemuth/simplereminder/blob/develop/app/src/main/java/felixwiemuth/simplereminder/ReminderBroadcastReceiver.kt"
    click S3 "https://github.com/felixwiemuth/simplereminder/blob/develop/app/src/main/java/felixwiemuth/simplereminder/QuickTileService.kt"

    click C1 "https://github.com/felixwiemuth/simplereminder/blob/develop/app/src/main/AndroidManifest.xml"
    click C2 "https://github.com/felixwiemuth/simplereminder/blob/develop/app/build.gradle"
    click C3 "https://github.com/felixwiemuth/simplereminder/blob/develop/build.gradle"
    click C4 "https://github.com/felixwiemuth/simplereminder/blob/develop/settings.gradle"
    click C5 "https://github.com/felixwiemuth/simplereminder/blob/develop/gradle.properties"
```
