How fooxboy/musicx-wpf works
Project Type and Purpose
• This is a full‑stack, multi‑component music application platform:
– Desktop client (WPF/UWP) called “MusicX,”
– Web client (React) under MusicX.Site,
– Backend server (ASP.NET Core + SignalR) under MusicX.Server,
– Shared libraries (MusicX.Core, MusicX.Shared) for domain models & IPC,
– A suite of specialized libraries (DiscordRPC, FFMediaToolkit, IF.Lastfm.Core, VkNet.*),
– Aux tools (PsCompiler, SignalR.Protobuf),
– Infrastructure descr. (Dockerfile, docker‑compose, InfluxDB config).
High‑Level Components
A. Desktop Client (“MusicX” app)
B. Web Client (“MusicX.Site” React SPA)
C. Backend API & Real‑Time Hub (“MusicX.Server”)
D. Shared/Core Libraries (“MusicX.Core”, “MusicX.Shared”)
E. Third‑Party & Support Libraries
F. External Services & Data Stores
Subcomponents & Boundaries
A. Desktop Client (UI layer)
• Views & ViewModels (XAML + C#)
• Controls, Behaviors, Converters, Shaders, Styles
• Services (PlayerService, NavigationService, ShareService, etc.)
• Registry patches & Native interop
• References: MusicX.Core, MusicX.Shared, DiscordRPC, FFMediaToolkit, IF.Lastfm.Core, VkNet.AudioBypassService
B. Web Client
• React SPA: package.json, src/*.js, public/*
• Consumes REST endpoints & SignalR hub on the backend
C. Backend Server
• Controllers (Connect, Radio, Metrics) – expose HTTP JSON APIs
• SignalR Hub (ListenTogetherHub) – real‑time group sessions
• Services: RadioManager, RadioService, ListenTogetherService, SessionManager
• Config & settings (appsettings.json, launchSettings.json)
• Connects to: InfluxDB (metrics?), optional DB for sessions
D. Shared/Core Libraries
• MusicX.Core – domain models, Boom/Genius/VkService API wrappers, business logic
• MusicX.Shared – DTOs for SignalR callbacks, model checkers, versioning, HubBuilder extensions
• Used by both Desktop and Server for message contracts
E. Third‑Party & Support Libraries
• DiscordRPC – Discord Rich Presence via Named Pipes
• FFMediaToolkit – FFmpeg binding for audio/video decoding & encoding
• IF.Lastfm.Core – Last.fm REST client & scrobblers
• VkNet.AudioBypassService & VkNet.Extensions.DependencyInjection – bypass flows for VK audio
• SignalR.Protobuf – Protobuf protocol extension for SignalR messaging
• PsCompiler – auxiliary tool (likely for PowerShell compilation)
F. External Services & Data Stores
• Music Providers: Boom, Genius, VK, Last.fm, GitHub (to fetch artwork, metadata)
• Discord IPC
• InfluxDB (for metrics)
• Optional: file system (cache), local registry (for URL schemes)
Relationships & Data Flows
• Desktop ↔ MusicX.Core / MusicX.Shared: in‑process code calls
• Desktop → External Music APIs: HTTP/REST for metadata & streaming links
• Desktop → DiscordRPC via Named Pipe → Discord App
• Desktop ↔ Backend SignalR Hub: WebSocket for ListenTogether events
• Web Client ↔ Backend HTTP + SignalR
• Backend ↔ MusicX.Core / MusicX.Shared: shared model & logic
• Backend → InfluxDB (metrics writes)
• Support Libraries: imported by Desktop, Web (where applicable), Server
Architectural Patterns & Principles
• Layered Architecture: UI → Services → Domain/Core → External APIs
• Shared Kernel (MusicX.Core, MusicX.Shared) for common DTOs & business rules
• Publish‑Subscribe / Real‑Time with SignalR Hub
• Adapter/Wrapper pattern for each external API (BoomService, GeniusService, VKService, LastfmClient)
• Dependency Injection across Server & Libraries
• Micro‑library approach: each major concern in its own NuGet‑style project
Final Touches
• Every component used in code (project in solution) is represented.
• Keep it at one or two pages: high-level view first, then a zoomed‑in view for the desktop client’s internal layers if needed.