Helps teams to find the best birthday gift for their colleagues.
- Create a new Slack app on the Slack App Dashboard. (From scratch)
- Navigate to
Basic Information
and make a copy of yourSigning Secret
. - Navigate to
OAuth & Permissions
sub-page -> install app to workspace -> save yourBot User OAuth Token
. - Then scroll below to the
Scopes
section and add these Bot Token Scopes:
- channels:read
- chat:write
- groups:read
- im:write
- mpim:read
- users:read
- channels:history
- groups:history
- im:history
- mpim:history
- mpim:write
- Open the
Event Subscriptions
sub-page -> enable events. (We will add the url later.) - Scroll below
Subscribe to bot events
and add these scopes:
- member_joined_channel
- member_left_channel
- Open the
Interactivity & Shortcuts
sub-page -> enable interactivity. (We will add the url later.)
- The core channel is the single source of truth regarding members who are part of the team.
- The random channel is where the bot will post the gift wish teaser messsages.
You can use the same channel for both it is up to you.
Make sure you have the channel id(s) and add the bot to both channel(s).
- Ensure you have an AWS IAM user.
- Set secrets:
npx sst secrets set SLACK_LOG_LEVEL debug
npx sst secrets set SLACK_BOT_TOKEN <your-bot-token>
npx sst secrets set SLACK_SIGNING_SECRET <your-signing-secret>
npx sst secrets set CORE_SLACK_CHANNEL_ID <your-test-channel>
npx sst secrets set RANDOM_SLACK_CHANNEL_ID <your-test-channel>
npx sst secrets set ADMIN_SLACK_USER_ID <your-test-user>
npx sst secrets set DEPUTY_ADMIN_SLACK_USER_ID <your-test-user>
- Install dependencies:
pnpm i
- Make sure you have docker-compose available.
- Copy the
.env
file to a.env.local
file. - Run
docker-compose up -d
to start the database.
pnpm dev
- Find the ApiEndpoint url of your deployed app in the console output.
- Open the
Event Subscriptions
sub-page. - Add the url:
<ApiEndpoint>/slack/event
to theRequest URL
field. - Slack sends a challenge request to the url to verify the endpoint. Make sure you have the app running locally for it to succeed.
- Open the
Interactivity & Shortcuts
sub-page. - Add the url:
<ApiEndpoint>/slack/interaction
to theRequest URL
field.
Fill .env.local
file with the secrets.
pnpm test
pnpm test:unit
pnpm test:integration
pnpm test:ci
All urls are displayed in the console output.
- Ask birthday from everyone: open
<ApiEndpoint>/botJoined
- Ask birthday from specific user: open
<ApiEndpoint>/userJoined?userId=<slack user id>
- Send out birthday fill reminder: open
<ApiEndpoint>/birthdayPing
- Only sends it out to users who have not filled in their birthday yet.
- Send out icebreaker question: open
<ApiEndpoint>/icebreaker
- Only mentions users whose birthday is between 1 and 3 months.
- Send out birthday present idea question: open
<ApiEndpoint>/askPresentIdeas?userId=<birthday person slack user id>
- Sends it out related to users whose birthday is in exactly 2 months.
- Send out birthday present idea + squadjoin question: open
<ApiEndpoint>/squadJoin?userId=<birthday person slack user id>
- Create birthday squad: open
<ApiEndpoint>/createBirthdaySquad?userId=<birthday person slack user id>
- Clean up birthday data: open
<ApiEndpoint>/cleanup?userId=<birthday person slack user id>
pnpm migration:generate