Skip to content

Robinnnnn/good-vibes-only-server

Repository files navigation

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.

About

Go server for performing Spotify OAuth

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published