Skip to content

Repository files navigation

Rootly

A simplified incident management Slack bot — Rails + PostgreSQL web UI + Slack integration.

Prerequisites

  • Ruby 3+ (tested on 4.0.5)
  • Docker (for PostgreSQL)
  • Bundler
  • ngrok account (free tier)
  • Slack workspace (free tier) with a custom app created

Setup

1. PostgreSQL

docker run -d --name rootly-db \
  -e POSTGRES_PASSWORD=rootly_dev \
  -e POSTGRES_DB=rootly_development \
  -p 5432:5432 \
  postgres:16-alpine

2. Environment variables

Copy 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).

3. Rails dependencies

bundle install
bin/rails db:create db:migrate
bin/rails db:seed   # loads 5 mock incidents

Run (development)

Open two terminals:

Terminal 1 — Rails server:

bin/rails server

Terminal 2 — ngrok tunnel:

ngrok http 3000 --config=.ngrok

Ngrok 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-url to print the current URL.

Then open http://localhost:3000 for the web UI.

Tests

bin/rails test

Seed Data

Mock incidents are serialized in db/data/seed_incidents.json and loaded via db/seeds.rb.

Slack App Manifest

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.