A lightweight, production-grade Slack app for leave request management. Request time off, get approvals, track balances, and see who's out - all from within Slack.
- Request Time Off - Submit leave requests with an intuitive modal interface
- Track Balances - View your remaining leave days by type with visual indicators
- View Requests - See your pending, approved, and past requests
- Who's Out - Check who's out today or upcoming days
- Half-Day Support - Request morning or afternoon half-days
- View Company Leave Policy - Access detailed leave policies and guidelines directly in Slack
- Approve/Reject - Review and approve leave requests via DM or Home tab
- Team Overview - See pending requests from your team members
- One-Click Actions - Approve or reject with optional notes
- Bulk Management - Paginated views for handling large teams
- Team Management - Create teams and assign managers
- Leave Types - Configure leave types with custom emoji, colors, and allowances
- Balance Management - Adjust individual user balances and set allowances
- User Management - Sync workspace users, assign admins
- Workspace Settings - Configure approval requirements, notification channels
- Daily Digest - Automated morning notifications showing who's out (timezone-aware)
- Leave Policy Management - Create and customize company leave policies within Slack
- Comprehensive Dashboard - Full admin interface for managing all aspects of the system
- Node.js 20+
- A Slack workspace where you can install apps
- Go to api.slack.com/apps
- Click Create New App β From scratch
- Name it "Absentra" and select your workspace
Go to OAuth & Permissions and add these Bot Token Scopes:
chat:write- Send messagescommands- Add slash commandsusers:read- Read user infousers:read.email- Read user emailsim:write- Send DMsim:history- Read DM history
- Go to Socket Mode and enable it
- Generate an App-Level Token with
connections:writescope - Save the token (starts with
xapp-)
Go to Slash Commands and create:
- Command:
/pto - Request URL: (leave blank for Socket Mode)
- Description:
Manage your time off - Usage Hint:
[request|balance|my|who|help]
Go to App Home:
- Enable the Home Tab feature
- Subscribe to the
app_home_openedevent
Go to Interactivity & Shortcuts and turn on Interactivity (no URL needed for Socket Mode).
Go to Install App and install to your workspace. Save the Bot Token (starts with xoxb-).
# Clone and setup
git clone https://github.com/your-org/absentra.git
cd absentra
# Install dependencies
npm install
# Create environment file
cp .env.example .envEdit .env with your tokens:
SLACK_BOT_TOKEN=xoxb-your-bot-token
SLACK_SIGNING_SECRET=your-signing-secret
SLACK_APP_TOKEN=xapp-your-app-token
ADMIN_SLACK_ID=U012XPLLU3G
DATABASE_URL="file:./data/pto.db"
DEFAULT_TIMEZONE=America/New_York# Setup database
npm run db:generate
npm run db:push
# Start the app
npm run dev# Build and run with Docker Compose
docker-compose up -d
# View logs
docker-compose logs -f
# Check health
curl http://localhost:3000/healthThe container includes health checks at /health and /ready endpoints for orchestration.
| Command | Description |
|---|---|
/pto request |
Open the leave request form |
/pto balance |
Check your leave balances |
/pto my |
View your leave requests |
/pto history |
View all past requests |
/pto who |
See who's out today |
/pto who week |
See who's out this week |
/pto pending |
View requests pending approval (managers) |
/pto admin |
Admin settings (admins only) |
/pto help |
Show help message |
| Type | Emoji | Default Days | Requires Approval |
|---|---|---|---|
| PTO | ποΈ | 20 | Yes |
| Sick Leave | π€ | 10 | No |
| Work From Home | π | Unlimited | No |
| Casual | π€ | 5 | Yes |
| Unpaid Leave | π | Unlimited | Yes |
- Use the Admin Settings from the Home tab to create teams
- Assign managers who can approve requests
- Assign team members
To enable the daily digest notification:
- Create a channel for announcements (e.g.,
#whos-out) - Invite Absentra to the channel
- Configure the notification channel in Admin Settings
| Variable | Description | Required | Default |
|---|---|---|---|
SLACK_BOT_TOKEN |
Bot User OAuth Token | Yes | - |
SLACK_SIGNING_SECRET |
Signing Secret | Yes | - |
SLACK_APP_TOKEN |
App-Level Token (Socket Mode) | Yes | - |
ADMIN_SLACK_ID |
User ID of first admin | Yes | - |
DATABASE_URL |
SQLite database path | Yes | - |
PORT |
HTTP server port for health checks | No | 3000 |
DEFAULT_TIMEZONE |
Default timezone for dates (uses workspace timezone if available) | No | UTC |
NODE_ENV |
Environment (development/production) |
No | production |
# Run in development mode with hot reload
npm run dev
# Type checking
npm run typecheck
# Run tests
npm test
# Run tests with coverage
npm run test:coverage
# Build for production
npm run build
# Start production server
npm start# Generate Prisma client
npm run db:generate
# Push schema changes to database
npm run db:push
# Open Prisma Studio (database GUI)
npm run db:studio
# Run migrations (for production)
npm run db:migrate
# Seed default data
npm run db:seedWe welcome contributions! Here's how to get started:
- Search existing issues first to avoid duplicates
- Use the issue templates when available
- Include details:
- Steps to reproduce
- Expected vs actual behavior
- Environment (Node version, OS, Slack workspace type)
- Error messages and logs
- Check the roadmap and existing feature requests
- Describe the use case - what problem does it solve?
- Propose a solution if you have one in mind
- Fork the repository and create a feature branch
- Follow the code style - run
npm run lintbefore committing - Add tests for new functionality
- Update documentation if needed
- Write clear commit messages
# Development workflow
git checkout -b feature/your-feature
npm run dev # Make changes
npm test # Run tests
npm run typecheck # Check types
git commit -m "feat: your feature description"
git push origin feature/your-feature- Use TypeScript for all new code
- Follow existing patterns in the codebase
- Keep functions small and focused
- Add JSDoc comments for public APIs
- Use meaningful variable and function names
If you find Absentra useful, consider supporting its development:
Your support helps maintain and improve Absentra for everyone!
App not responding to commands
- Verify Socket Mode is enabled and the app token is correct
- Check the app is running:
docker-compose logs -f - Ensure the bot is invited to the channel
"expired_trigger_id" errors
- This happens when a modal takes too long to open (>3 seconds)
- The app handles this gracefully with user-friendly messages and in-modal notifications
Timezone issues
- Absentra automatically uses your workspace timezone
- Ensure your Slack workspace has a timezone configured
- Falls back to
DEFAULT_TIMEZONEenvironment variable if workspace timezone is unavailable
Database errors
- Run
npm run db:pushto sync the schema - Check
DATABASE_URLis set correctly - Ensure the data directory has write permissions
Health check failing
- Verify port 3000 is accessible
- Check database connectivity:
curl http://localhost:3000/ready
MIT License - see LICENSE for details.
Made with β€οΈ for teams who value work-life balance.
