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:
go run main.go serve testdata/demo-runbook-1/runbook.mdx
This starts the Go backend API server on port 7825.
Terminal 2 - Frontend Dev Server:
cd webbun dev
This starts the Vite dev server on port 5173 with hot-reloading.
Making Changes
Section titled “Making Changes”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
Testing Your Changes
Section titled “Testing Your Changes”Test different runbook features:
# Test with different demo runbooksgo run main.go serve testdata/demo-runbook-1/runbook.mdxgo run main.go serve testdata/demo-runbook-2/runbook.mdxgo run main.go serve testdata/runbook-with-boilerplate/runbook/runbook.mdx
Building for Production
Section titled “Building for Production”Build the frontend assets:
cd webbun run build
This creates optimized files in /web/dist
that are served by the Go backend in production.
Build the Go binary:
go build -o runbooks main.go
Running Tests
Section titled “Running Tests”Run Go tests:
go test ./...
Run frontend tests:
cd webbun test
Adding shadcn/ui Components
Section titled “Adding shadcn/ui Components”This project uses shadcn/ui for UI components.
To add a new component:
cd webbunx shadcn@latest add <component-name>
For example:
bunx shadcn@latest add dialogbunx shadcn@latest add dropdown-menu
Components are added to /web/src/components/ui/
.