Sparkles is a simple little Slack application for recognizing your teammates and friends in the form of meaningless internet points sparkles. When installed to a Slack workspace, a /sparkle slash command is added and you can get started immediately!
Tip: You can always view usage information in Slack using /sparkle help
To sparkle someone, use /sparkle immediately followed by a username and, optionally, a reason:
/sparkle @davidcelis [reason]
Reasons don't require any particular format, but if you want them to flow better when reading them later, it's best to start any reason with a coordinating conjunction (that's just a fancy way to say words like "for", "because", or "so").
/sparkle @davidcelis for being so awesome
Once Sparkles has been installed to your slack workspace, any member of your team can go to sparkles.lol to sign into the web frontend and view the team leaderboard!
You can also view the leaderboard in Slack using the /sparkle command. Some Slack teams get pretty big, though, so leaderboards viewed this way are kept to the top ten sparklers.
/sparkle stats
When looking at the team leaderboard on sparkles.lol, you can click anybody's username to see a complete history of their sparkles. This includes all kinds of handy information! You can see who gave each sparkle, what their reasons were, the Slack channel where it happened, and even a handy permalink back to the original message in Slack where Sparklebot worked its magic.
Like with the full leaderboard, you can also see anybody's ten most recent sparkles right within slack:
/sparkle stats @davidcelis
Both the slack application and sparkles.lol are free to use! Except for the reasons given for sparkles, we never store messages from Slack itself. However, maybe you work for an organization with strict rules about what data is allowed into or out of Slack. If that's the case, Sparkles is easy to host yourself! In fact, with only a little bit of configuration, you can host Sparkles on Heroku or with Dokku.
Sparkles is a Rails application using the following dependencies:
- Ruby 3.0.2 (and Bundler)
- Node v12.16.2 (and Yarn)
- PostgreSQL 13.4
- Redis 6.2.6
At least, these are the versions in use upon writing this README. Depending on the dependency, they may be updated randomly; the publicly available Sparkles application is hosted via Dokku, so dependency management is less of a concern. For this reason, I highly recommend hosting via a service like Heroku or Dokku so that you can take advantage of buildpacks.
Slack recently made it easy to create a preconfigured Slack application using App Manifests. Visit https://api.slack.com/apps?new_app=1 and choose the option to create an app from an app manifest. Choose a development workspace (it's best to choose one that you control so that you can install Sparkles yourself without requiring review from a workspace admin) and paste in the contents of our example app_manifest.yml file, making sure to replace example.com in any URL with the domain where you're planning to host Sparkles.
Newer Rails applications use encrypted YAML files to store application secrets. You'll need to generate one with your own credentials:
$ bin/rails credentials:editThis will create two new files: config/credentials.yml.enc and master.key. Keep the former in version control and keep the latter excluded. Our standard .gitignore file handles this for you.
When you run the above command, you should find yourself in a text editor for the config/credentials.yml.enc file; paste the following in, adding adding the required values:
# Found on your Slack application's "Basic Information" page
slack:
client_id: # required
client_secret: # required
signing_secret: # required
# An ingestion URL for error handling using Sentry. This isn't required, but
# Sentry has a generous free tier, so you may as well sign up and set up a
# quick project at http://sentry.io/signup/
#
# Example: https://aa80f6df85a993c7657ec39a0@o12345.ingest.sentry.io/1234567
sentry_dsn: # optional
# Used as the base secret for all MessageVerifiers in Rails, including the one
# protecting cookies. Generate one by running `rails secret`
secret_key_base: # requiredYou can deploy Sparkles however you like; the only two required processes are the Rails server (Puma, by defualt) to handle web requests, and Sidekiq to handle background job processing. Sparkles includes a Procfile to declare these processes, so deployment to a service like Heroku or Dokku is easy. However you deploy, you'll need to define three environment variables:
DATABASE_URL: A connection string for a PostgreSQL database. This is defined automatically for you if you're using something like Heroku or Dokku and add the PostgreSQL plugin/resource.REDIS_URL: A connection string for a Redis database. This is defined automatically for you if you're using something like Heroku or Dokku and add the Redis plugin/resource.RAILS_MASTER_KEY: The contents of themaster.keyfile you generated earlier.
Encountered a bug? Have an idea for something that Sparkles doesn't do yet? Feel free to file an issue. Or, if you're a developer yourself, fork the repository, make some changes, and open a Pull Request!
Sparles is inspired by an old Hubot script that was very popular at GitHub and gave us a fun, silly way to show appreciation to fellow hubbers. Everybody loved sparkles except @scottjg and @dreww.