Thanks for your interest in contributing! This guide covers local development setup for working on the Go server and templates.
If you just want to run Hooks, see the README -- it's a single docker compose up --build.
- Fork and clone the repository:
git clone https://github.com/<your-username>/hooks.git
cd hooks- Download the Tailwind CSS standalone CLI and start the database:
make setup
docker compose up db -d- Run the server:
make devThis builds CSS, starts a Tailwind file watcher in the background, and runs the Go server. The watcher rebuilds CSS automatically when you change templates.
- Open http://localhost:8080.
You don't have to use the Docker Postgres. Copy the example env file and configure it:
cp .env.example .envThen edit .env with your connection details:
# Option 1: Full connection string
DATABASE_URL=postgres://user:pass@localhost:5432/hooks?sslmode=disable
# Option 2: Individual variables
DB_HOST=localhost
DB_USER=myuser
DB_PASSWORD=mypass
DB_NAME=hooks
DB_SSLMODE=disableThe Makefile loads .env automatically. The server runs migrations on startup, so you just need an empty database.
make testTests run against unit-testable code and do not require a running database.
Migrations live in internal/db/migrations/ and use Goose. They run automatically every time the server starts.
To check migration status or roll back manually:
make migrate-status
make migrate-downTo reset the database entirely (e.g. after changing an existing migration during development):
docker compose down -v
docker compose up db -dThen restart the server and migrations will re-run from scratch.
hooks/
├── cmd/server/ # Entry point, router, embedded static assets
├── internal/
│ ├── handler/ # HTTP handlers and HTML templates (inline in Go files)
│ ├── db/ # Postgres queries and migrations
│ ├── cleanup/ # Background expiry job
│ └── middleware/ # Rate limiting, CORS
├── input.css # Tailwind v4 source
├── docker-compose.yml
├── Dockerfile
└── Makefile
| Command | Description |
|---|---|
make setup |
Download the Tailwind CSS standalone CLI for your platform |
make dev |
Build CSS, start Tailwind watcher, run the Go server |
make build |
Compile binary to bin/hooks |
make test |
Run all tests |
make css |
One-off Tailwind CSS build (no minification) |
make css-watch |
Tailwind CSS watch mode (no minification) |
make update-htmx |
Download latest vendored HTMX |
- Create a branch from
main:
git checkout -b my-change-
Make your changes and add tests where applicable.
-
Run the full check:
make test
go build ./...-
Commit with a clear message describing what and why.
-
Open a pull request against
main.
- Follow standard Go conventions (
gofmt). - HTML templates are inline in handler Go files -- no separate template files.
- Tailwind CSS v4 compiled via the standalone CLI. The Docker build handles minification for production.
- Bug fixes
- Performance improvements
- New response presets or inspector features
- Documentation improvements
- Test coverage
If you're planning a large change, open an issue first to discuss the approach.
By contributing, you agree that your contributions will be licensed under the MIT License.