# happy3646/localtube- architecture

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

- Interactive diagram: https://gitdiagram.com/happy3646/localtube-
- Repository: https://github.com/happy3646/localtube-

## Overview

LocalTube appears to be an Android app for browsing and watching videos stored on the device. The tree identifies home, channels, shorts, profile, and watch UI alongside a view model, media scanner, repository, and Room database. Source excerpts do not include runtime code, and the README is a generic setup guide, so the wiring and feature details below are inferred conservatively from names and paths.

Main entry points: [`app/src/main/java/com/example/MainActivity.kt`](https://github.com/happy3646/localtube-/blob/main/app/src/main/java/com/example/MainActivity.kt) (Main activity), [`app/src/main/java/com/example/viewmodel/LocalTubeViewModel.kt`](https://github.com/happy3646/localtube-/blob/main/app/src/main/java/com/example/viewmodel/LocalTubeViewModel.kt) (LocalTube view model), [`app/src/main/java/com/example/ui/screens/HomeScreen.kt`](https://github.com/happy3646/localtube-/blob/main/app/src/main/java/com/example/ui/screens/HomeScreen.kt) (Home screen), [`app/src/main/java/com/example/data/LocalTubeRepository.kt`](https://github.com/happy3646/localtube-/blob/main/app/src/main/java/com/example/data/LocalTubeRepository.kt) (LocalTube repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

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

subgraph group_ui["Video experience"]
  node_home["Home screen<br/>[HomeScreen.kt]"]
  node_channels["Channels screen<br/>[ChannelsScreen.kt]"]
  node_shorts["Shorts screen<br/>[ShortsScreen.kt]"]
  node_profile["Profile screen<br/>[ProfileScreen.kt]"]
  node_watch["Watch stage<br/>[WatchStage.kt]"]
  node_video_components["Video components<br/>[VideoComponents.kt]"]
end

subgraph group_logic["Application logic"]
  node_viewmodel["LocalTube view model"]
end

subgraph group_data["Local media and data"]
  node_repository["LocalTube repository"]
  node_scanner["Media scanner<br/>[MediaScanner.kt]"]
  node_models["Media models<br/>[Models.kt]"]
  node_database[("Room database")]
end

node_user(("Device user"))
node_device_media[("Device media")]

node_user -->|"opens"| node_main
node_main -->|"shows"| node_home
node_main -->|"shows"| node_channels
node_main -->|"shows"| node_shorts
node_main -->|"shows"| node_profile
node_home -->|"opens video"| node_watch
node_watch -->|"uses"| node_video_components
node_home -->|"requests content"| node_viewmodel
node_channels -->|"requests content"| node_viewmodel
node_shorts -->|"requests content"| node_viewmodel
node_profile -->|"requests content"| node_viewmodel
node_viewmodel -->|"requests data"| node_repository
node_repository -->|"scans media"| node_scanner
node_scanner -->|"reads"| node_device_media
node_repository -->|"accesses"| node_database

click node_main "https://github.com/happy3646/localtube-/blob/main/app/src/main/java/com/example/MainActivity.kt"
click node_home "https://github.com/happy3646/localtube-/blob/main/app/src/main/java/com/example/ui/screens/HomeScreen.kt"
click node_channels "https://github.com/happy3646/localtube-/blob/main/app/src/main/java/com/example/ui/screens/ChannelsScreen.kt"
click node_shorts "https://github.com/happy3646/localtube-/blob/main/app/src/main/java/com/example/ui/screens/ShortsScreen.kt"
click node_profile "https://github.com/happy3646/localtube-/blob/main/app/src/main/java/com/example/ui/screens/ProfileScreen.kt"
click node_watch "https://github.com/happy3646/localtube-/blob/main/app/src/main/java/com/example/ui/components/WatchStage.kt"
click node_video_components "https://github.com/happy3646/localtube-/blob/main/app/src/main/java/com/example/ui/components/VideoComponents.kt"
click node_viewmodel "https://github.com/happy3646/localtube-/blob/main/app/src/main/java/com/example/viewmodel/LocalTubeViewModel.kt"
click node_repository "https://github.com/happy3646/localtube-/blob/main/app/src/main/java/com/example/data/LocalTubeRepository.kt"
click node_scanner "https://github.com/happy3646/localtube-/blob/main/app/src/main/java/com/example/data/MediaScanner.kt"
click node_models "https://github.com/happy3646/localtube-/blob/main/app/src/main/java/com/example/data/model/Models.kt"
click node_database "https://github.com/happy3646/localtube-/blob/main/app/src/main/java/com/example/data/room/LocalTubeDatabase.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_home,node_channels,node_shorts,node_profile,node_watch,node_video_components,node_device_media toneAmber
class node_viewmodel toneMint
class node_repository,node_scanner,node_models,node_database toneRose
```

## Components

### App entry

- [Main activity](https://github.com/happy3646/localtube-/blob/main/app/src/main/java/com/example/MainActivity.kt): `app/src/main/java/com/example/MainActivity.kt`

### Video experience

- [Home screen](https://github.com/happy3646/localtube-/blob/main/app/src/main/java/com/example/ui/screens/HomeScreen.kt): `app/src/main/java/com/example/ui/screens/HomeScreen.kt`
- [Channels screen](https://github.com/happy3646/localtube-/blob/main/app/src/main/java/com/example/ui/screens/ChannelsScreen.kt): `app/src/main/java/com/example/ui/screens/ChannelsScreen.kt`
- [Shorts screen](https://github.com/happy3646/localtube-/blob/main/app/src/main/java/com/example/ui/screens/ShortsScreen.kt): `app/src/main/java/com/example/ui/screens/ShortsScreen.kt`
- [Profile screen](https://github.com/happy3646/localtube-/blob/main/app/src/main/java/com/example/ui/screens/ProfileScreen.kt): `app/src/main/java/com/example/ui/screens/ProfileScreen.kt`
- [Watch stage](https://github.com/happy3646/localtube-/blob/main/app/src/main/java/com/example/ui/components/WatchStage.kt): `app/src/main/java/com/example/ui/components/WatchStage.kt`
- [Video components](https://github.com/happy3646/localtube-/blob/main/app/src/main/java/com/example/ui/components/VideoComponents.kt): `app/src/main/java/com/example/ui/components/VideoComponents.kt`

### Application logic

- [LocalTube view model](https://github.com/happy3646/localtube-/blob/main/app/src/main/java/com/example/viewmodel/LocalTubeViewModel.kt): `app/src/main/java/com/example/viewmodel/LocalTubeViewModel.kt`

### Local media and data

- [LocalTube repository](https://github.com/happy3646/localtube-/blob/main/app/src/main/java/com/example/data/LocalTubeRepository.kt): `app/src/main/java/com/example/data/LocalTubeRepository.kt`
- [Media scanner](https://github.com/happy3646/localtube-/blob/main/app/src/main/java/com/example/data/MediaScanner.kt): `app/src/main/java/com/example/data/MediaScanner.kt`
- [Media models](https://github.com/happy3646/localtube-/blob/main/app/src/main/java/com/example/data/model/Models.kt): `app/src/main/java/com/example/data/model/Models.kt`
- [Room database](https://github.com/happy3646/localtube-/blob/main/app/src/main/java/com/example/data/room/LocalTubeDatabase.kt): `app/src/main/java/com/example/data/room/LocalTubeDatabase.kt`

### Other components

- **Device user**
- **Device media**

## Connections

- Device user → Main activity: opens
- Main activity → Home screen: shows
- Main activity → Channels screen: shows
- Main activity → Shorts screen: shows
- Main activity → Profile screen: shows
- Home screen → Watch stage: opens video
- Watch stage → Video components: uses
- Home screen → LocalTube view model: requests content
- Channels screen → LocalTube view model: requests content
- Shorts screen → LocalTube view model: requests content
- Profile screen → LocalTube view model: requests content
- LocalTube view model → LocalTube repository: requests data
- LocalTube repository → Media scanner: scans media
- Media scanner → Device media: reads
- LocalTube repository → Room database: accesses
