Skip to content
Author with AI

Development Workflow

If you’re developing the Runbooks tool itself (working on the Go backend or React frontend), you’ll want to run two separate processes in different terminals:

Terminal 1 - Backend Server:

Terminal window
go run main.go serve testdata/sample-runbooks/demo1/runbook.mdx

This starts the Go backend API server on the default port (7825). Use --port to pick a different port.

Terminal 2 - Frontend Dev Server:

Terminal window
cd web
bun dev

This starts the Vite dev server on port 5173 with hot-reloading.

Frontend Changes (React/TypeScript):

  • Edit files in /web/src
  • Vite automatically hot-reloads the browser
  • No restart needed

Backend Changes (Go):

  • Edit files in /api, /cmd, etc.
  • Restart the serve command (Ctrl+C and run again)
  • Refresh the browser

Runbook Changes:

  • Edit the runbook file you’re testing with
  • Refresh the browser
  • No restart needed

Test different runbook features:

Terminal window
# Test with different demo runbooks
go run main.go serve testdata/sample-runbooks/demo1/runbook.mdx
go run main.go serve testdata/sample-runbooks/demo2/runbook.mdx
go run main.go serve testdata/sample-runbooks/lambda/runbook.mdx

Build the frontend assets:

Terminal window
cd web
bun run build

This creates optimized files in /web/dist that are served by the Go backend in production.

Build the Go binary:

Terminal window
go build -o runbooks main.go

Run Go tests:

Terminal window
go test ./...

Run frontend tests:

Terminal window
cd web
bun test

This project uses shadcn/ui for UI components.

To add a new component:

Terminal window
cd web
bunx shadcn@latest add <component-name>

For example:

Terminal window
bunx shadcn@latest add dialog
bunx shadcn@latest add dropdown-menu

Components are added to /web/src/components/ui/.