This is a ready-to-use Slack app that helps your team pick destinations for your coming meal. A vote mechanism is included to make everyone happy. Restaurants can be weighted so the choices fit your preference more.
This project aims to make the app free of charge and easy to maintain, by leveraging Cloudflare Workers free plan as the web server and exploiting Slack conversation bookmark as the data storage.
- Add / Update / Remove restaurants
- Adjust restaurant weighting
- Pick 1 or more restaurants using weighted random selection
- Vote anonymously for the picked restaurants
- View vote results
- View cumulative statistics (e.g., win rate) so you can understand your team's preference more
- Scheduled execution with Slack Workflow integration
- [Privacy Bonus] No data stored outside of the Slack conversation
The setup involves two components, creating a Slack app and a Cloudflare Workers.
- A Slack account in a workspace, with permissions to
- create an app
- install an app
- A Cloudflare account, with permissions to
- create a Workers
- change the Workers domain (Optional)
- Node.js and npm installed on your machine
- Clone this repository to your machine, with either
- Github Desktop or any other Git client
git clone https://github.com/Kit-p/Slack-Restaurant-Picker.git
- Sign in to your Cloudflare account in a web browser, by visiting https://dash.cloudflare.com/login.
- Expand "Workers & Pages" section inside the left sidebar and click "Overview".
- [Optional] Click "Change" next to the "Your subdomain" section inside the right sidebar to modify your Cloudflare Workers domain. You may use the default one provided or later on add a custom domain that does not end in "workers.dev" (not covered here).
- Replace the domain part of the
APP_ENDPOINT
environment variable inwrangler.toml
and the domain part of all the urls (BEFORE/api/*
) inmanifest.jsonc
, with your Cloudflare Workers domain. - Replace the
account_id
field inwrangler.toml
with your Cloudflare account ID. - Open a terminal in the project folder, and execute the following commands in order, to deploy the Cloudflare Workers.
npm install
(installs project dependencies)npx wrangler login
(look at the output and authenticate with your Cloudflare account)npx wrangler publish
- Confirm that the Cloudflare Workers has been deployed in the dashboard.
- Sign in to your Slack account in a web browser, usually by visiting https://your-workspace-slug.slack.com.
- Visit https://api.slack.com/apps and click "Create new app" at the top right corner.
- Click on "From an app manifest".
- Select the Workspace where you want to create the app. Then, click "Next".
- Remove all the
// EDIT
inmanifest.jsonc
(make sure you did actually replace the domain with your Cloudflare Workers domain as in step 5), copy EVERYTHING in the file, and replace the example manifest. Then, click "Next". - Click "Create".
- Confirm that the Slack App has been created in the dashboard.
- Add the app to your workspace and invite it to a channel. Type
/restaurant_picker help
to see all the available commands. Hurray! - [Optional] Create a Workflow using the Workflow Builder for a scheduler execution.