Repository navigation
Quick Start
Go to: https://metrinom.herokuapp.com/
-
You have cloned this repository onto your local machine
-
Node.js (Make sure your node version is more than
11or the server might crash, this is because some functions such asflat()(which is used in the backend) from ES2019 require node version11or higher) -
Npm (However this does come with Node.js)
-
A code editor (VS code was used in the development of this project)
-
Open your terminal and
cdinto the server directory in server -
Run
npm installinside of the server directory -
Create a
.envfile in the ./client folder with the following attributes:
SPOTIFY_CLIENT_ID=<your id>
SPOTIFY_CLIENT_SECRET=<your secret>
Steps to generate these secrets
Go to: https://developer.spotify.com/dashboard/applications and create a new application, after the application has been created you will see that a Client Id and a Client Secret has been generated. Paste these into the environment file above.
- A sample file
.envwill look like this
SPOTIFY_CLIENT_ID=asf124asfasf112
SPOTIFY_CLIENT_SECRET=fasfj25j122
- Add redirect URI to the spotify application
Steps to add redirect URI
To do this, go to your application the spotify dashboard; you will see this at the top of your page:

Click on Edit Settings and add http://localhost:3001/auth/spotify/callback as a redirect URI:

You will then see this when added:

- Make sure your MongoDB database is running locally by using the relevant commands to your operating system (Note this step is important else the server might crash if Mongo is not running on your computer). See here for more on details on running MongoDB locally.
Terminal output when database is not running locally and you attempt to start the server

To fix this ensure MongoDB is running locally on your computer.
- After the
.envfile has been filled in and the redirect URI has been added. Ensure thatport 3001is not occupied else you will have to change the redirect URI above accordingly. In the server directory, runnpm startin terminal to start the server.
Expected terminal output after starting server

- Open your terminal (while your server is running) and
cdinto theclientdirectory for this project. - Run
npm installinside of the client directory - Run
npm startinside of the client directory and ensure you are onport 3000
Expected terminal output after starting client

Expected browser output when going to http://localhost:3000/ on your browser

After the client and server have started running, you can start using the app.