# korppujauho/pocketts architecture

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

- Interactive diagram: https://gitdiagram.com/korppujauho/pocketts
- Repository: https://github.com/korppujauho/pocketts

## Overview

PocketTS is an Android TeamSpeak 6 client. A user enters server details or chooses a favourite, joins through the session and protocol layers, then uses the live server view for channels, chat, files, voice and streams. The graph also preserves major documented features and the central preference, identity, and audio settings subsystems. Source excerpts and the index establish several internal calls; README-only capabilities are shown without claiming unsampled implementation details.

Main entry points: [`app/src/main/kotlin/io/github/korppujauho/pocketts/Session.kt`](https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/Session.kt) (Session controller), [`app/src/main/kotlin/io/github/korppujauho/pocketts/MainActivity.kt`](https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/MainActivity.kt) (App coordinator), [`app/src/main/kotlin/io/github/korppujauho/pocketts/ui/SettingsDialog.kt`](https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/ui/SettingsDialog.kt) (Settings dialog), [`app/src/main/kotlin/io/github/korppujauho/pocketts/ui/ConnectScreen.kt`](https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/ui/ConnectScreen.kt) (Connect screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_connect["Connect screen<br/>[ConnectScreen.kt]"]
  node_activity["App coordinator<br/>[MainActivity.kt]"]
  node_serverui["Server screen<br/>[ServerScreen.kt]"]
  node_chatui["Chat panel<br/>[ChatPanel.kt]"]
  node_settingsui["Settings dialog<br/>[SettingsDialog.kt]"]
end

subgraph group_session["Session and audio"]
  node_session["Session controller<br/>[Session.kt]"]
  node_connection["Connection service"]
  node_voiceconfig["Voice settings<br/>[VoiceSettings.kt]"]
  node_streamengine["Stream engine<br/>[StreamEngine.kt]"]
  node_voiceplayer["Voice playback<br/>[VoicePlayer.kt]"]
end

subgraph group_protocol["TeamSpeak protocol"]
  node_tsclient["Protocol client<br/>[TsClient.kt]"]
  node_servermodel["Server state<br/>[ServerModel.kt]"]
  node_chat["Chat logic<br/>[Chat.kt]"]
  node_streams["Stream signaling<br/>[Streams.kt]"]
  node_filetransfer["File transfer<br/>[FileTransfer.kt]"]
  node_identity["Identity crypto<br/>[Identity.kt]"]
end

subgraph group_preferences["Preferences and support"]
  node_favorites[("Favourites<br/>[Favorites.kt]")]
  node_settings[("App settings<br/>[Settings.kt]")]
  node_history[("Chat history")]
  node_sounds["UI sounds<br/>[UiSounds.kt]"]
  node_soundpack["Sound packs<br/>[SoundPack.kt]"]
  node_applog["Privacy-aware logs<br/>[AppLog.kt]"]
  node_update["Update check<br/>[UpdateCheck.kt]"]
end

node_user(("User"))
node_teamspeak{{"TeamSpeak server"}}
node_github{{"GitHub releases"}}

node_user -->|"enters address"| node_connect
node_connect -->|"requests connection"| node_activity
node_activity -->|"starts session"| node_session
node_activity -->|"shows server"| node_serverui
node_session -->|"uses protocol"| node_tsclient
node_tsclient -.->|"exchanges commands"| node_teamspeak
node_session -->|"updates state"| node_servermodel
node_session -->|"handles messages"| node_chat
node_serverui -.->|"opens chat"| node_chatui
node_session -->|"controls streams"| node_streamengine
node_streamengine -->|"uses signaling"| node_streams
node_session -->|"reads settings"| node_voiceconfig
node_session -->|"manages playback"| node_voiceplayer
node_session -->|"starts foreground"| node_connection
node_session -->|"transfers files"| node_filetransfer
node_tsclient -->|"uses identity"| node_identity
node_user -->|"configures client"| node_settingsui
node_settingsui -->|"edits voice options"| node_voiceconfig
node_settingsui -->|"edits preferences"| node_settings
node_connect -->|"loads favourites"| node_favorites
node_settingsui -->|"configures sounds"| node_sounds
node_sounds -.->|"uses sound packs"| node_soundpack
node_activity -->|"starts logging"| node_applog
node_settingsui -->|"manages debug log"| node_applog
node_activity -->|"checks updates"| node_update
node_update -->|"checks releases"| node_github
node_user -->|"uses voice and streams"| node_serverui
node_user -->|"chats and shares pictures"| node_chatui
node_user -->|"browses channel files"| node_filetransfer
node_chat -.->|"persists conversations"| node_history

click node_connect "https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/ui/ConnectScreen.kt"
click node_activity "https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/MainActivity.kt"
click node_serverui "https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/ui/ServerScreen.kt"
click node_chatui "https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/ui/ChatPanel.kt"
click node_settingsui "https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/ui/SettingsDialog.kt"
click node_session "https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/Session.kt"
click node_connection "https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/ConnectionService.kt"
click node_voiceconfig "https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/VoiceSettings.kt"
click node_streamengine "https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/StreamEngine.kt"
click node_voiceplayer "https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/VoicePlayer.kt"
click node_tsclient "https://github.com/korppujauho/pocketts/blob/main/tsproto/src/main/kotlin/io/github/korppujauho/pocketts/proto/TsClient.kt"
click node_servermodel "https://github.com/korppujauho/pocketts/blob/main/tsproto/src/main/kotlin/io/github/korppujauho/pocketts/proto/ServerModel.kt"
click node_chat "https://github.com/korppujauho/pocketts/blob/main/tsproto/src/main/kotlin/io/github/korppujauho/pocketts/proto/Chat.kt"
click node_streams "https://github.com/korppujauho/pocketts/blob/main/tsproto/src/main/kotlin/io/github/korppujauho/pocketts/proto/Streams.kt"
click node_filetransfer "https://github.com/korppujauho/pocketts/blob/main/tsproto/src/main/kotlin/io/github/korppujauho/pocketts/proto/FileTransfer.kt"
click node_identity "https://github.com/korppujauho/pocketts/blob/main/tsproto/src/main/kotlin/io/github/korppujauho/pocketts/proto/Identity.kt"
click node_favorites "https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/Favorites.kt"
click node_settings "https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/Settings.kt"
click node_history "https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/ChatHistoryStore.kt"
click node_sounds "https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/UiSounds.kt"
click node_soundpack "https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/SoundPack.kt"
click node_applog "https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/AppLog.kt"
click node_update "https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/UpdateCheck.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_connect,node_activity,node_serverui,node_chatui,node_settingsui,node_user toneBlue
class node_session,node_connection,node_voiceconfig,node_streamengine,node_voiceplayer toneAmber
class node_tsclient,node_servermodel,node_chat,node_streams,node_filetransfer,node_identity,node_teamspeak toneMint
class node_favorites,node_settings,node_history,node_sounds,node_soundpack,node_applog,node_update toneRose
class node_github toneIndigo
```

## Components

### App experience

- [Connect screen](https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/ui/ConnectScreen.kt): `app/src/main/kotlin/io/github/korppujauho/pocketts/ui/ConnectScreen.kt`
- [App coordinator](https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/MainActivity.kt): `app/src/main/kotlin/io/github/korppujauho/pocketts/MainActivity.kt`
- [Server screen](https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/ui/ServerScreen.kt): `app/src/main/kotlin/io/github/korppujauho/pocketts/ui/ServerScreen.kt`
- [Chat panel](https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/ui/ChatPanel.kt): `app/src/main/kotlin/io/github/korppujauho/pocketts/ui/ChatPanel.kt`
- [Settings dialog](https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/ui/SettingsDialog.kt): `app/src/main/kotlin/io/github/korppujauho/pocketts/ui/SettingsDialog.kt`

### Session and audio

- [Session controller](https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/Session.kt): `app/src/main/kotlin/io/github/korppujauho/pocketts/Session.kt`
- [Connection service](https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/ConnectionService.kt): `app/src/main/kotlin/io/github/korppujauho/pocketts/ConnectionService.kt`
- [Voice settings](https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/VoiceSettings.kt): `app/src/main/kotlin/io/github/korppujauho/pocketts/VoiceSettings.kt`
- [Stream engine](https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/StreamEngine.kt): `app/src/main/kotlin/io/github/korppujauho/pocketts/StreamEngine.kt`
- [Voice playback](https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/VoicePlayer.kt): `app/src/main/kotlin/io/github/korppujauho/pocketts/VoicePlayer.kt`

### TeamSpeak protocol

- [Protocol client](https://github.com/korppujauho/pocketts/blob/main/tsproto/src/main/kotlin/io/github/korppujauho/pocketts/proto/TsClient.kt): `tsproto/src/main/kotlin/io/github/korppujauho/pocketts/proto/TsClient.kt`
- [Server state](https://github.com/korppujauho/pocketts/blob/main/tsproto/src/main/kotlin/io/github/korppujauho/pocketts/proto/ServerModel.kt): `tsproto/src/main/kotlin/io/github/korppujauho/pocketts/proto/ServerModel.kt`
- [Chat logic](https://github.com/korppujauho/pocketts/blob/main/tsproto/src/main/kotlin/io/github/korppujauho/pocketts/proto/Chat.kt): `tsproto/src/main/kotlin/io/github/korppujauho/pocketts/proto/Chat.kt`
- [Stream signaling](https://github.com/korppujauho/pocketts/blob/main/tsproto/src/main/kotlin/io/github/korppujauho/pocketts/proto/Streams.kt): `tsproto/src/main/kotlin/io/github/korppujauho/pocketts/proto/Streams.kt`
- [File transfer](https://github.com/korppujauho/pocketts/blob/main/tsproto/src/main/kotlin/io/github/korppujauho/pocketts/proto/FileTransfer.kt): `tsproto/src/main/kotlin/io/github/korppujauho/pocketts/proto/FileTransfer.kt`
- [Identity crypto](https://github.com/korppujauho/pocketts/blob/main/tsproto/src/main/kotlin/io/github/korppujauho/pocketts/proto/Identity.kt): `tsproto/src/main/kotlin/io/github/korppujauho/pocketts/proto/Identity.kt`

### Preferences and support

- [Favourites](https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/Favorites.kt): `app/src/main/kotlin/io/github/korppujauho/pocketts/Favorites.kt`
- [App settings](https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/Settings.kt): `app/src/main/kotlin/io/github/korppujauho/pocketts/Settings.kt`
- [Chat history](https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/ChatHistoryStore.kt): `app/src/main/kotlin/io/github/korppujauho/pocketts/ChatHistoryStore.kt`
- [UI sounds](https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/UiSounds.kt): `app/src/main/kotlin/io/github/korppujauho/pocketts/UiSounds.kt`
- [Sound packs](https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/SoundPack.kt): `app/src/main/kotlin/io/github/korppujauho/pocketts/SoundPack.kt`
- [Privacy-aware logs](https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/AppLog.kt): `app/src/main/kotlin/io/github/korppujauho/pocketts/AppLog.kt`
- [Update check](https://github.com/korppujauho/pocketts/blob/main/app/src/main/kotlin/io/github/korppujauho/pocketts/UpdateCheck.kt): `app/src/main/kotlin/io/github/korppujauho/pocketts/UpdateCheck.kt`

### Other components

- **User**
- **TeamSpeak server**
- **GitHub releases**

## Connections

- User → Connect screen: enters address (evidence: `README.md`)
- Connect screen → App coordinator: requests connection (evidence: `app/src/main/kotlin/io/github/korppujauho/pocketts/MainActivity.kt`)
- App coordinator → Session controller: starts session (evidence: `app/src/main/kotlin/io/github/korppujauho/pocketts/MainActivity.kt`)
- App coordinator → Server screen: shows server (evidence: `app/src/main/kotlin/io/github/korppujauho/pocketts/MainActivity.kt`)
- Session controller → Protocol client: uses protocol (evidence: `app/src/main/kotlin/io/github/korppujauho/pocketts/Session.kt`)
- Protocol client → TeamSpeak server: exchanges commands
- Session controller → Server state: updates state (evidence: `app/src/main/kotlin/io/github/korppujauho/pocketts/Session.kt`)
- Session controller → Chat logic: handles messages (evidence: `app/src/main/kotlin/io/github/korppujauho/pocketts/Session.kt`)
- Server screen → Chat panel: opens chat (evidence: `app/src/main/kotlin/io/github/korppujauho/pocketts/ui/ServerScreen.kt`)
- Session controller → Stream engine: controls streams (evidence: `app/src/main/kotlin/io/github/korppujauho/pocketts/Session.kt`)
- Stream engine → Stream signaling: uses signaling (evidence: `app/src/main/kotlin/io/github/korppujauho/pocketts/StreamEngine.kt`)
- Session controller → Voice settings: reads settings (evidence: `app/src/main/kotlin/io/github/korppujauho/pocketts/Session.kt`)
- Session controller → Voice playback: manages playback (evidence: `app/src/main/kotlin/io/github/korppujauho/pocketts/Session.kt`)
- Session controller → Connection service: starts foreground (evidence: `app/src/main/kotlin/io/github/korppujauho/pocketts/Session.kt`)
- Session controller → File transfer: transfers files (evidence: `app/src/main/kotlin/io/github/korppujauho/pocketts/Session.kt`)
- Protocol client → Identity crypto: uses identity (evidence: `tsproto/src/main/kotlin/io/github/korppujauho/pocketts/proto/TsClient.kt`)
- User → Settings dialog: configures client (evidence: `README.md`)
- Settings dialog → Voice settings: edits voice options (evidence: `app/src/main/kotlin/io/github/korppujauho/pocketts/ui/SettingsDialog.kt`)
- Settings dialog → App settings: edits preferences (evidence: `app/src/main/kotlin/io/github/korppujauho/pocketts/ui/SettingsDialog.kt`)
- Connect screen → Favourites: loads favourites (evidence: `app/src/main/kotlin/io/github/korppujauho/pocketts/ui/ConnectScreen.kt`)
- Settings dialog → UI sounds: configures sounds (evidence: `app/src/main/kotlin/io/github/korppujauho/pocketts/ui/SettingsDialog.kt`)
- UI sounds → Sound packs: uses sound packs (evidence: `app/src/main/kotlin/io/github/korppujauho/pocketts/UiSounds.kt`)
- App coordinator → Privacy-aware logs: starts logging (evidence: `app/src/main/kotlin/io/github/korppujauho/pocketts/MainActivity.kt`)
- Settings dialog → Privacy-aware logs: manages debug log (evidence: `app/src/main/kotlin/io/github/korppujauho/pocketts/ui/SettingsDialog.kt`)
- App coordinator → Update check: checks updates (evidence: `app/src/main/kotlin/io/github/korppujauho/pocketts/MainActivity.kt`)
- Update check → GitHub releases: checks releases (evidence: `README.md`)
- User → Server screen: uses voice and streams (evidence: `README.md`)
- User → Chat panel: chats and shares pictures (evidence: `README.md`)
- User → File transfer: browses channel files (evidence: `README.md`)
- Chat logic → Chat history: persists conversations
