Lunch Roulette is a Slack app that randomly selects 3 nearby restaurants for lunch and allows channel members to vote for their preferred option. A winner is declared when the user that initiated the lunch roulette chooses to "finalize" (end) the game.
- Node.js (v20+)
- pnpm
- Vercel account
- Slack Workspace (and permission to install apps)
- Yelp API Key
- MongoDB Atlas Account
-
Clone the Repository:
git clone https://github.com/csamuel/lunch-roulette-slack-app.git cd lunch-roulette
-
Install Dependencies:
pnpm install
-
Set Up Environment Variables:
Create a
.env
file and add:YELP_API_KEY=your_yelp_api_key MONGODB_URI=your_mongodb_connection_string SLACK_VERIFICATION_TOKEN=your_slack_verification_token SLACK_BOT_TOKEN=your_slack_bot_token
-
Start the Development Server:
pnpm start
-
Test the Endpoint:
Use
curl
to send a POST request tohttp://localhost:3000/api/slack/lunchr
.
-
Install Vercel CLI:
npm install -g vercel
-
Deploy the App:
pnpm run deploy
-
Set Environment Variables on Vercel:
YELP_API_KEY
MONGODB_URI
SLACK_VERIFICATION_TOKEN
- Create a Slack App at Slack API Apps.
- Configure the
/lunchr
Slash Command with your Vercel endpoint. - Install the App to your workspace.
- Add the Lunch Roulette app to a slack channel.
- In Slack, type
/lunchr configure
to configure the location, distance, cost, etc. - Type
/lunchr
to start a new lunch roulette.
This project is licensed under the MIT License.
Enjoy your lunch with Lunch Roulette!