# lowi-kr/flow architecture

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

- Interactive diagram: https://gitdiagram.com/lowi-kr/flow
- Repository: https://github.com/lowi-kr/flow
- Video tour (about a minute): https://gitdiagram.com/lowi-kr/flow/video

## Overview

Flow is a privacy-focused Android YouTube and YouTube Music client. Users discover videos, music, and Shorts; play or download media; and manage a local library. FlowNeuro learns from viewing and other engagement on-device to personalize discovery. The README documents these capabilities, while the supplied source excerpts and index identify several implementation layers. Because UI wiring and many feature implementations were not sampled, the graph shows documented product relationships without asserting unverified call chains.

Main entry points: [`app/src/main/java/io/github/aedev/flow/MainActivity.kt`](https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/MainActivity.kt) (Android client), [`app/src/main/java/io/github/aedev/flow/data/recommendation/FlowNeuroEngine.kt`](https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/data/recommendation/FlowNeuroEngine.kt) (FlowNeuro engine), [`app/src/main/java/io/github/aedev/flow/data/local/ViewHistory.kt`](https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/data/local/ViewHistory.kt) (Watch history), [`app/src/main/java/io/github/aedev/flow/innertube/YouTube.kt`](https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/innertube/YouTube.kt) (YouTube API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App entry"]
  node_main["Android client<br/>[MainActivity.kt]"]
end

subgraph group_discovery["Discovery and data"]
  node_youtube_repo["YouTube data"]
  node_innertube["YouTube API<br/>[YouTube.kt]"]
  node_newpipe["Stream extraction<br/>[NewPipe.kt]"]
  node_shorts["Shorts discovery"]
  node_music_data["Music catalog"]
end

subgraph group_playback["Playback and media"]
  node_video_player["Video playback"]
  node_music_service["Music playback"]
  node_downloads["Video downloads"]
  node_lyrics["Lyrics lookup<br/>[LyricsHelper.kt]"]
end

subgraph group_library["Local library"]
  node_database[("Local database<br/>[AppDatabase.kt]")]
  node_subscriptions["Subscriptions"]
  node_history["Watch history<br/>[ViewHistory.kt]"]
  node_preferences["Player preferences"]
end

subgraph group_personalization["Personalization"]
  node_neuro["FlowNeuro engine<br/>[FlowNeuroEngine.kt]"]
  node_interest["Interest profile<br/>[InterestProfile.kt]"]
end

node_user(("Flow user"))

node_user -->|"uses"| node_main
node_main -.->|"browses content"| node_youtube_repo
node_youtube_repo -->|"fetches data"| node_innertube
node_innertube -->|"extracts streams"| node_newpipe
node_main -.->|"discovers Shorts"| node_shorts
node_main -.->|"browses music"| node_music_data
node_music_data -->|"queries catalog"| node_innertube
node_main -.->|"plays video"| node_video_player
node_main -.->|"plays music"| node_music_service
node_main -.->|"downloads media"| node_downloads
node_music_service -->|"loads lyrics"| node_lyrics
node_main -.->|"manages subscriptions"| node_subscriptions
node_main -.->|"records watches"| node_history
node_subscriptions -.->|"stores locally"| node_database
node_history -.->|"stores locally"| node_database
node_main -.->|"personalizes discovery"| node_neuro
node_neuro -->|"reads settings"| node_preferences
node_neuro -.->|"updates profile"| node_interest
node_history -.->|"learns from watches"| node_neuro

click node_main "https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/MainActivity.kt"
click node_youtube_repo "https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/data/repository/YouTubeRepository.kt"
click node_innertube "https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/innertube/YouTube.kt"
click node_newpipe "https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/innertube/pages/NewPipe.kt"
click node_shorts "https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/data/shorts/ShortsDiscoveryEngine.kt"
click node_music_data "https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/data/newmusic/InnertubeMusicService.kt"
click node_video_player "https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/player/EnhancedPlayerManager.kt"
click node_music_service "https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/service/Media3MusicService.kt"
click node_downloads "https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/data/video/downloader/FlowDownloadService.kt"
click node_lyrics "https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/data/lyrics/LyricsHelper.kt"
click node_database "https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/data/local/AppDatabase.kt"
click node_subscriptions "https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/data/local/SubscriptionRepository.kt"
click node_history "https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/data/local/ViewHistory.kt"
click node_preferences "https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/data/local/PlayerPreferences.kt"
click node_neuro "https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/data/recommendation/FlowNeuroEngine.kt"
click node_interest "https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/data/recommendation/InterestProfile.kt"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_user toneBlue
class node_youtube_repo,node_innertube,node_newpipe,node_shorts,node_music_data toneAmber
class node_video_player,node_music_service,node_downloads,node_lyrics toneMint
class node_database,node_subscriptions,node_history,node_preferences toneRose
class node_neuro,node_interest toneIndigo
```

## Components

### App entry

- [Android client](https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/MainActivity.kt): `app/src/main/java/io/github/aedev/flow/MainActivity.kt`

### Discovery and data

- [YouTube data](https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/data/repository/YouTubeRepository.kt): `app/src/main/java/io/github/aedev/flow/data/repository/YouTubeRepository.kt`
- [YouTube API](https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/innertube/YouTube.kt): `app/src/main/java/io/github/aedev/flow/innertube/YouTube.kt`
- [Stream extraction](https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/innertube/pages/NewPipe.kt): `app/src/main/java/io/github/aedev/flow/innertube/pages/NewPipe.kt`
- [Shorts discovery](https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/data/shorts/ShortsDiscoveryEngine.kt): `app/src/main/java/io/github/aedev/flow/data/shorts/ShortsDiscoveryEngine.kt`
- [Music catalog](https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/data/newmusic/InnertubeMusicService.kt): `app/src/main/java/io/github/aedev/flow/data/newmusic/InnertubeMusicService.kt`

### Playback and media

- [Video playback](https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/player/EnhancedPlayerManager.kt): `app/src/main/java/io/github/aedev/flow/player/EnhancedPlayerManager.kt`
- [Music playback](https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/service/Media3MusicService.kt): `app/src/main/java/io/github/aedev/flow/service/Media3MusicService.kt`
- [Video downloads](https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/data/video/downloader/FlowDownloadService.kt): `app/src/main/java/io/github/aedev/flow/data/video/downloader/FlowDownloadService.kt`
- [Lyrics lookup](https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/data/lyrics/LyricsHelper.kt): `app/src/main/java/io/github/aedev/flow/data/lyrics/LyricsHelper.kt`

### Local library

- [Local database](https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/data/local/AppDatabase.kt): `app/src/main/java/io/github/aedev/flow/data/local/AppDatabase.kt`
- [Subscriptions](https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/data/local/SubscriptionRepository.kt): `app/src/main/java/io/github/aedev/flow/data/local/SubscriptionRepository.kt`
- [Watch history](https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/data/local/ViewHistory.kt): `app/src/main/java/io/github/aedev/flow/data/local/ViewHistory.kt`
- [Player preferences](https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/data/local/PlayerPreferences.kt): `app/src/main/java/io/github/aedev/flow/data/local/PlayerPreferences.kt`

### Personalization

- [FlowNeuro engine](https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/data/recommendation/FlowNeuroEngine.kt): `app/src/main/java/io/github/aedev/flow/data/recommendation/FlowNeuroEngine.kt`
- [Interest profile](https://github.com/lowi-kr/flow/blob/package-name-change/app/src/main/java/io/github/aedev/flow/data/recommendation/InterestProfile.kt): `app/src/main/java/io/github/aedev/flow/data/recommendation/InterestProfile.kt`

### Other components

- **Flow user**

## Connections

- Flow user → Android client: uses (evidence: `README.md`)
- Android client → YouTube data: browses content
- YouTube data → YouTube API: fetches data (evidence: `app/src/main/java/io/github/aedev/flow/data/repository/YouTubeRepository.kt`)
- YouTube API → Stream extraction: extracts streams (evidence: `app/src/main/java/io/github/aedev/flow/innertube/pages/NewPipe.kt`)
- Android client → Shorts discovery: discovers Shorts
- Android client → Music catalog: browses music
- Music catalog → YouTube API: queries catalog (evidence: `app/src/main/java/io/github/aedev/flow/data/newmusic/InnertubeMusicService.kt`)
- Android client → Video playback: plays video (evidence: `app/src/main/java/io/github/aedev/flow/MainActivity.kt`)
- Android client → Music playback: plays music (evidence: `app/src/main/java/io/github/aedev/flow/service/Media3MusicService.kt`)
- Android client → Video downloads: downloads media (evidence: `app/src/main/java/io/github/aedev/flow/data/video/downloader/FlowDownloadService.kt`)
- Music playback → Lyrics lookup: loads lyrics (evidence: `app/src/main/java/io/github/aedev/flow/service/Media3MusicService.kt`)
- Android client → Subscriptions: manages subscriptions
- Android client → Watch history: records watches
- Subscriptions → Local database: stores locally (evidence: `app/src/main/java/io/github/aedev/flow/data/local/SubscriptionRepository.kt`)
- Watch history → Local database: stores locally (evidence: `app/src/main/java/io/github/aedev/flow/data/local/ViewHistory.kt`)
- Android client → FlowNeuro engine: personalizes discovery (evidence: `app/src/main/java/io/github/aedev/flow/MainActivity.kt`)
- FlowNeuro engine → Player preferences: reads settings (evidence: `app/src/main/java/io/github/aedev/flow/data/recommendation/FlowNeuroEngine.kt`)
- FlowNeuro engine → Interest profile: updates profile
- Watch history → FlowNeuro engine: learns from watches
