Coder Social home page Coder Social logo

good-vibes-only-server's Introduction

Good Vibes Only

A simple server for authorizing Spotify-based client applications. The official OAuth flow is available here. Image by @carltraw

Getting Started

1) Set up your Spotify Developer account

Head over to their dashboard. Log in with your Spotify account, create a Client ID, and register a Redirect URI set to http://localhost:3001/oauth.

This URI is where Spotify will return the user upon successful OAuth.

2) Configure your environment

Create a .env file at the root of this repo, and fill out your Spotify client params:

SPOTIFY_CLIENT_ID=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
SPOTIFY_SECRET_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

3) Get the server running

You can do this using either Docker or Go:

With Docker

To use this method, you'll need to have Docker installed on your machine.

# build the container
$ docker build -t [NAME] .

# run the built image
$ docker run -p [PORT]:3001 [NAME]

You can use any name you want, as well as the port you want it to run on your machine. For example:

# build the container
$ docker build -t good-vibes-only-server .

# run the built image
$ docker run -p 4444:3001 good-vibes-only-server

# test that it's responsive
$ curl localhost:4444/alive
=> "ok"

With Go

To use this method, you'll need have the Golang toolchain installed on your machine.

# start app
$ go run .

# healthcheck
$ curl localhost:3001/alive

# get spotify login URL
$ curl localhost:3001/login

Web app (Optional)

You can write your own client, but if you'd like to see a live example that uses this server, check out the client repo.

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.