A React application that displays your Spotify profile, top artists, top tracks, playlists, and recently played music. Also integrates with Ticketmaster API to show upcoming concerts for your favorite artists.
- Utilizes the Spotify API to obtain User, Artists, Album, Playlist, Tracks, and Player information.
- Utilizes the TicketMaster API to get an Artist's upcoming events.
- Node.js and npm installed
- Spotify Developer Account
- Ticketmaster API Key (optional, for concert features)
git clone git@github.com:Alan0893/spotify-profile.git
cd spotify-profileCreate a .env file in the root directory with the following variables:
CLIENT_ID=your_spotify_client_id
CLIENT_SECRET=your_spotify_client_secret
REDIRECT_URI=http://127.0.0.1:8888/callback
CLIENT_URI=http://127.0.0.1:8888
PORT=8888
TICKETMASTER_API_KEY=your_ticketmaster_api_keyImportant Notes:
- The
REDIRECT_URImust use127.0.0.1(loopback IP) instead oflocalhost- this is required by Spotify's new HTTP redirect policy - Make sure the port matches between
REDIRECT_URI,CLIENT_URI, andPORT
- Go to Spotify Developer Dashboard
- Create a new app or select your existing app
- In the app settings, add the following Redirect URI:
http://127.0.0.1:8888/callback
- Save your Client ID and Client Secret to the
.envfile
Note: If your app is in Development Mode, you'll need to add your Spotify account email to the app's users list in the dashboard.
Install dependencies for both client and server:
# Install server dependencies
cd server
npm install
# Install client dependencies
cd ../client
npm installSince the backend serves the built React app, you need to build it first:
cd client
npm run buildThe server serves both the API endpoints and the built React client:
cd server
node indexThe application will be available at http://127.0.0.1:8888
When making changes to the client code:
- Make your changes in
client/src/ - Rebuild the client:
cd client npm run build - Restart the server to serve the updated build
The application uses the following Spotify API scopes:
user-read-private- Read user profile informationuser-top-read- Read user's top artists and tracksuser-follow-read- Read user's followed artistsuser-follow-modify- Follow/unfollow artistsplaylist-read-private- Read user's private playlistsplaylist-read-collaborative- Read collaborative playlistsuser-read-recently-played- Read user's recently played tracks
Note: Playlist creation/modification requires Extended Quota Mode approval from Spotify.
- View your Spotify profile with follower count
- Browse your top artists and tracks (all time)
- View your playlists
- See recently played tracks
- Get track recommendations
- Discover upcoming concerts for artists via Ticketmaster
- View detailed information about tracks, artists, and albums
Sample images of each page are available in the images/ directory:
User,Artist,Playlists,Recent,Tracks,RecommendationsArtist:id,Playlist:id,Album:id,Track:id