# Local development How to build, run, and test this project from a checkout, and how to fix the local runtime problems that come up while doing it. Read this if you are changing the relay rather than using it. ## Running from a checkout ```bash git clone https://github.com/0cv/herdr-mobile-relay.git cd herdr-mobile-relay make dev-tunnel ``` `make dev-tunnel` builds the current Go source and frontend, uses isolated ports and state under `relay/.dev/`, and opens a temporary tunnel. It never uses the installed production relay. ## Common targets ```bash make check # all backend, frontend, browser, and release checks make backend-check # format, vet, tests, race detector, shell checks make web-release # replace committed web/ with a verified frontend build make web-release-check # compare and browser-test the shipped web/ bundle make relay-plugin # link this checkout as a Herdr plugin make stable-setup # run the stable tunnel wizard with the installed relay ``` ## Testing a release candidate Candidates are published as prereleases, which ordinary relays never install: their update check resolves the latest stable release only. To run one: ```bash herdr plugin install 0cv/herdr-mobile-relay --ref dev ``` Rerun that command to move to a newer candidate. ## Contributing Work lands on `dev`; open pull requests against it and make sure `make check` passes first. ## Toolchains Backend development uses Go 1.27.0; frontend development uses Bun 1.4 (`bun install --cwd frontend`, then the `make` targets above). Playwright runs on Bun. CI installs both browsers natively (`bun x playwright install --with-deps chromium webkit`); on Fedora, `install-deps` is unsupported and native WebKit crashes, so `make frontend-browser` runs WebKit through Playwright's official container via podman (Chromium runs natively — its dnf dependencies are nspr nss dbus-libs atk at-spi2-atk cups-libs at-spi2-core libXcomposite libXdamage libXext libXfixes libXrandr mesa-libgbm cairo pango alsa-lib, per passportxyz/passport's fedora-install-playwright-deps.sh). Publishing the hosted web app (`make web-deploy`, `make web-preview`) shells out to `npx wrangler` and still needs Node.js 26 on that computer only. Packaged users need no toolchain at all. The test-only `cmd/fake-herdr` binary provides deterministic Herdr CLI behavior, failure injection, and process-control traces for black-box tests. ## Troubleshooting local runs - **Port is busy:** `make dev-tunnel` uses 18375, Quick Start and the installed service use 8375; stop whatever already holds the one you need. - **Herdr is not running:** start it with `herdr`, then retry the operation. - **Agents are unavailable:** inspect `/healthz`; after a Herdr protocol update, run `herdr server live-handoff` and wait for the next relay poll.