Skip to content

a-rmz/sbotify

Repository files navigation

Sbotify

PRs Welcome first-timers-only

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!

Sbotify logo

Getting Started

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.

Prerequisites

Spotify

Slack

  • Go to Slack apps and create a new one.
  • Create a Slash command /sbotify (or however you wanna call it) that redirects you to
    • https://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).

Sticking all together

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)

Installing

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

Running the tests

Tests are kind of outdated, but you still can run them with

$ [npm | yarn] test

Deployment

Make sure everything is done as for development and you should be good to go. ๐Ÿš€

Built With

Contributing

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. ๐Ÿ˜‰

Versioning

We use GitFlow for versioning. Please adhere to the naming convention.

Authors

  • Alejandro -Alex- Ramirez - Development - a-rmz
  • Kinduff - Deployment/Mentoring - kinduff

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • 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 ๐Ÿ‡ฒ๐Ÿ‡ฝ