How gsg9hun/business works
DC Bot is a Discord music bot with a companion API and mobile app. The primary flow is Discord commands into bot music services, which manage playback, queues, and playlists using persisted state. Mobile clients also have authentication and API capabilities; the API exposes realtime updates and playback snapshots. The excerpts support specific API authentication, OAuth, snapshot, and persistence links. Bot command and music-service connections are shown as unverified because their runtime source was not sampled.
Main entry points: BotDbContext.cs Application database · SlashCommandExecutor.cs Command runtime · AuthHandler.cs API authentication · PlaybackSnapshotService.cs Playback snapshot
Components 17
Discord bot
- Command runtime
DC bot/Service/SlashCommands/SlashCommandExecutor.cs - Music services
DC bot/Service/Music - Playlist services
DC bot/Service/Music/PlaylistService/PlaylistQueryService.cs - Bot control
DC bot/Service/BotControl/BotControlWorker.cs
Mobile API
- API authentication
API/Handlers/Auth/AuthHandler.cs - Discord OAuth
API/Services/Auth/DiscordOAuthService.cs - API endpoints
API/Endpoints - Playback snapshot
API/Snapshots/Playback/PlaybackSnapshotService.cs - Realtime updates
API/Realtime
Persistence
- Session repository
DC bot.Persistence/Repositories/MobileApps/MobileAppSessionRepository.cs - Queue repository
DC bot.Persistence/Repositories/Queue/QueueRepository.cs - Application database
DC bot.Persistence/Db/BotDbContext.cs
Mobile app
- Mobile auth client
MobileApp/core/network/src/commonMain/kotlin/com/dc/melodiasmario/core/network/auth/AuthApiService.kt - Secure session storage
MobileApp/core/datastore/src/androidMain/kotlin/com/dc/melodiasmario/core/datastore/auth/SecureAuthSessionStorageImpl.kt
Other components
- Discord user
- Discord platform
- Mobile app user
Connections 19
- Discord user → Command runtime: issues commands
- Command runtime → Discord platform: handles interactions
- Command runtime → Music services: dispatches music
- Command runtime → Playlist services: dispatches playlist
- Bot control → Music services: controls playback
- Mobile app user → Mobile auth client: starts login
- Mobile auth client → API authentication: posts auth requests
MobileApp/core/network/src/commonMain/kotlin/com/dc/melodiasmario/core/network/auth/AuthApiService.kt - API authentication → Discord OAuth: exchanges credentials
API/Handlers/Auth/AuthHandler.cs - Discord OAuth → Discord platform: requests OAuth data
API/Services/Auth/DiscordOAuthService.cs - API authentication → Session repository: manages sessions
API/Handlers/Auth/AuthHandler.cs - Session repository → Application database: reads and writes
DC bot.Persistence/Repositories/MobileApps/MobileAppSessionRepository.cs - Playlist services → Application database: loads playlist data
- Music services → Queue repository: manages queue
- Queue repository → Application database: reads and writes
DC bot.Persistence/Repositories/Queue/QueueRepository.cs - API endpoints → Playback snapshot: serves playback
- Playback snapshot → Queue repository: reads queue
API/Snapshots/Playback/PlaybackSnapshotService.cs - Playback snapshot → Application database: reads playback state
- Realtime updates → Application database: listens for changes
- Mobile auth client → Secure session storage: stores session