Skip to content

A Spotify 'Now Playing' screen with a 3D rotating Album cover built with Vue 3

License

Notifications You must be signed in to change notification settings

Inkapa/spotify-viewer

Repository files navigation

Spotify Now Playing Viewer

vue license Netlify

English | Français


Introduction

This is a simple project built in Vue 3 using the composition API.

This project was built in 5 days for the Spotify Dev Jam, it is the first project I ever built with Vue.js and served as an introduction to the framework and modern Javascript.

How does it work?

The Spotify Now Playing viewer will

  • ✅ - Use the Spotify Web API to get your current playing track (no other data is accessed)
  • ✅ - Use Access and Refresh Tokens to ensure that you're kept logged in between sessions
  • ✅ - Display the current track artist
  • ✅ - Show the Album cover spinning in 3D
  • ✅ - Set a matching vibrant background colour with node-vibrant

Preview

Live demo

Note: Due to #492 of the Spotify Web API, there is currently no way to stream the now playing song. By such, this project is meant to be self-hosted to avoid rate-limiting.

If you want to use the project you should fork it and build with Netlify or your own webserver using your own API keys (see How to use).

The demo website above only serves as demonstration, due to the API limits imposed by Spotify only the users whose emails have been manually added to the app can log in.

Preview image Preview image Preview image

Browser support

Most modern browsers are supported (excluding Internet Explorer).

IE / Edge Firefox Chrome Safari Opera
Edge Firefox Chrome Safari Opera

How to use

You can either clone the repo, compile the code offline, and upload to your own webserver or use one of the supported platforms.

The tutorial below is for Netlify, Vue.js works with other platforms as well such as Github and Gitlab Pages (though do take precautions with your API keys, for more info, please check out: https://cli.vuejs.org/guide/deployment.html#platform-guides)

1. Fork this repository

On this page, click on the 'Fork' button in the top-right to create a copy of the repo as-is on your account. Alternatively, you can clone the repo and push to Github.

2. Create a new project on Netlify

Log in to Netlify and click 'New site from Git'.

If you're doing this for the first time, you will need to authorise your Github account with Netlify by following the instructions.

Once authorised, follow the on-screen instructions to connect your repository. You should be fine to leave the default settings as-is here.

Click on 'Deploy site'.

Note: This project was built around Node 16. This has been set in the project environment.

3. Create Spotify Client keys.

To allow authorisation to your track data, you'll need to generate client keys. You can do this by logging in to the Spotify Dashboard and creating an app.

Set the 'Redirect URI' as the URL of your project in Netlify. This must be set else Spotify won't authorise the app.

You can leave the other settings (Callback URL, Bundle IDs etc) blank.

Copy down the Client Secret and Client ID and save your app in the Spotify Dashboard.

4. Add the Client ID and Client Secret to Netlify

Now that we have our Spotify API keys, we must let the app know that they exist.

To do this, navigate to Netlify > Site Settings > Build & Deploy > Environment

Under 'Environment variables', add two fields. The 'Keys' can be found in the env.sample file and the values will be the Client ID and Client Secret, respectively.

Hit save.

5. View App

Once the environment variables are in, you can now navigate to your Netlify site. You'll be prompted with a Spotify login button. Do that, and you're good to go!

Local setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Lints and fixes files

npm run lint

Customize configuration

See Configuration Reference.

Credits

This project was heavily inspired by Nowify.

Please give them your support!

Thanks node-vibrant and Bootstrap 5.0 for making the design process much easier.

License

MIT

About

A Spotify 'Now Playing' screen with a 3D rotating Album cover built with Vue 3

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published