Web application integrated with Spotify API that lets users give ratings to tracks from Spotify.
- User arrives at landing page and is asked to log in.
- After clicking the Log In button, user is redirected to the Spotify website for authentication.
- After authentication, user is redirected back to the app and lands on a Search and Rate page.
- User searches for tracks by typing track or artist name in the search bar.
- A list of tracks is displayed and the user can give each of them a rating from 1 to 10.
- When searching for an already rated track, the track's previous rating is displayed and user can update it.
- The ratings are stored by the application and the user can view a list of all rated tracks on the My Ratings page.
- React
- Node.js with Express framework
- PostgreSQL with Sequelize ORM
- Spotify API
This prodcedure describes how to launch the application in a development or testing environment, with client and server on the same machine. In production environments the client and server would be deployed on different machines.
-
Clone the repository.
-
Run
npm install
in the root of the project, in the server directory and the client directory. -
Register your app at Spotify Developers.
-
For your registered app, specify a redirect URI in the Redirect URIs field. This is the URI on the app server where credentials are sent after successful authentication with the Spotify website. It needs to match the value set in the
SPOTIFY_REDIRECT_URI
environment variable specified in step 5. -
Set up the following environment variables in your environment, or create a server/.env file and specify them in the file:
SPOTIFY_CLIENT_ID
- client ID provided for your app by Spotify DevelopersSPOTIFY_CLIENT_SECRET
- client secret key provided for your app by Spotify DevelopersSPOTIFY_REDIRECT_URI
- the URI on the app server where credentials are sent after successful authentication with the Spotify website; this needs to match the value specified in step 4SERVER_PORT
- port on which the backend server is runningSERVER_HOST
- host on which the server is runningDB_NAME
- name of the databaseDB_HOST
- host on which the database is runningDB_USERNAME
- username used to authenticate to the databaseDB_PASSWORD
- password for the database userDB_DIALECT
- dialect used by the databaseTEST_DB_NAME
- name of the testing database instance; used for the creation of testing database tablesTEST_DATABASE_URL
- URL of the testing database instance
-
Launch the database.
-
Launch the server by running
node index.js
inside the server directory. -
Launch the client by running
npm start
inside the client directory. -
Enjoy!
This project was forked from Gerard Soldevila's repository.