# yuroyami/syncplay-mobile architecture

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

- Interactive diagram: https://gitdiagram.com/yuroyami/syncplay-mobile
- Repository: https://github.com/yuroyami/syncplay-mobile

## Overview

Synkplay is a cross-platform Syncplay client for Android, iOS, desktop, and an early browser build. The primary workflow is to configure or join a room, load a local or linked video, become ready, and synchronize playback and room activity with other participants through the Syncplay protocol. Users can also watch alone or host a room locally. The graph combines README-documented capabilities with relationships visible in the supplied source index and excerpts; unsampled subsystems are included where the README establishes them, without assuming their internal call paths.

Main entry points: [`shared/src/app/room/RoomViewmodel.kt`](https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/room/RoomViewmodel.kt) (Room Coordinator), [`shared/src/app/protocol/network/NetworkManager.kt`](https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/protocol/network/NetworkManager.kt) (Client Transport), [`shared/src/app/home/HomeScreen.kt`](https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/home/HomeScreen.kt) (Home and Invites), [`shared/src/app/server/SyncplayServer.kt`](https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/server/SyncplayServer.kt) (Syncplay Server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and Home"]
  node_entry["App Entry<br/>[Screen.kt]"]
  node_home["Home and Invites<br/>[HomeScreen.kt]"]
  node_preferences[("Preferences<br/>[Preferences.kt]")]
end

subgraph group_room["Room Experience"]
  node_roomvm["Room Coordinator<br/>[RoomViewmodel.kt]"]
  node_roomui["Room Interface<br/>[RoomScreenUI.kt]"]
  node_playlist["Shared Playlist"]
  node_chat["Chat and GIFs<br/>[RoomSectionChat.kt]"]
  node_subtitles["Subtitle Search<br/>[SubtitleSearch.kt]"]
end

subgraph group_playback["Media Playback"]
  node_playerapi["Player Abstraction<br/>[PlayerEngine.kt]"]
  node_playermanager["Player Runtime<br/>[PlayerManager.kt]"]
  node_mediafile["Media Model<br/>[MediaFile.kt]"]
  node_platformplayers["Platform Engines<br/>[KiteEngine.kt]"]
end

subgraph group_protocol["Sync Protocol"]
  node_protocol["Protocol State<br/>[ProtocolManager.kt]"]
  node_wire["Wire Messages<br/>[WireMessage.kt]"]
  node_network["Client Transport<br/>[NetworkManager.kt]"]
  node_transportimpl["Platform Transports"]
end

subgraph group_hosting["Room Hosting"]
  node_syncserver["Syncplay Server<br/>[SyncplayServer.kt]"]
  node_clientconnection["Server Connections"]
  node_servertransport["Server Transport"]
end

node_viewer(("Viewer"))
node_syncplay(("Syncplay Server"))
node_opensubtitles(("OpenSubtitles"))
node_media_source(("Local or Linked Media"))

node_viewer -->|"opens app"| node_entry
node_entry -.->|"shows home"| node_home
node_viewer -->|"configures room"| node_home
node_home -->|"joins room"| node_roomvm
node_roomvm -->|"connects through"| node_network
node_network -.->|"uses transport"| node_transportimpl
node_network -->|"exchanges protocol"| node_syncplay
node_roomvm -->|"creates protocol state"| node_protocol
node_protocol -.->|"sends messages"| node_wire
node_viewer -->|"controls room"| node_roomui
node_roomvm -.->|"supplies room state"| node_roomui
node_roomvm -->|"owns player"| node_playermanager
node_playermanager -.->|"selects engine"| node_playerapi
node_playerapi -->|"creates implementation"| node_platformplayers
node_viewer -->|"chooses media"| node_media_source
node_media_source -->|"loads media"| node_mediafile
node_viewer -->|"manages playlist"| node_playlist
node_viewer -->|"chats and shares GIFs"| node_chat
node_viewer -->|"searches subtitles"| node_subtitles
node_subtitles -->|"searches catalog"| node_opensubtitles
node_viewer -->|"sets preferences"| node_preferences
node_viewer -->|"hosts room"| node_syncserver
node_servertransport -->|"accepts connections"| node_syncserver
node_servertransport -->|"passes packets"| node_clientconnection
node_clientconnection -->|"dispatches client actions"| node_syncserver

click node_entry "https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/Screen.kt"
click node_home "https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/home/HomeScreen.kt"
click node_preferences "https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/preferences/Preferences.kt"
click node_roomvm "https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/room/RoomViewmodel.kt"
click node_roomui "https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/room/RoomScreenUI.kt"
click node_playlist "https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/room/sharedplaylist/SharedPlaylistManager.kt"
click node_chat "https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/room/ui/chat/RoomSectionChat.kt"
click node_subtitles "https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/subtitles/SubtitleSearch.kt"
click node_playerapi "https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/player/PlayerEngine.kt"
click node_playermanager "https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/player/PlayerManager.kt"
click node_mediafile "https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/player/models/MediaFile.kt"
click node_platformplayers "https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src%40nonWeb/app/player/kite/KiteEngine.kt"
click node_protocol "https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/protocol/ProtocolManager.kt"
click node_wire "https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/protocol/WireMessage.kt"
click node_network "https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/protocol/network/NetworkManager.kt"
click node_transportimpl "https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src%40jvmShared/app/protocol/network/NettyNetworkManager.kt"
click node_syncserver "https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/server/SyncplayServer.kt"
click node_clientconnection "https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/server/ClientConnection.kt"
click node_servertransport "https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/server/network/ServerNetworkEngine.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_entry,node_home,node_preferences,node_viewer toneBlue
class node_roomvm,node_roomui,node_playlist,node_chat,node_subtitles toneAmber
class node_playerapi,node_playermanager,node_mediafile,node_platformplayers,node_syncplay toneMint
class node_protocol,node_wire,node_network,node_transportimpl toneRose
class node_syncserver,node_clientconnection,node_servertransport,node_opensubtitles,node_media_source toneIndigo
```

## Components

### App and Home

- [App Entry](https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/Screen.kt): `shared/src/app/Screen.kt`
- [Home and Invites](https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/home/HomeScreen.kt): `shared/src/app/home/HomeScreen.kt`
- [Preferences](https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/preferences/Preferences.kt): `shared/src/app/preferences/Preferences.kt`

### Room Experience

- [Room Coordinator](https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/room/RoomViewmodel.kt): `shared/src/app/room/RoomViewmodel.kt`
- [Room Interface](https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/room/RoomScreenUI.kt): `shared/src/app/room/RoomScreenUI.kt`
- [Shared Playlist](https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/room/sharedplaylist/SharedPlaylistManager.kt): `shared/src/app/room/sharedplaylist/SharedPlaylistManager.kt`
- [Chat and GIFs](https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/room/ui/chat/RoomSectionChat.kt): `shared/src/app/room/ui/chat/RoomSectionChat.kt`
- [Subtitle Search](https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/subtitles/SubtitleSearch.kt): `shared/src/app/subtitles/SubtitleSearch.kt`

### Media Playback

- [Player Abstraction](https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/player/PlayerEngine.kt): `shared/src/app/player/PlayerEngine.kt`
- [Player Runtime](https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/player/PlayerManager.kt): `shared/src/app/player/PlayerManager.kt`
- [Media Model](https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/player/models/MediaFile.kt): `shared/src/app/player/models/MediaFile.kt`
- [Platform Engines](https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src%40nonWeb/app/player/kite/KiteEngine.kt): `shared/src@nonWeb/app/player/kite/KiteEngine.kt`

### Sync Protocol

- [Protocol State](https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/protocol/ProtocolManager.kt): `shared/src/app/protocol/ProtocolManager.kt`
- [Wire Messages](https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/protocol/WireMessage.kt): `shared/src/app/protocol/WireMessage.kt`
- [Client Transport](https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/protocol/network/NetworkManager.kt): `shared/src/app/protocol/network/NetworkManager.kt`
- [Platform Transports](https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src%40jvmShared/app/protocol/network/NettyNetworkManager.kt): `shared/src@jvmShared/app/protocol/network/NettyNetworkManager.kt`

### Room Hosting

- [Syncplay Server](https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/server/SyncplayServer.kt): `shared/src/app/server/SyncplayServer.kt`
- [Server Connections](https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/server/ClientConnection.kt): `shared/src/app/server/ClientConnection.kt`
- [Server Transport](https://github.com/yuroyami/syncplay-mobile/blob/master/shared/src/app/server/network/ServerNetworkEngine.kt): `shared/src/app/server/network/ServerNetworkEngine.kt`

### Other components

- **Viewer**
- **Syncplay Server**
- **OpenSubtitles**
- **Local or Linked Media**

## Connections

- Viewer → App Entry: opens app
- App Entry → Home and Invites: shows home
- Viewer → Home and Invites: configures room
- Home and Invites → Room Coordinator: joins room
- Room Coordinator → Client Transport: connects through (evidence: `shared/src/app/room/RoomViewmodel.kt`)
- Client Transport → Platform Transports: uses transport (evidence: `shared/src@jvmShared/app/protocol/network/NettyNetworkManager.kt`)
- Client Transport → Syncplay Server: exchanges protocol
- Room Coordinator → Protocol State: creates protocol state (evidence: `shared/src/app/room/RoomViewmodel.kt`)
- Protocol State → Wire Messages: sends messages (evidence: `shared/src/app/protocol/ProtocolManager.kt`)
- Viewer → Room Interface: controls room
- Room Coordinator → Room Interface: supplies room state
- Room Coordinator → Player Runtime: owns player (evidence: `shared/src/app/room/RoomViewmodel.kt`)
- Player Runtime → Player Abstraction: selects engine
- Player Abstraction → Platform Engines: creates implementation (evidence: `shared/src@nonWeb/app/player/kite/KiteEngine.kt`)
- Viewer → Local or Linked Media: chooses media
- Local or Linked Media → Media Model: loads media
- Viewer → Shared Playlist: manages playlist
- Viewer → Chat and GIFs: chats and shares GIFs
- Viewer → Subtitle Search: searches subtitles
- Subtitle Search → OpenSubtitles: searches catalog
- Viewer → Preferences: sets preferences
- Viewer → Syncplay Server: hosts room
- Server Transport → Syncplay Server: accepts connections (evidence: `shared/src/app/server/network/ServerNetworkEngine.kt`)
- Server Transport → Server Connections: passes packets (evidence: `shared/src/app/server/network/ServerNetworkEngine.kt`)
- Server Connections → Syncplay Server: dispatches client actions (evidence: `shared/src/app/server/ClientConnection.kt`)
