A Slack app that allows you to easily share the new artists you discover, or that cool song you want your teammates to listen to!
For usage-only, please go to the main website. There you'll find all the information you need use the app.
Now, if you want to run your own instance, this is the place to be.
- Go to Spotify developer's site and create a new app.
- Keep the tab open, you'll need the Client ID and Secret soon
- Go to Slack apps and create a new one.
- Create a Slash command
/sbotify
(or however you wanna call it) that redirects you tohttps://youraddress.com/slack/incoming
- Create an Interactive Message integration that points to
https://youraddress.com/slack/postback
- That is used for the buttons that will share the content
- Activate the bot user
- Pro tip: Use a cool bot name ๐
- The bot will be in charge of sending the music across the team
- Go to OAuth & Permissions and add the
chat:write:bot
permission
[Optional]
- In case you want to use OAuth
- Go to OAuth & Permissions and add a new Redirect URL redirects to
https://youraddress.com/slack/auth
NOTE: All the URLs you provide for your app must be secure (https
).
Now, going back to your environment, copy and rename the .env.example
to .env
and fill the required variables:
NODE_ENV -> current environment (development, testing, production)
LOGFILE -> name of the file that will be used to log
BASE_URL -> url of the website (in case you're not using authentication, you can leave it blank -but don't delete it)
SPOTIFY_CLIENT_ID -> Taken from the Spotify app you created
SPOTIFY_CLIENT_SECRET -> idem
SLACK_CLIENT_ID -> From the Slack app dashboard
SLACK_CLIENT_SECRET -> idem
SLACK_REDIRECT_URI -> OAuth redirect uri (in case you're not using authentication, you can leave it blank)
First install the dependencies, you can use npm
or yarn
:
$ npm install
or
$ yarn
After everything is installed, run the database migrations in order to create the adequate schemas.
$ [yarn | npm] run migrate up
To run the application, first run the build:
$ npm run build
or
$ yarn build
and then run the app
$ [npm | yarn] start
You should see some debug dump in the console, something like this:
$ debug: Refreshing token
$ debug: Token refresh service running every 3600 seconds
$ debug: Mounting service Spotify
$ debug: Mounting route /slack
$ debug: Mounting route /telegram
$ debug: Sbotify server running in port 4500!
$ debug: The new token is XXXXXXX
Tests are kind of outdated, but you still can run them with
$ [npm | yarn] test
Make sure everything is done as for development and you should be good to go. ๐
- Express - API server and router
- Spotify Web API Node - Spotify API wrapper for Node
- Winston - Multi-transport async logging library for Node
- Flow - Type checker
- Jest - Testing framework
If you're interested in contributing, you're awesome! Isn't OSS great? Please read the contribution guide for details on the process for submitting pull requests, it's not as hard as it sounds. ๐
We use GitFlow for versioning. Please adhere to the naming convention.
This project is licensed under the MIT License - see the LICENSE.md file for details
- PurpleBooth for developing this amazing README template
- Anyone whose code was used, thanks for contributing to the the Open Source community
- Anyone who helped with the development of this project
- Most important, to you, for getting this far on the readme and showing interest in the project. You're awesome! ๐
Developed with โค๏ธ from ๐ฒ๐ฝ