⚠️ IMPORTANT NOTICESpotify has announced the deprecation of several key features in their Web API, effective 27th November. Unfortunately, they provided limited details regarding this change.
🔗 For more (but not much) information, see their announcement: Introducing some changes to our Web API.
❤️ Love supporting artists? Consider trying Apple Music, which reportedly pays double the royalties to artists: Subscribe to Apple Music.
Take full control of new music recommendations and dive into fresh tracks with playlists that are made for you, by you.
playlistLabs is a Next.js web app that empowers users to create custom Spotify playlists based on set preferences and automatically refreshes them at a specified frequency. It leverages the Spotify Web API, Vercel Cron Jobs, and a MongoDB database (modeled with Mongoose) to offer a tailored, dynamic music discovery experience.
Inspiration: This app was inspired by the overwhelming amount of mid lofi hip-hop and and random 'The Three Investigators' episodes in my Spotify Discover Weekly playlists.
- Customizable Playlists: Users can create playlists by selecting up to five "seed" preferences (artists, tracks, genres) and by setting rules for track characteristics (e.g., danceability, mood, tempo).
- Automated Updates: Set your playlist to refresh at specific intervals, ensuring it stays fresh with the latest recommendations.
- Integrated with Spotify API: Full Spotify API integration allows users to connect directly to their Spotify account for seamless playlist creation and updates.
- Coming Soon: Playlist version review and restoration for tracking playlist history (backend prepared, frontend work in progress).
To set up and run llaylistLabs locally, follow these steps.
-
Spotify Developer Account:
- Create a Spotify Developer Account to obtain a Client ID and Client Secret.
- Add your NextAuth callback URL to the callback urls:
- Go to your app settings in the Spotify Dashboard
- Add
http://localhost:3000/api/auth/callback/spotifyto the Redirect URIs - Save the changes
-
MongoDB Database:
- Set up a MongoDB database (e.g., via MongoDB Atlas) and acquire the connection URI (include your username and password).
-
Clone the repository:
git clone https://github.com/morrisRio/playlistlabs.git cd playlistlabs -
Install dependencies:
npm install
-
Environment Variables:
- Create a
.envfile based on the provided.env.example, adding your Spotify credentials, MongoDB URI and NextAuth secet. - You can generate a secret using the following command in your terminal
openssl rand -base64 64
- Create a
-
Run the development server:
npm run dev
- Open http://localhost:3000 in your browser to view the app.
- Frontend: Next.js with the App Router, Tailwind CSS
- API/Backend: NextAuth.js for authentication, SWR for data fetching, MongoDB for storage
- Deployment: Hosted on Vercel, with Vercel Cron Jobs for scheduled playlist updates
- Playlist Versioning: Future versions will include the ability to review and restore past playlist versions, allowing users to track the history of their playlist changes.
- User Feedback & Suggestions: As this app is currently in beta, feedback is welcomed to improve the experience.
Contributions are welcome!
- Fork the Repository
- Create a Feature Branch (
git checkout -b feature/YourFeature) - Commit Your Changes
- Push to Branch (
git push origin feature/YourFeature) - Open a Pull Request
This project is licensed under the MIT License. See the LICENSE file for details.
For questions or feedback, please contact the maintainer:
- Email: hello@playlist-labs.com
- GitHub: morrisRio