A React frontend built on a Python Flask backend allowing a user to track their favourite songs, artists, and genres over different periods of time.
- Create virtual environment:
python -m venv backend-venv - Enter vitrual environment PowerShell:
./backend-venv/Scripts/Activate.ps1 - Upgrade pip version:
python -m pip install --upgrade pip - Install packages:
pip install -r requirements.txt
- Enter frontend directory:
cd ./frontend - Install React packages:
npm install
Create a new .env file in the directory /backend and add the following constants:
FLASK_HOST=localhost
FLASK_PORT=5000
FLASK_DEBUG=true
FLASK_SECRET_KEY=your-amazing-super-secret-key
CLIENT_ID=Spotify-Client-ID
CLIENT_SECRET=Spotify-Client-Secret
REDIRECT_URI=http://localhost:5000/auth/callback
FRONTEND_URL=http://localhost:3000- Go to the offical Spotify API website: https://developer.spotify.com/
- Login using your Spotify account details.
- Go to your dashboard and press
'Create app'- Add your custom app name: eg.
Tracking For Spotify - Add your custom app description: eg.
Website to help users track their favourite artists! - Add Redirect URI:
http://localhost:5000/auth/callbackor change to a different URL/domain you wish to use instead but make sure it is the same as in your
.envfile.
- Add your custom app name: eg.
- Copy your Spotify app's CLIENT_ID and CLIENT_SECRET and add to your
.envfile.
Run the following in the Python virtual environment:
- Enter backend directory:
cd ./backend - Start Flask server:
python app.py
In a seperate terminal:
- Enter frontend directory:
cd ./frontend - Run development server
npm startor run
npm buildfor a production build.
This app uses the Spotify Web API to display user-specific data such as favorite songs, artists, and genres. All Spotify content, including trademarks, logos, and music data, is the property of Spotify AB. This project is not affiliated with, endorsed by, or officially connected to Spotify in any way.