Coder Social home page Coder Social logo

spotify-remote's Introduction

spotify-remote

Remote app for Spotify.

App uses spotify-web-api-node for authentication/authorization.

Live app can be found here.

Run locally

Create a new spotify app

You'll need to create a new Spotify app through their dashboard to get a new Client ID and Client Secret. In the app settings add http://localhost:3000/ to the Redirect URIs.

Changes to server

EITHER make a .env file OR hard code the ID and Secret into server.js

EITHER .env

Make a new .env file in the root directory containing:

CLIENT_ID="< insert Client ID here >"
CLIENT_SECRET="< insert Client Secret here >"
REDIRECT_URI="http://localhost:3000/"

OR Hard code ID and Secret into server.js

On line 13:

const credentials = {
	clientId: "< insert Client ID here >",
	clientSecret: "< insert Client Secret here >",
	redirectUri: "http://localhost:3000/",
}

Comment out / uncomment lines in server.js

Comment out lines:
  • 20
  • 49
  • 50
  • 51
Uncomment lines:
  • 22
  • 23
  • 24

Changes to client

useAuth.js

useAuth.js can be found in client/components/useAuth.js

Change line 9 to:

.post("http://localhost:8000/login", { code })

spotify.js

spotify.js can be found in client/components/spotify.js

Change lines 2 and 3 to:

const redirectUri = "http://localhost:3000/"
const clientId = "< insert Client ID here >"

Remote.js

Remote.js can be found in client/pages/Remote.js

Change line 11 to:

clientId: "< insert Client ID here >",

Running the server and the client

npm install
node server.js
cd client
npm install
npm start

Client should be at http://localhost:3000/ and server at http://localhost:8000/

Screenshots

Welcome screen

Remote screen

spotify-remote's People

Contributors

dobromiryor avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.