|
| 1 | +# Sbotify |
| 2 | + |
| 3 | +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! |
| 4 | + |
| 5 | +## How to use it? |
| 6 | +For usage-only, please go to the [main website](https://a-rmz.github.io/sbotify/). There you'll find all the information you need use the app. |
| 7 | + |
| 8 | +Now, if you want to run your own instance, this is the place to be. |
| 9 | + |
| 10 | +## Setup |
| 11 | +### Spotify |
| 12 | +- Go to [Spotify developer's site](https://developer.spotify.com/) and create a new app. |
| 13 | +- Keep the tab open, you'll need the Client ID and Secret soon |
| 14 | + |
| 15 | +### Slack |
| 16 | +- Go to [Slack apps](https://api.slack.com/apps) and create a new one. |
| 17 | +- Create a [Slash command](https://api.slack.com/slash-commands) `/sbotify` (or however you wanna call it) that redirects you to |
| 18 | + - `https://youraddress.com/slack/incoming` |
| 19 | +- Create an [Interactive Message](https://api.slack.com/interactive-messages) integration that points to |
| 20 | + - `https://youraddress.com/slack/postback` |
| 21 | + - That is used for the buttons that will share the content |
| 22 | +- Activate the [bot user](https://api.slack.com/bot-users) |
| 23 | + - *Pro tip:* Use a cool bot name 😎 |
| 24 | + - The bot will be in charge of sending the music across the team |
| 25 | + - Go to OAuth & Permissions and add the `chat:write:bot` permission |
| 26 | + |
| 27 | +[Optional] |
| 28 | +- In case you want to use OAuth |
| 29 | + - Go to OAuth & Permissions and add a new Redirect URL redirects to |
| 30 | + - `https://youraddress.com/slack/auth` |
| 31 | + |
| 32 | +**NOTE:** All the URLs you provide for your app must be secure (`https`). |
| 33 | + |
| 34 | +### Sticking all together |
| 35 | +Now, going back to your environment: |
| 36 | +- Copy and rename the `.env.example` to `.env` and fill the required variables |
| 37 | + - *Client Secret*, *Client Id*, and *Redirect URI* from Spotify |
| 38 | + - *OAuth Access Token* from the Slack app |
| 39 | + |
| 40 | +The REDIRECT_URI will be used only in case you want to use OAuth, otherwise, you can leave it empty. |
| 41 | + |
| 42 | +Almost there. Now you have to install all the dependencies. Depending on your package manager you can either `npm install` or `yarn`. |
| 43 | + |
| 44 | +Run the database migrations in order to create the adequate schemas. |
| 45 | + |
| 46 | +```[ yarn | npm ] run migrate up``` |
| 47 | + |
| 48 | +## Build and run the app |
| 49 | +```[ yarn | npm ] run build``` |
| 50 | +```[ yarn | npm ] start``` |
| 51 | + |
| 52 | +-------- |
| 53 | +Developed with <3 |
0 commit comments