-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,56 @@ | ||
## Spotify React-Express App | ||
|
||
App to learn about the Oauth2 authorization flow from Spotify API and keep practicing with Express and React. | ||
|
||
## Local Installation & Set Up | ||
|
||
1. Register a Spotify App in your [Spotify Developer Dashboard](https://developer.spotify.com/dashboard/) and add `http://localhost:8888/callback` as a Redirect URI in the app settings | ||
|
||
2. Create a `.env` file at the root of the project based on `.env.example` and add your unique `CLIENT_ID` and `CLIENT_SECRET` from the Spotify dashboard | ||
|
||
3. Ensure [nvm](https://github.com/nvm-sh/nvm) and [npm](https://www.npmjs.com/) are installed globally | ||
|
||
4. Install the correct version of Node | ||
|
||
```shell | ||
nvm install | ||
``` | ||
|
||
5. Install dependencies | ||
|
||
```shell | ||
npm install | ||
``` | ||
|
||
6. Run the React app on <http://localhost:3000> and the Node server on <http://localhost:8888> | ||
|
||
```shell | ||
npm start | ||
``` | ||
|
||
## Deploying to Heroku with Git | ||
|
||
1. Create a [Heroku](https://www.heroku.com/) app | ||
|
||
2. Add your Heroku app as a git remote | ||
|
||
```shell | ||
heroku git:remote -a your-app-name | ||
``` | ||
|
||
3. Add `http://your-app-name.herokuapp.com/callback` as a Redirect URI in your Spotify app's settings | ||
|
||
4. In your app's **Settings** tab in the Heroku dashboard, add [config vars](https://devcenter.heroku.com/articles/config-vars#using-the-heroku-dashboard). | ||
|
||
Based on the values in your `.env` file, the `CLIENT_ID`, `CLIENT_SECRET`, `REDIRECT_URI`, and `FRONTEND_URI` key value pairs. Make sure to replace the `localhost` URLs with your heroku app's URL. | ||
|
||
```env | ||
REDIRECT_URI: http://your-app-name.herokuapp.com/callback | ||
FRONTEND_URI: http://your-app-name.herokuapp.com | ||
``` | ||
|
||
5. Push to Heroku | ||
|
||
```shell | ||
git push heroku main | ||
``` |