Spotify Now Playing
This application is running and publicly available at https://nowplaying.tinyrobot.co/.
This is an API wrapper for Spotify that allows users to get their currently playing track with an API call.
This application uses Bootstrap for the front end, and NodeJS running on AWS Lambda on the back end. Deployment is done using Serverless.
This step is only needed if you're doing dev work on the project and want to use ESLint (recommended). From the project's root:
Deploying the Back End
Clone this repo.
Create an AWS IAM user with programmatic access. Add the keys to your local AWS credential files using the name
Create a Spotify integration in the Spotify Developers dashboard at https://developer.spotify.com/dashboard/. After you create the app, Spotify will provide a Client ID and Client Secret. Save these for the next step.
The application expects the following environment variables:
||Spotify Client ID provided in the Spotify Developer Dashboard|
||Spotify Client Secret provided in the Spotify Developer Dashboard|
||The absolute URL of the page to redirect the user to on successful login|
||The absolute URL of the page to redirect the user to on unsuccessful login|
||The absolute URL of a custom endpoint URL, if desired. If this is left blank, the API endpoint URL will be generated automatically by AWS|
- Deploy the
authservice. From the project's root:
cd auth npm ci serverless deploy [--stage dev|staging|prod]
Once deployment is complete, Serverless will provide a URL for the newly created
redirectAPI endpoint. Copy this URL.
In the Spotify Developer Dashboard, edit the settings for your integration. In the section titled Redirect URIs, add the URL you copied in the previous step.
playback-stateservice. From the project's root:
cd playback-state npm ci serverless deploy [--stage dev|staging|prod]
Building the Front End
Build the application front end. Go back to the project's root and do the following for a development environment:
cd app npm ci npm run start
This will run the application in a local development server at
localhost:3000. To create an optimized production build, run
npm run build. The compiled assets will be created in the