Skip to content

Development

  • Go 1.26 or newer (pure Go, no CGO or C compiler needed)
  • Node.js 22+ for the browser crypto, notification and search unit tests
  • Chrome or Chromium (optional) for the headless two-browser smoke test
Terminal window
git clone https://github.com/hytte-chat/hytte
cd hytte
go run .

To build a release-style binary with an explicit version:

Terminal window
go build -ldflags "-X main.version=v0.1.0" -o hytte .
Path What’s in it
main.go CLI flags, validation, one-shot admin commands (-u, --make-admin, --reset-mfa)
internal/server/ HTTP handlers, auth, MFA, admin panel API, media proxy, embedded static assets
internal/server/static/ Vanilla JS/CSS frontend (e2e.js, keystore.js, app.js, sw.js, search.js), HTML templates, fonts and icons
internal/ws/ WebSocket hub, realtime broadcast, presence, typing, Giphy
internal/chat/ Conversation and message orchestration
internal/db/ SQLite schema, migrations and queries (modernc.org/sqlite)
internal/push/ Stdlib-only Web Push (VAPID, RFC 8291)
internal/unfurl/ SSRF-safe link preview fetcher, OpenGraph parser and embed fixer list
internal/certs/ Self-signed TLS certificates and Let’s Encrypt (lego)
internal/tunnel/ Cloudflare (cloudflared) and localhost.run tunnels
internal/smoke/ Two-browser end-to-end smoke test (chromedp)

There is no frontend build step or bundler: the files in internal/server/static/ are embedded straight into the Go binary with //go:embed.

Terminal window
# Formatting and static checks
gofmt -l .
go vet ./...
go vet -tags browser ./internal/smoke/
# Go unit and integration tests (with race detector)
go test -race -count=1 ./...
# JavaScript tests (E2E crypto, media, MFA, notifications, search)
node --test internal/server/jstest/*.test.mjs
# Two-browser smoke test (needs Chrome/Chromium)
go test -tags browser -count=1 -v ./internal/smoke/

These docs live in hytte-chat/hytte-docs and are built with Astro Starlight.

Terminal window
git clone https://github.com/hytte-chat/hytte-docs
cd hytte-docs
npm install
npm run dev

Screenshots are regenerated from a fresh local hytte binary with:

Terminal window
HYTTE=../hytte/hytte npm run screenshots