How soehlert/tunebox works
Main Components
a. Client Layer:
• React Frontend (Browser Clients)
• Multiple client connections possible
• WebSocket connections
b. Server Layer:
• FastAPI Backend
• WebSocket Server
• API Routes (/music endpoints)
c. Integration Layer:
• Plex Server Connection
• Plex Client (Remote Player)
d. Data Layer:
• Redis Cache/Queue Management
[Web Clients (React)] ←→ [Load Balancer/Nginx]
• ↓
[FastAPI Backend]
• ↙ ↓ ↘
[Redis] [Plex API] [WebSocket Server]
• ↓
• [Plex Client]
Key Flows to Highlight
a. Music Library Access Flow:
Web Client → FastAPI → Plex Server → Redis Cache
b. Playback Control Flow:
Web Client → WebSocket → FastAPI → Plex Client
c. Queue Management Flow:
Web Client → FastAPI → Redis → WebSocket → All Connected Clients
Component Details
Frontend (React):
• Components: ArtistList, ArtistAlbums, TrackList, Queue, MusicControls
• WebSocket connection for real-time updates
• REST API client for library management
Backend (FastAPI):
• Music router endpoints
• WebSocket handler
• Plex service integration
• Redis service for queue management
Data Store (Redis):
• Queue storage
• State management
• Caching layer
External Services:
• Plex Server connection
• Plex Client for playback
Technical Details to Note
• Port mappings (80, 8000, 6379)
• API endpoints
• WebSocket connections
• Redis connections
• Plex integration points
The WebSocket-based synchronization mechanism
For this specific application, focus on showing how the real-time updates flow through the system and how the various components work together to provide a synchronized music playback experience across multiple clients.