IncidentResponse is a local, incident response system for production outages. It receives alert webhooks, creates and deduplicates incidents, matches a runbook, estimates customer impact, posts a Slack brief, tracks the response timeline, and generates an AI-assisted postmortem draft after the incident is resolved.
The project is intentionally backend-first: the dashboard is lightweight, while the main value is in the incident workflow, persistence model, worker separation, and operational automation.
- Receives mock monitoring alerts through
POST /v1/alerts - Normalizes alert payloads into a consistent internal format
- Creates or updates incidents in PostgreSQL using a dedupe key
- Matches incidents to runbooks
- Estimates impact from mock metrics
- Posts concise Slack incident briefs
- Records incident timeline events
- Lets responders mark incidents resolved
- Creates pending postmortem requests after resolution
- Runs a Python AI worker to generate postmortem drafts
- Shows incidents, timelines, and postmortems in a plain HTML/CSS dashboard
Start the backend:
make compose-build
make compose-up
make compose-migrateStart the dashboard:
python3 -m http.server 5173 --directory webOpen:
http://localhost:5173
Then demo the workflow:
- Click
Send Mock Alert - View the created incident, impact estimate, runbook event, and Slack event
- Click
Resolveafter treating the issue as fixed - Run the AI worker:
make compose-worker- Refresh the dashboard and view the generated postmortem
If port 8080 is busy, start the API on another host port:
API_PORT=8081 docker compose up -d postgres apiThen open:
http://localhost:5173?api=http://localhost:8081
Create a local .env:
cp .env.example .envSet these if you want Slack and AI generation:
SLACK_ENABLED=true
SLACK_WEBHOOK_URL=your_slack_incoming_webhook_url
OPENAI_API_KEY=your_openai_api_key
OPENAI_MODEL=gpt-5-mini
Keep .env private. It is ignored by git.
flowchart TD
A[Mock Monitoring Alert] -->|Webhook| B[Go API]
B --> C[Alert Normalizer]
C --> D[Incident Service]
D --> E[(PostgreSQL)]
D --> F[Runbook Matcher]
D --> G[Impact Estimator]
D --> H[Timeline Events]
D --> I[Slack Notifier]
J[Dashboard] -->|Read / Resolve| B
K[Python AI Worker] -->|Reads pending postmortems| E
K -->|Stores generated draft| E
More detail: docs/architecture.md
- Go with
net/httpfor the API - PostgreSQL for persistence
- Python for the AI postmortem worker
- Slack incoming webhooks for incident updates
- Plain HTML/CSS/JavaScript dashboard
- Docker Compose for local development
GET /healthz
GET /readyz
POST /v1/alerts
GET /v1/incidents
GET /v1/incidents/{id}
GET /v1/incidents/{id}/timeline
GET /v1/incidents/{id}/postmortem
PATCH /v1/incidents/{id}/resolve
make compose-build # build API and worker images
make compose-up # start Postgres and the Go API
make compose-migrate # apply SQL migrations
make compose-worker # run the AI postmortem worker once
make run-api # run the Go API locally without Docker
make test # run Go tests
make db-shell # open psql inside the Postgres container
make compose-down # stop local servicesTo reset local demo data:
docker compose down -v
make compose-up
make compose-migrate- Backend service design around a realistic incident lifecycle
- Alert normalization, persistence, and deduplication
- Operational enrichment through runbooks and impact estimates
- Async AI workflow separated from the main API
- Slack integration for responder communication
- Dockerized local development across API, database, migrations, and worker
- Simple dashboard consuming real backend APIs
cmd/api/ Go API entrypoint
internal/api/ HTTP routes, handlers, CORS
internal/alerts/ Alert payload types, normalization, storage
internal/incidents/ Incident creation, deduplication, lifecycle logic
internal/runbooks/ Runbook persistence and matching
internal/impact/ Mock metric loading and impact estimation
internal/postmortems/ Postmortem persistence
internal/slack/ Slack webhook client and message formatting
internal/db/ PostgreSQL connection and migrations
ai-worker/ Python OpenAI postmortem worker
web/ Plain HTML/CSS/JS dashboard
runbooks/ Human-readable incident runbooks
mock-data/metrics/ Mock service metrics used for impact estimates

