An app that allows the creation of a music pool where people can add/vote for songs to be played
Thanks to @Kmille for deezer-downloader
SoundPool works with three components:
- The
central serverhosts the API, handles the player units and acts as an intermediary between the player units and the clients. It needs to be accessible from the clients and from the players. - The
player unitsare the one that actually play the music. - The
websiteallows the clients to interact with the players and control the music.
To install the central server
git clone https://github.com/Trickhish/SoundPool
cd SoundPool/central_server
pip install -r requirements.txt
python install.pyBy default, the port 21623 will be used and only the local host will be authorized.
The settings can be changed in cs_config.ini
To install the central server
git clone https://github.com/Trickhish/SoundPool
cd SoundPool/player_unit
pip install -r requirements.txt
python install.pyThe website is a normal angular website.
You can download a pre-built version from the releases section.
If you do that, the website will be configured with http://localhost:21623 as API url.
You can also edit the apiUrl variable in client/soundpool/src/app/api.service.ts and build it yourself with ng build --prod
or use the installation script that will set the API url from the parameter:
node install.js <api_url>
# ex: node install.js http://localhost:21623The central server uses the FastAPI python library.
It can be launched by just running the server.py script.
Or using the uvicorn command: uvicorn server:app --host 0.0.0.0 --port 21623 --workers 4
For a production environment, it's important to pass debug to false in the configuration file.
It is also recommended to restrict the traffic outstide of the local network by passing host to localhost and to use a proxy with HTTPS configured.
A good practice for background scripts that need to run reliably is to create a systemd service.
The player can just be run as any python script.
Like the Central Server, it is advised to create a service to automate the start, auto restart and facilitate the logs analysis.
By default, the unit will use localhost:21623 as the server url.
Once the static website is built, you can use any HTTP server to make it accessible (apache, nginx, caddy...).
For the angular routing to work, it may be necessary to setup URL rewriting.
For apache, you can follow this article.
The libasound2-dev package is required
ffmpeg is required as well as C++ Build Tools
