# sherazi5110/stream-goat architecture

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

- Interactive diagram: https://gitdiagram.com/sherazi5110/stream-goat
- Repository: https://github.com/sherazi5110/stream-goat

## Overview

Stream Goat is a multi-platform media player and organiser that starts without content sources; users add extensions, Stremio add-ons, or Live TV playlists, then discover and play or download media. Its runtime also covers profiles, metadata, subtitle and scrobbling integrations, library state, backup, and glitch reporting. The Android startup excerpt shows app initialization, plugin loading, download recovery, Stremio preinstallation, and backup startup; the Linux entry excerpt shows platform setup and UI launch. Many feature relationships below are documented in the README; unsampled internals are represented at their exact source paths without asserting unshown calls.

Main entry points: [`android/app/src/main/java/io/github/sherazi5110/cloudstream/App.kt`](https://github.com/sherazi5110/stream-goat/blob/main/android/app/src/main/java/io/github/sherazi5110/cloudstream/App.kt) (Android startup), [`app/src/main/kotlin/com/lagradost/cloudstream3/linux/Main.kt`](https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/linux/Main.kt) (Linux entry), [`android/app/src/main/java/io/github/sherazi5110/cloudstream/Engine.kt`](https://github.com/sherazi5110/stream-goat/blob/main/android/app/src/main/java/io/github/sherazi5110/cloudstream/Engine.kt) (Content engine), [`android/app/src/main/java/io/github/sherazi5110/cloudstream/player/PlayerController.kt`](https://github.com/sherazi5110/stream-goat/blob/main/android/app/src/main/java/io/github/sherazi5110/cloudstream/player/PlayerController.kt) (Media player)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App and interface"]
  node_android_start["Android startup<br/>[App.kt]"]
  node_linux_start["Linux entry<br/>[Main.kt]"]
  node_navigation["App navigation<br/>[Nav.kt]"]
  node_web["Web player<br/>[app.js]"]
end

subgraph group_sources["Content sources"]
  node_plugin_mgr["Extension manager<br/>[PluginManager.kt]"]
  node_repositories["Repositories<br/>[Repositories.kt]"]
  node_stremio["Stremio add-ons<br/>[Stremio.kt]"]
  node_live_tv["Live TV<br/>[LiveTv.kt]"]
  node_engine["Content engine<br/>[Engine.kt]"]
end

subgraph group_media["Playback and downloads"]
  node_player["Media player"]
  node_downloads["Downloads<br/>[Downloads.kt]"]
  node_download_service["Download service<br/>[DownloadService.kt]"]
  node_subtitles["Subtitle tools"]
end

subgraph group_account["Library and services"]
  node_library["Library and history<br/>[Library.kt]"]
  node_profiles["Profiles<br/>[Profiles.kt]"]
  node_metadata["Metadata<br/>[Metadata.kt]"]
  node_sync["Watch sync<br/>[WeTrakr.kt]"]
  node_backup["Cloud backup<br/>[CloudBackup.kt]"]
  node_settings["Settings<br/>[Settings.kt]"]
  node_sync_services["Sync providers<br/>[OfficialSync.kt]"]
end

subgraph group_support["Platform support"]
  node_state[("Persistent state<br/>[DataStore.kt]")]
  node_glitch["Glitch reporting<br/>[GlitchReport.kt]"]
  node_crash["Crash reporting<br/>[CrashReport.kt]"]
  node_dex["Extension compatibility<br/>[DexTranslator.kt]"]
end

node_user(("Viewer"))

node_user -->|"opens app"| node_android_start
node_user -->|"opens app"| node_linux_start
node_user -->|"opens player"| node_web
node_android_start -->|"loads extensions"| node_plugin_mgr
node_android_start -->|"starts backup"| node_backup
node_android_start -->|"recovers downloads"| node_downloads
node_android_start -->|"preinstalls add-ons"| node_stremio
node_linux_start -->|"manages extensions"| node_plugin_mgr
node_user -->|"browses content"| node_navigation
node_navigation -.->|"requests titles"| node_engine
node_plugin_mgr -.->|"installs from"| node_repositories
node_engine -.->|"provides streams"| node_player
node_player -->|"translates subtitles"| node_subtitles
node_player -.->|"updates watch state"| node_library
node_user -->|"adds playlists"| node_live_tv
node_user -->|"downloads media"| node_downloads
node_download_service -->|"tracks progress"| node_downloads
node_user -->|"selects profile"| node_profiles
node_engine -.->|"enriches titles"| node_metadata
node_library -.->|"scrobbles viewing"| node_sync
node_sync -.->|"uses providers"| node_sync_services
node_backup -.->|"backs up data"| node_state
node_settings -.->|"stores preferences"| node_state
node_user -->|"reports issue"| node_glitch
node_android_start -->|"installs handler"| node_crash
node_linux_start -->|"checks compatibility"| node_dex

click node_android_start "https://github.com/sherazi5110/stream-goat/blob/main/android/app/src/main/java/io/github/sherazi5110/cloudstream/App.kt"
click node_linux_start "https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/linux/Main.kt"
click node_navigation "https://github.com/sherazi5110/stream-goat/blob/main/android/app/src/main/java/io/github/sherazi5110/cloudstream/ui/Nav.kt"
click node_web "https://github.com/sherazi5110/stream-goat/blob/main/webapp/app.js"
click node_plugin_mgr "https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/linux/PluginManager.kt"
click node_repositories "https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/linux/Repositories.kt"
click node_stremio "https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/linux/Stremio.kt"
click node_live_tv "https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/linux/LiveTv.kt"
click node_engine "https://github.com/sherazi5110/stream-goat/blob/main/android/app/src/main/java/io/github/sherazi5110/cloudstream/Engine.kt"
click node_player "https://github.com/sherazi5110/stream-goat/blob/main/android/app/src/main/java/io/github/sherazi5110/cloudstream/player/PlayerController.kt"
click node_downloads "https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/linux/Downloads.kt"
click node_download_service "https://github.com/sherazi5110/stream-goat/blob/main/android/app/src/main/java/io/github/sherazi5110/cloudstream/DownloadService.kt"
click node_subtitles "https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/linux/SubtitleTranslator.kt"
click node_library "https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/linux/Library.kt"
click node_profiles "https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/linux/Profiles.kt"
click node_metadata "https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/linux/Metadata.kt"
click node_sync "https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/linux/WeTrakr.kt"
click node_backup "https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/linux/CloudBackup.kt"
click node_settings "https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/linux/Settings.kt"
click node_state "https://github.com/sherazi5110/stream-goat/blob/main/android/app/src/main/java/com/lagradost/cloudstream3/utils/DataStore.kt"
click node_glitch "https://github.com/sherazi5110/stream-goat/blob/main/android/app/src/main/java/io/github/sherazi5110/cloudstream/GlitchReport.kt"
click node_crash "https://github.com/sherazi5110/stream-goat/blob/main/android/app/src/main/java/io/github/sherazi5110/cloudstream/CrashReport.kt"
click node_dex "https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/linux/DexTranslator.kt"
click node_sync_services "https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/syncproviders/OfficialSync.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_android_start,node_linux_start,node_navigation,node_web,node_user toneBlue
class node_plugin_mgr,node_repositories,node_stremio,node_live_tv,node_engine toneAmber
class node_player,node_downloads,node_download_service,node_subtitles toneMint
class node_library,node_profiles,node_metadata,node_sync,node_backup,node_settings,node_sync_services toneRose
class node_state,node_glitch,node_crash,node_dex toneIndigo
```

## Components

### App and interface

- [Android startup](https://github.com/sherazi5110/stream-goat/blob/main/android/app/src/main/java/io/github/sherazi5110/cloudstream/App.kt): `android/app/src/main/java/io/github/sherazi5110/cloudstream/App.kt`
- [Linux entry](https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/linux/Main.kt): `app/src/main/kotlin/com/lagradost/cloudstream3/linux/Main.kt`
- [App navigation](https://github.com/sherazi5110/stream-goat/blob/main/android/app/src/main/java/io/github/sherazi5110/cloudstream/ui/Nav.kt): `android/app/src/main/java/io/github/sherazi5110/cloudstream/ui/Nav.kt`
- [Web player](https://github.com/sherazi5110/stream-goat/blob/main/webapp/app.js): `webapp/app.js`

### Content sources

- [Extension manager](https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/linux/PluginManager.kt): `app/src/main/kotlin/com/lagradost/cloudstream3/linux/PluginManager.kt`
- [Repositories](https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/linux/Repositories.kt): `app/src/main/kotlin/com/lagradost/cloudstream3/linux/Repositories.kt`
- [Stremio add-ons](https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/linux/Stremio.kt): `app/src/main/kotlin/com/lagradost/cloudstream3/linux/Stremio.kt`
- [Live TV](https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/linux/LiveTv.kt): `app/src/main/kotlin/com/lagradost/cloudstream3/linux/LiveTv.kt`
- [Content engine](https://github.com/sherazi5110/stream-goat/blob/main/android/app/src/main/java/io/github/sherazi5110/cloudstream/Engine.kt): `android/app/src/main/java/io/github/sherazi5110/cloudstream/Engine.kt`

### Playback and downloads

- [Media player](https://github.com/sherazi5110/stream-goat/blob/main/android/app/src/main/java/io/github/sherazi5110/cloudstream/player/PlayerController.kt): `android/app/src/main/java/io/github/sherazi5110/cloudstream/player/PlayerController.kt`
- [Downloads](https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/linux/Downloads.kt): `app/src/main/kotlin/com/lagradost/cloudstream3/linux/Downloads.kt`
- [Download service](https://github.com/sherazi5110/stream-goat/blob/main/android/app/src/main/java/io/github/sherazi5110/cloudstream/DownloadService.kt): `android/app/src/main/java/io/github/sherazi5110/cloudstream/DownloadService.kt`
- [Subtitle tools](https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/linux/SubtitleTranslator.kt): `app/src/main/kotlin/com/lagradost/cloudstream3/linux/SubtitleTranslator.kt`

### Library and services

- [Library and history](https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/linux/Library.kt): `app/src/main/kotlin/com/lagradost/cloudstream3/linux/Library.kt`
- [Profiles](https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/linux/Profiles.kt): `app/src/main/kotlin/com/lagradost/cloudstream3/linux/Profiles.kt`
- [Metadata](https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/linux/Metadata.kt): `app/src/main/kotlin/com/lagradost/cloudstream3/linux/Metadata.kt`
- [Watch sync](https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/linux/WeTrakr.kt): `app/src/main/kotlin/com/lagradost/cloudstream3/linux/WeTrakr.kt`
- [Cloud backup](https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/linux/CloudBackup.kt): `app/src/main/kotlin/com/lagradost/cloudstream3/linux/CloudBackup.kt`
- [Settings](https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/linux/Settings.kt): `app/src/main/kotlin/com/lagradost/cloudstream3/linux/Settings.kt`
- [Sync providers](https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/syncproviders/OfficialSync.kt): `app/src/main/kotlin/com/lagradost/cloudstream3/syncproviders/OfficialSync.kt`

### Platform support

- [Persistent state](https://github.com/sherazi5110/stream-goat/blob/main/android/app/src/main/java/com/lagradost/cloudstream3/utils/DataStore.kt): `android/app/src/main/java/com/lagradost/cloudstream3/utils/DataStore.kt`
- [Glitch reporting](https://github.com/sherazi5110/stream-goat/blob/main/android/app/src/main/java/io/github/sherazi5110/cloudstream/GlitchReport.kt): `android/app/src/main/java/io/github/sherazi5110/cloudstream/GlitchReport.kt`
- [Crash reporting](https://github.com/sherazi5110/stream-goat/blob/main/android/app/src/main/java/io/github/sherazi5110/cloudstream/CrashReport.kt): `android/app/src/main/java/io/github/sherazi5110/cloudstream/CrashReport.kt`
- [Extension compatibility](https://github.com/sherazi5110/stream-goat/blob/main/app/src/main/kotlin/com/lagradost/cloudstream3/linux/DexTranslator.kt): `app/src/main/kotlin/com/lagradost/cloudstream3/linux/DexTranslator.kt`

### Other components

- **Viewer**

## Connections

- Viewer → Android startup: opens app
- Viewer → Linux entry: opens app
- Viewer → Web player: opens player
- Android startup → Extension manager: loads extensions (evidence: `android/app/src/main/java/io/github/sherazi5110/cloudstream/App.kt`)
- Android startup → Cloud backup: starts backup (evidence: `android/app/src/main/java/io/github/sherazi5110/cloudstream/App.kt`)
- Android startup → Downloads: recovers downloads (evidence: `android/app/src/main/java/io/github/sherazi5110/cloudstream/App.kt`)
- Android startup → Stremio add-ons: preinstalls add-ons (evidence: `android/app/src/main/java/io/github/sherazi5110/cloudstream/App.kt`)
- Linux entry → Extension manager: manages extensions (evidence: `app/src/main/kotlin/com/lagradost/cloudstream3/linux/Main.kt`)
- Viewer → App navigation: browses content
- App navigation → Content engine: requests titles
- Extension manager → Repositories: installs from
- Content engine → Media player: provides streams (evidence: `android/app/src/main/java/io/github/sherazi5110/cloudstream/player/PlayerController.kt`)
- Media player → Subtitle tools: translates subtitles
- Media player → Library and history: updates watch state
- Viewer → Live TV: adds playlists
- Viewer → Downloads: downloads media
- Download service → Downloads: tracks progress (evidence: `android/app/src/main/java/io/github/sherazi5110/cloudstream/DownloadService.kt`)
- Viewer → Profiles: selects profile
- Content engine → Metadata: enriches titles
- Library and history → Watch sync: scrobbles viewing
- Watch sync → Sync providers: uses providers
- Cloud backup → Persistent state: backs up data
- Settings → Persistent state: stores preferences
- Viewer → Glitch reporting: reports issue
- Android startup → Crash reporting: installs handler (evidence: `android/app/src/main/java/io/github/sherazi5110/cloudstream/App.kt`)
- Linux entry → Extension compatibility: checks compatibility (evidence: `app/src/main/kotlin/com/lagradost/cloudstream3/linux/Main.kt`)
