A modern web application built with SvelteKit for managing your Spotify playlists with ease.
- 🎵 Spotify Integration: Connect with your Spotify account
- 📋 Playlist Management: View and manage your playlists
- 🎵 Track Operations: Play, remove, and transfer tracks between playlists
- 🎮 Media Controls: Full playback control with scrubber and track navigation
- 🌙 Dark Theme: Beautiful dark interface with glassmorphism design
- 📱 Responsive: Works on desktop and mobile devices
- Spotify Developer Account: You need to create a Spotify app to get client credentials
- Node.js: Version 20 or higher
- Go to Spotify for Developers
- Log in with your Spotify account
- Click "Create App"
- Fill in the app details:
- App Name: Motify (or any name you prefer)
- App Description: Spotify Playlist Manager
- Redirect URI:
http://127.0.0.1:8181/callback - API/SDK: Web API
- Save the app and note down your Client ID
-
Install Dependencies:
npm install
-
Configure Environment Variables:
- The project includes a
.envfile with your Spotify app credentials - Update the
.envfile with your actual Spotify app details:
PUBLIC_SPOTIFY_CLIENT_ID=your_spotify_client_id_here PUBLIC_SPOTIFY_REDIRECT_URI=http://127.0.0.1:8181/callback
- Note: The
PUBLIC_prefix makes these variables available to the client-side code - Important: Use
127.0.0.1(loopback address) as required by Spotify's security policy - Security: Never include
SPOTIFY_CLIENT_SECRETin client-side applications
- The project includes a
-
Update Spotify App Settings:
- In your Spotify Developer Dashboard, set the redirect URI to:
http://127.0.0.1:8181/callback - Important: Spotify requires loopback addresses (127.0.0.1) for HTTP, not localhost or local network IPs
- This follows Spotify's updated security requirements as of April 2025
- In your Spotify Developer Dashboard, set the redirect URI to:
-
Start the Development Server:
npm run dev
- The server will start on the IP and port specified in your
.envfile - Make sure no other process is using the same port
- The server will start on the IP and port specified in your
-
Open the Application:
- Navigate to
http://127.0.0.1:8181/in your browser - Click "Connect with Spotify" to authenticate
- Navigate to
- Authentication: Click the "Connect with Spotify" button to authorize the app
- Select Playlists: Choose a source playlist to manage and optionally a target playlist
- Manage Tracks:
▶️ Play any track directly- 🗑️ Remove tracks from the current playlist
- ➡️ Move tracks to the target playlist (if selected)
- Playback Control: Use the player controls to play/pause, skip tracks, and scrub through songs
- View all your Spotify playlists
- Select source and target playlists
- Real-time track list updates
- Full playback control integration with Spotify
- Progress bar with seek functionality
- Previous/Next track controls
- Real-time playback status
- Play: Start playing any track immediately
- Remove: Remove tracks from the current playlist
- Move: Transfer tracks from source to target playlist
- SvelteKit: Full-stack web framework
- TypeScript: Type-safe JavaScript
- Spotify Web API: Music streaming integration
- FontAwesome: Icons and UI elements
- CSS Grid/Flexbox: Responsive layouts
- CSS Backdrop Filter: Glassmorphism effects
# Install dependencies
npm install
# Start development server
npm run dev
# Type checking
npm run check
# Build for production
npm run build
# Preview production build
npm run previewThe app requests the following Spotify scopes:
streaming: Control playbackuser-read-email: Read user emailuser-read-private: Read user profileuser-read-playback-state: Read current playbackuser-modify-playback-state: Control playbackplaylist-read-private: Read private playlistsplaylist-read-collaborative: Read collaborative playlistsplaylist-modify-public: Modify public playlistsplaylist-modify-private: Modify private playlists
- Spotify Premium: Some features require a Spotify Premium account
- Active Device: Playback control requires an active Spotify device
- Rate Limits: The app respects Spotify's API rate limits
This app is configured for easy deployment to Netlify:
-
Configure Spotify App for Production:
- In your Spotify Developer Dashboard, edit your app
- Add your production domain to the Redirect URIs:
https://your-netlify-domain.netlify.app/callback - Keep the local development URI as well:
http://127.0.0.1:8181/callback
-
Set Environment Variables in Netlify:
- Go to your Netlify site dashboard
- Navigate to Site settings → Environment variables
- Add the following variable:
PUBLIC_SPOTIFY_CLIENT_ID = your_spotify_client_id_here - Note: You don't need to set
PUBLIC_SPOTIFY_REDIRECT_URIin production as it's automatically determined from your domain
-
Deploy:
- Connect your GitHub repository to Netlify
- The build settings are automatically configured via
netlify.toml - Build command:
npm run build - Publish directory:
build
The app will automatically detect the environment and use the correct redirect URI for authentication.
-
Authentication Issues:
- Ensure your Spotify app's redirect URI is exactly:
http://127.0.0.1:8181/callback - Check that
PUBLIC_SPOTIFY_CLIENT_IDis set correctly in your.envfile - Verify your Spotify app is properly configured in the developer dashboard
- Important: Use
127.0.0.1notlocalhost- Spotify's new security requirements
- Ensure your Spotify app's redirect URI is exactly:
-
Port/Network Issues:
- If port 8181 is already in use, check with
lsof -i :8181 - Kill conflicting processes or change the port in both
.envandvite.config.ts - The app must run on the same port as configured in your Spotify app
- If port 8181 is already in use, check with
-
Spotify Security Errors:
- "INVALID_CLIENT: Insecure redirect URI" means you need to use
127.0.0.1not local network IPs - Spotify enforces HTTPS for non-loopback addresses, HTTP only allowed for
127.0.0.1 - Update your Spotify app redirect URI to match exactly:
http://127.0.0.1:8181/callback
- "INVALID_CLIENT: Insecure redirect URI" means you need to use
-
Environment Variables Not Loading:
- Make sure your
.envfile is in the project root directory - Restart the development server after changing environment variables
- Ensure variable names start with
PUBLIC_for client-side access
- Make sure your
-
Playback Issues:
- Make sure you have an active Spotify device (mobile app, desktop app, or web player)
- Spotify Premium is required for playback control features
-
Missing Tracks: Some tracks may not be available due to regional restrictions or licensing
This project is licensed under the MIT License - see the LICENSE file for details.