Lazy DJ is a web application that allows users to search for and queue songs on Spotify, creating a collaborative playlist experience. It's perfect for parties, gatherings, or any situation where you want to give others control over the music without handing over your device. The app is built with Flask and can be run as a Progressive Web App (PWA).
- Search for songs on Spotify
- Add songs to the current Spotify queue
- View the current playing track and upcoming queue
- Prevent duplicate song additions within a time frame
- 'Search' for the Admin Keyword to add a song no matter the time frame
- Responsive design and PWA capabilities for a native app-like experience
Before you begin, ensure you have met the following requirements:
- Python 3.7+
sudo apt install python3 sudo apt install python3-pip
- A Spotify Developer account and application
- Set "redirect URL" to be http://localhost:5000/callback for easy Docker deploy or create a custom DNS entry
- Check
Web API
- Check
Web Playback SDK
- Docker (optional, for containerized deployment)
-
Clone the repository:
git clone https://github.com/JPLeVangie/LazyDJ.git cd lazy-dj
-
Create a virtual environment:
python3 -m venv venv
-
Activate the virtual environment:
- On Windows:
venv\Scripts\activate
- On macOS and Linux:
source venv/bin/activate
- On Windows:
-
Install the required packages:
pip install -r requirements.txt
NOTE: You may need to add Flask to your
$PATH
variable:export PATH=$PATH:/home/USERNAME/.local/bin
-
Set up your environment variables. Create a
.env
file in the root directory with the following contents (example.env provided):SPOTIPY_CLIENT_ID=your_spotify_client_id SPOTIPY_CLIENT_SECRET=your_spotify_client_secret SPOTIPY_REDIRECT_URI=your_redirect_uri SECRET_KEY=your_flask_secret_key ADMIN_KEYWORD=admin # Optional TIP_QR_CODE_PATH=/tip-qr.png #Optional
-
Ensure your virtual environment is activated.
-
Start the Application:
python3 .\app.py
-
Open a web browser and navigate to
http://localhost:5000
-
Log in with your Spotify account
-
Start playing music from any Spotify clien
-
Search for songs and add them to the queue
To run the app in development mode with debug features enabled:
python3 .\app.py --debug
For testing the QR code feature during development:
- Place a test QR code image in the
static
folder (e.g.,static/tip-qr.png
) - Set the
TIP_QR_CODE_PATH
in your.env
file to/static/tip-qr.png
-
Clone the repository:
git clone https://github.com/JLeVangie/LazyDJ.git cd LazyDJ
-
Create a
.env
file in the root directory of the project and add your Spotify API credentials:SECRET_KEY=your_secret_key SPOTIPY_CLIENT_ID=your_spotify_client_id SPOTIPY_CLIENT_SECRET=your_spotify_client_secret SPOTIPY_REDIRECT_URI=your_spotify_redirect_uri ADMIN_KEYWORD=admin # Optional TIP_QR_CODE_PATH=/tip-qr.png #Optional
-
Build the Docker image:
docker-compose build
-
Run the Docker container:
docker-compose up
-
Create a
.env
file as described in step 2 of Option 1. -
Create or modify the
docker-compose.yml
file to use the pre-built image:version: '3' services: web: image: jlevangie/lazydj:latest container_name: lazydj ports: - "5000:5000" env_file: - .env environment: - SECRET_KEY=${SECRET_KEY} - SPOTIPY_CLIENT_ID=${SPOTIPY_CLIENT_ID} - SPOTIPY_CLIENT_SECRET=${SPOTIPY_CLIENT_SECRET} - SPOTIPY_REDIRECT_URI=${SPOTIPY_REDIRECT_URI} volumes: - app:/app restart: unless-stopped volumes: app:
-
Pull and run the Docker container:
docker-compose up
After following either option, open your browser and go to http://localhost:5000
to access LazyDJ.
To enable PWA features, the app includes a manifest.json
and a service-worker.js
file. When you open the app in a browser, you should see an option to install it as a web app. This allows for a native app-like experience, including being able to launch the app in full-screen mode.
Contributions to Lazy DJ are welcome. Please feel free to submit a Pull Request.
This project is licensed under the MIT License.