/goSpotify

goSpotify uses Oauth2.0 for signing in users with spotify account and gets interesting input from spotify.

Primary LanguageGoMIT LicenseMIT

goSpotify

GitHub license GitHub issues

goSpotify uses Oauth2 to authorize the users with their spotify account and returns the song/album currently being played

join goSpotify discord server

QuickStart

This project makes use of git hooks, before committing execute this line:

git config core.hooksPath .githooks
  1. Install Docker.
  2. Go to https://developer.spotify.com/ and login/register
  3. In dashboard add a new app, so in edit settings add this redirect url http://localhost:8080/callback
  4. Get your client id and client secret and create .env file like this:
       baseUrl=https://accounts.spotify.com/authorize?
       clientId=your-client-id
       clientSecret=your-client-secret
       redirectUrl=http://localhost:8080/callback
       scopes=user-read-playback-state
       tokenUrl=https://accounts.spotify.com/api/token
       getMeSpotify=https://api.spotify.com/v1/me
       currentlyPlaying=https://api.spotify.com/v1/me/player/
    
  5. Run the build command
    docker build -t gospotify:latest .
    
  6. Run the start command
    docker run -p 8080:8080 gospotify:latest
    

Todo list

these are the pending action items, list will be updated overtime

  • Add state in the url parmas when the user is redirected, to protect against csrf attacks
  • After successful authentication return a html page instead of text
  • Add error page for errors during /authorize step
  • Add more test cases
  • Add more functionality to the app
  • Buy a domain and add it to the cloud run

Deployment

CI/CD pipeline is configured in gcp, google cloud build processes the builds and deploys it to the cloud run as per cloudbuild.yaml file. This app is currently deployed to cloud run app