A Slack bot that tracks daily check-in streaks in channels with celebration messages for achievements.
- 📊 Track daily check-in streaks per user per channel
- 🎉 Celebrate achievements at milestones (1, 5, 10, 20, 50, 100, 250, 500+ days)
- 📅 Configure days off (weekends, vacations) so streaks aren't broken unfairly
- 🌍 Timezone-aware using Slack's user timezone data
- 🔄 Multi-channel support - separate streaks per channel
- Node.js 20+
- Fly.io account (for deployment)
- Slack workspace with admin access
-
Clone the repository
-
Install dependencies:
npm install
-
Copy
.env.exampleto.envand fill in your Slack credentials:cp .env.example .env
-
Run the bot:
npm run dev
-
Install Fly.io CLI: https://fly.io/docs/getting-started/installing-flyctl/
-
Login to Fly.io:
fly auth login
-
Create app and volume:
fly launch --no-deploy fly volumes create slackline_data --size 1
-
Set secrets:
fly secrets set SLACK_BOT_TOKEN=xoxb-your-token-here fly secrets set SLACK_SIGNING_SECRET=your-secret-here
-
Deploy:
fly deploy
-
Get your app URL:
fly status
Use
https://your-app.fly.devfor Slack event subscriptions.
See docs/SLACK_SETUP.md for detailed instructions on configuring your Slack app.
Quick version:
- Create app at https://api.slack.com/apps using
slack-app-manifest.yaml - Install app to workspace
- Copy Bot Token and Signing Secret to environment variables
- Configure event subscription URL:
https://your-app.fly.dev/slack/events - Invite bot to channel:
/invite @Slackline
/slackline help- Show all commands/slackline stats- View your streak stats/slackline dayoff <date>- Mark single day off (YYYY-MM-DD)/slackline vacation <start> <end>- Mark vacation range/slackline weekends <on|off>- Toggle weekends as days off/slackline list-daysoff- List your configured days off
- Post any message in a monitored channel to check in for the day
- Streaks count consecutive working days (excluding your configured days off)
- Multiple posts in one day = one check-in (idempotent)
- Achievement celebrations posted publicly in channel
- 1, 5, 10, 20, 60, 120 working days
- 50, 100, 250, 500, 750, 1000 check-ins
- Every 250 days after 1000
Run all tests:
npm testRun tests with UI:
npm run test:uiRun with coverage:
npm run test:coverageslackline/
├── src/
│ ├── app.js # Main entry point
│ ├── database/
│ │ ├── db.js # SQLite connection
│ │ └── schema.sql # Database schema
│ ├── handlers/
│ │ ├── messageHandler.js # Process messages
│ │ └── commandHandler.js # Handle commands
│ ├── services/
│ │ ├── streakService.js # Streak calculation
│ │ ├── daysOffService.js # Days off logic
│ │ └── achievementService.js # Milestones
│ └── utils/
│ └── dateUtils.js # Date helpers
├── tests/ # Vitest test suite
├── docs/ # Documentation
├── fly.toml # Fly.io config
└── Dockerfile
- Check bot is invited to channel:
/invite @Slackline - Verify app is running:
fly status - Check logs:
fly logs - Ensure event subscriptions are verified in Slack app settings
- Verify slash command URL is correct in Slack app settings
- Check signing secret is correct
- Review logs for errors
- Slack provides user timezone from profile automatically
- Users should ensure timezone is set in their Slack profile
- Check logs to see detected timezone
Contributions welcome! Please open an issue or PR.
MIT