How sentriz/gonic works
Main Components Identification
The system should be represented with these key components:
a) Core Server Components:
• HTTP Server Layer (handles both admin and Subsonic API endpoints)
• Scanner Service (music file scanning and monitoring)
• Transcoding Service (audio format conversion)
• Jukebox Service (server-side playback)
• Database Layer (SQLite storage)
b) External Services Integration:
• Last.fm API Integration
• ListenBrainz Integration
• TagLib Integration (for audio metadata)
• FFmpeg Integration (for transcoding)
Component Relationships
[Music Files Storage] → [Scanner Service] → [Database]
• ↓
[HTTP Server] → [Router] → [Admin Controller]
• ↘ [Subsonic API Controller] → [Transcoding Service]
• → [Jukebox Service]
• → [Playlist Manager]
• → [Podcast Manager]
• ↓
[External Services] ← [Integration Layer] ← [Scrobbling Service]
Specific Implementation Details
Key architectural elements:
• File system watchers for real-time music updates
• Cache management for transcoded files
• Multi-user support with separate configurations
• Multiple music folder support with aliasing
• Plugin-style architecture for transcoding backends
Technical Stack Indicators
Highlight:
• Go as the primary language
• SQLite as the database
• TagLib for metadata parsing
• FFmpeg for transcoding
• MPV for jukebox functionality
Configuration Components
Show:
• Environment variable configuration
• Command-line arguments
• File-based configuration
• Admin UI configuration interface
• Clear separation between API implementations (Subsonic vs Admin)
• Pluggable external service integrations
• Flexible file system handling
• Caching and optimization mechanisms
This architecture reflects Gonic's design as a lightweight but feature-rich music streaming server with emphasis on compatibility and performance.