"Go Shufflify" is a web application that integrates with the Spotify API to provide a personalized music queue.
- User Authentication: Authenticate users via Spotify and manage sessions.
- Queue Management: Automatically manages the music queue based on user preferences and active playlists.
server.go
: Entry point for the application.types/
: Contains all the data structures used across the application.lib/
: Utility functions and common library code.data/
: Functions for interacting with the Spotify API and the database.routes/
: HTTP route handlers for various endpoints.
- Go (1.22.5 or later)
- Spotify Developer Account with Client ID and Client Secret
- Clone the repository:
git clone https://github.com/yourusername/go-shufflify.git
cd go-shufflify
- Install the required Go packages:
go mod tidy
- Set up your environment variables:
Create a .env
file in the root directory with the following content:
SPOTIFY_CLIENT_ID=your_spotify_client_id
SPOTIFY_CLIENT_SECRET=your_spotify_client_secret
SESSION_KEY=your_session_key # A really (!) random key, use 'uuid' or anything else generating random strings
PORT=3333
DB_FILE=./shufflify.db
- Start the application
./start_server.sh
This will create the shufflify.db
file and set up the necessary tables.
Start the server:
./start_server.sh
Open your browser and navigate to http://localhost:3333/
.
To disallow new user signups, set DiSALLOW_NEW_USERS
to true
in the .env
file.
- Login: Navigate to
/login
and log in with your Spotify account. - Queue Management: The application will automatically manage your music queue based on your preferences when 'Shuffle' is enabled.
Currently the Spotify API returns always 20 items in the queue. If there are not 20 items it just repeats the same items until the 20 items are filled up. This makes it hard to determine the real amount of tracks in the queue. Thus the shuffle works best if you only start playing a track from a Single before Go Shufflify takes over.
Contributions are welcome! Please feel free to submit a Pull Request or open an issue for any bugs or feature requests.
- Fork the repository
- Create a new branch (
git checkout -b feature-branch
) - Make your changes
- Commit your changes (
git commit -am 'Add new feature'
) - Push to the branch (
git push origin feature-branch
) - Create a new Pull Request
This project is licensed under the MIT License. See the LICENSE file for details.
Happy shuffling! 🎶