# ashinch/readyou architecture

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

- Interactive diagram: https://gitdiagram.com/ashinch/readyou
- Repository: https://github.com/ashinch/readyou

## Overview

##### Project type and purpose
- “Read You” is a native Android RSS‐reader app built with Jetpack Compose (Material You).
- It follows a layered, clean-architecture/MVVM style: Presentation (Compose UI + ViewModels), Domain (business logic, use-cases), Data/Infrastructure (Room DB, Retrofit network, cache, preferences), plus integration with external RSS provider APIs (Fever, Google Reader, FreshRSS, OPML).

##### File structure
- Top-level “app” module contains all code.
- src/main/java/me/ash/reader splits into:
- domain: model, repository interfaces, service/use-case classes, SyncWorker
- infrastructure: Android entry points (AndroidApp, MainActivity), DI modules, network layer (Retrofit, OkHttp), DB layer (Room + DAOs), cache, preferences, HTML parsing, exception handling
- ui: Compose components (base, menu, reader, swipe, webview), extensions, motion, pages (startup, home/feeds/flow/reading, settings, troubleshooting) and theme/palette code
- build scripts, Gradle settings, tests, fastlane metadata, signing configs

##### README for additional insights
- Describes supported features (subscribe, OPML import/export, notifications, readability, multi-account, Bionic Reading, TTS)
- Enumerates third-party integrations (Fever, Google Reader, FreshRSS)
- Notes Jetpack Compose, GitHub Actions CI/CD

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        UI["UI Components"]:::frontend
        VM_Home["HomeViewModel"]:::frontend
        VM_Feeds["FeedsViewModel"]:::frontend
        VM_Flow["FlowViewModel"]:::frontend
        VM_Reading["ReadingViewModel"]:::frontend
        VM_Update["UpdateViewModel"]:::frontend
    end

    %% Domain Layer
    subgraph "Domain Layer"
        direction TB
        Models["Domain Models"]:::domain
        Repos["Repository Interfaces"]:::domain
        Services["Use-Cases / Services"]:::domain
        Sync["SyncWorker (WorkManager)"]:::job
    end

    %% Data/Infrastructure Layer
    subgraph "Data/Infrastructure Layer"
        direction TB
        DB["AndroidDatabase"]:::infra_cylinder
        DI["DI Container"]:::di
        NetworkDS["NetworkDataSource"]:::infra
        RetrofitMod["RetrofitModule"]:::infra
        OkHttpMod["OkHttpClientModule"]:::infra
        OPMLDS["OPMLDataSource"]:::infra
        Cache["DiffMapHolder (Cache)"]:::infra
        Prefs["SettingsProvider"]:::infra
        HTML["Readability / RYArticleGrabberExtended"]:::infra
        Exception["Exception Handling"]:::infra
        AndroidApp["AndroidApp"]:::infra
        MainAct["MainActivity"]:::infra
        WorkerMod["WorkerModule"]:::infra
        Crash["CrashHandler"]:::infra
        Notif["NotificationHelper"]:::infra
        ImgDL["AndroidImageDownloader"]:::infra
    end

    %% External Systems
    subgraph "External Systems"
        direction TB
        CloudFever["Fever API"]:::external
        CloudGReader["Google Reader API"]:::external
        CloudFreshRSS["FreshRSS / OPML"]:::external
    end

    %% Connections
    UI -->|invokes| VM_Home
    UI -->|invokes| VM_Feeds
    UI -->|invokes| VM_Flow
    UI -->|invokes| VM_Reading
    UI -->|invokes| VM_Update

    VM_Home -->|calls| Services
    VM_Feeds -->|calls| Services
    VM_Flow -->|calls| Services
    VM_Reading -->|calls| Services
    VM_Update -->|calls| Services

    Services -->|use| Repos
    Services -->|trigger| Sync

    Repos -->|implemented by| DB
    Repos -->|implemented by| NetworkDS

    NetworkDS -->|uses| RetrofitMod
    NetworkDS -->|uses| OkHttpMod
    NetworkDS -->|uses| OPMLDS

    Sync -->|runs on| WorkerMod
    Sync -->|orchestrates| Services

    DB -->|stores data| DB

    Services -->|fetch| HTML
    Services -->|cache via| Cache
    Services -->|load settings| Prefs

    DI -->|injects into| UI
    DI -->|injects into| VM_Home
    DI -->|injects into| VM_Feeds
    DI -->|injects into| VM_Flow
    DI -->|injects into| VM_Reading
    DI -->|injects into| VM_Update
    DI -->|provides| RetrofitMod
    DI -->|provides| OkHttpMod
    DI -->|provides| WorkerMod

    AndroidApp -->|launches| MainAct
    MainAct -->|hosts| UI
    MainAct -->|uses| DI

    Crash -->|captures| MainAct
    Notif -->|sends| UI
    ImgDL -->|downloads| UI

    NetworkDS -->|http calls| CloudFever
    NetworkDS -->|http calls| CloudGReader
    NetworkDS -->|http calls| CloudFreshRSS

    %% Click Events
    click UI "https://github.com/ashinch/readyou/tree/main/app/src/main/java/me/ash/reader/ui"
    click VM_Home "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/ui/page/home/HomeViewModel.kt"
    click VM_Feeds "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/ui/page/home/feeds/FeedsViewModel.kt"
    click VM_Flow "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/ui/page/home/flow/FlowViewModel.kt"
    click VM_Reading "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/ui/page/home/reading/ReadingViewModel.kt"
    click VM_Update "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/ui/page/settings/tips/UpdateViewModel.kt"
    click Models "https://github.com/ashinch/readyou/tree/main/app/src/main/java/me/ash/reader/domain/model"
    click Repos "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/domain/repository/AccountDao.kt"
    click Repos "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/domain/repository/FeedDao.kt"
    click Repos "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/domain/repository/ArticleDao.kt"
    click Repos "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/domain/repository/GroupDao.kt"
    click Services "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/domain/service/RssService.kt"
    click Services "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/domain/service/FeverRssService.kt"
    click Services "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/domain/service/GoogleReaderRssService.kt"
    click Services "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/domain/service/LocalRssService.kt"
    click Services "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/domain/service/OpmlService.kt"
    click Services "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/domain/service/AccountService.kt"
    click Sync "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/domain/service/SyncWorker.kt"
    click DB "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/infrastructure/db/AndroidDatabase.kt"
    click RetrofitMod "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/infrastructure/di/RetrofitModule.kt"
    click OkHttpMod "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/infrastructure/di/OkHttpClientModule.kt"
    click OPMLDS "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/infrastructure/rss/OPMLDataSource.kt"
    click Cache "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/infrastructure/cache/DiffMapHolder.kt"
    click Prefs "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/infrastructure/preference/SettingsProvider.kt"
    click HTML "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/infrastructure/html/Readability.kt"
    click Exception "https://github.com/ashinch/readyou/tree/main/app/src/main/java/me/ash/reader/infrastructure/exception"
    click AndroidApp "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/infrastructure/android/AndroidApp.kt"
    click MainAct "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/infrastructure/android/MainActivity.kt"
    click WorkerMod "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/infrastructure/di/WorkerModule.kt"
    click Crash "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/infrastructure/android/CrashHandler.kt"
    click Notif "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/infrastructure/android/NotificationHelper.kt"
    click ImgDL "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/infrastructure/android/AndroidImageDownloader.kt"
    click CloudFever "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/infrastructure/rss/provider/fever/FeverAPI.kt"
    click CloudGReader "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/infrastructure/rss/provider/greader/GoogleReaderAPI.kt"
    click CloudFreshRSS "https://github.com/ashinch/readyou/blob/main/app/src/main/java/me/ash/reader/infrastructure/rss/OPMLDataSource.kt"

    %% Styles
    classDef frontend fill:#a8e6cf,stroke:#379683,stroke-width:2px
    classDef domain fill:#ffd3b6,stroke:#ff8b94,stroke-width:2px
    classDef infra fill:#dcedc1,stroke:#00b894,stroke-width:2px
    classDef infra_cylinder fill:#74b9ff,stroke:#0984e3,stroke-width:2px
    classDef di fill:#ffeaa7,stroke:#fdcb6e,stroke-width:2px,shape:octagon
    classDef job fill:#e17055,stroke:#d63031,stroke-width:2px,shape:parallelogram
    classDef external fill:#b2bec3,stroke:#636e72,stroke-width:2px
```
