A simplified incident management Slack bot — Rails + PostgreSQL web UI + Slack integration.
- Ruby 3+ (tested on 4.0.5)
- Docker (for PostgreSQL)
- Bundler
- ngrok account (free tier)
- Slack workspace (free tier) with a custom app created
docker run -d --name rootly-db \
-e POSTGRES_PASSWORD=rootly_dev \
-e POSTGRES_DB=rootly_development \
-p 5432:5432 \
postgres:16-alpineCopy your Slack app credentials into .env (this file is gitignored):
SLACK_CLIENT_ID=
SLACK_CLIENT_SECRET=
SLACK_SIGNING_SECRET=
SLACK_BOT_TOKEN=
Get these from api.slack.com/apps → your app → Basic Information (Client ID, Client Secret, Signing Secret) and OAuth & Permissions (Bot User OAuth Token after install).
bundle install
bin/rails db:create db:migrate
bin/rails db:seed # loads 5 mock incidentsOpen two terminals:
Terminal 1 — Rails server:
bin/rails serverTerminal 2 — ngrok tunnel:
ngrok http 3000 --config=.ngrokNgrok provides a public URL (e.g. https://abide-purist-nebulizer.ngrok-free.dev). Use this URL to configure Slack app endpoints:
- Slash Commands → Request URL:
https://<your-ngrok>.ngrok-free.dev/api/slack/command - Interactivity → Request URL:
https://<your-ngrok>.ngrok-free.dev/api/slack/action - Event Subscriptions → Request URL:
https://<your-ngrok>.ngrok-free.dev/api/slack/event
Note: Free ngrok assigns a new URL each restart. If the URL changes, update the three endpoints above in your Slack app settings. Use
bin/ngrok-urlto print the current URL.
Then open http://localhost:3000 for the web UI.
bin/rails testMock incidents are serialized in db/data/seed_incidents.json and loaded via db/seeds.rb.
The Slack app is defined in config/slack_app_manifest.yml. After creating the app from this manifest at api.slack.com/apps, update the three Request URLs with your ngrok URL.