Find That Song is a web application that helps you find songs you've recently listened on Spotify, check some details about your listening history, and create new playlists. It is already deployed on Vercel.
Important Note: This application uses the Spotify API in Development Mode, which requires manual user authorization.
To access the application deployed on Vercel:
- Compile this TypeForm survey: Find That Song Access Request
- I will manually add your account to the authorized users list
- Once authorized, you'll be able to log in and use all the features
This restriction is due to Spotify's API limitations for apps in Development Mode. Only authorized users can access the application until it receives extended quota approval from Spotify.
-
Clone the repository:
git clone https://github.com/lonasozo/find-that-song.git cd find-that-**song**
-
Install dependencies:
npm install
-
Create a .env file in the project root and add the following environment variables:
SPOTIFY_CLIENT_ID=your_spotify_client_id SPOTIFY_CLIENT_SECRET=your_spotify_client_secret SPOTIFY_REDIRECT_URI=your_spotify_redirect_uri
-
Start the application:
node index.js
-
Open your browser and go to:
http://localhost:3000/login
-
Log in with your Spotify account and authorize the application.
-
You'll be redirected to the page with a list of your recently played songs.
Before deploying to Vercel, you can test the application locally using vercel dev
:
-
Install Vercel CLI (if not already done):
npm install -g vercel
-
Authenticate with Vercel:
vercel login
-
Link the project to Vercel (only the first time):
vercel link
- Follow the instructions to link the project to your Vercel account
-
Configure local environment variables:
- Vercel will automatically copy environment variables from the remote project
- You can also create a
.env.local
file for development configurations
-
Start the local development server:
vercel dev
- This command will emulate the Vercel environment locally
- The application will be available at
http://localhost:3000
-
Set the redirect URI on Spotify:
- During local testing, add
http://localhost:3000/callback
as a redirect URI in the Spotify Developer dashboard
- During local testing, add
Note: By using
vercel dev
, you'll test the application with the same serverless configuration it will have in production, ensuring greater deployment reliability.
To deploy this application to Vercel:
-
Configure Environment Variables on Vercel:
SPOTIFY_CLIENT_ID
: Your Spotify Client IDSPOTIFY_CLIENT_SECRET
: Your Spotify Client SecretSPOTIFY_REDIRECT_URI
: The callback URL (e.g.,https://your-project.vercel.app/callback
)
-
Update Spotify Settings:
- Access the Spotify Developer Dashboard
- Select your app
- Add the production redirect URL (e.g.,
https://your-project.vercel.app/callback
) - Save the changes
-
Deployment Commands:
# Install Vercel CLI (if not already done) npm install -g vercel # Login to Vercel vercel login # Deploy vercel # Production deployment vercel --prod
-
Verify the Deployment:
- Visit the URL provided by Vercel after deployment
- Verify that Spotify authentication works correctly
- Check that your recently played tracks are visible
Note: Make sure the
vercel.json
file is present in the project root.
If you wish to contribute to this project, open a pull request or report an issue.
This project is licensed under the MIT License. See the LICENSE file for more details.
Be sure to replace
your_spotify_client_id
,your_spotify_client_secret
, andyour_spotify_redirect_uri
with the correct values.