SongDash
A multiplayer party game based on "Jaka to melodia" (Name that Tune). Players compete to identify songs by pressing a button on their phones, pausing the music and entering a queue to guess.
How It Works
The game requires four components:
- Server - Runs on the same machine playing music, controlling playback via OS media protocols
- Host - Verifies answers, awards points, and manages game flow
- TV Display - Shows play/pause status and the queue of who buzzed in first
- Players - Join via their phones with a simple interface: nickname, score, and a button to buzz in
When a player presses their button, the music pauses and they join the queue. The host determines if their answer is correct and awards points accordingly. Network delay on local WiFi is minimal and negligible compared to human reaction time.
Setup
Development
-
Clone the repository
-
Install dependencies:
pnpm install -
Configuration (optional):
For customizations, look at
.env.examplefor possible values, and change them in.envbefore launchingIMPORTANT: for a working QR code generation, create a
.envfile with at leastSERVER_HOST -
Start the development server:
pnpm dev -
Open the interfaces:
- Host:
http://<ip-address>:2500/host - TV:
http://<ip-address>:2500/tv - Players:
http://<ip-address>:2500/player - Debug:
http://<ip-address>:2500/debug
- Host:
Production Build
Build optimized client files and server:
pnpm build
This will:
- Bundle and minify all client-side code with Vite
- Generate standalone binaries for Windows and Linux (Note: Binary generation currently has ESM compatibility issues and is under development)
Run the production server:
pnpm start
Technical Details
Written in vanilla HTML/CSS/JavaScript. May be ported to TypeScript if complexity increases. Currently media assets (images, sounds) are not included in the repository to avoid copyright issues. The plan is to support custom assets in a designated folder for things like button textures, backgrounds, and sound effects.
Requirements
- Node.js
- A media player running on the server machine
- All devices on the same network
Architecture
The server controls media playback through system-level APIs:
- Linux: D-Bus MPRIS2 (Spotify, VLC, Rhythmbox, etc.)
- macOS: AppleScript (Spotify, Music)
- Windows: GlobalSystemMediaTransportControls
Communication happens over HTTP (port 2500) for serving pages and WebSockets (port 2501) for real-time state updates.