Architecture
Cloudzilla is a Go application that serves Git over HTTP and SSH with a server-rendered web UI. There is no client-side JavaScript framework — pages are composed from type-safe Templ components and updated in place with HTMX.
Layered design
Every request flows through three strictly separated layers, and a layer only ever calls the one directly below it:
Stores— raw SQL against PostgreSQL viasqlx. No business logic.Services— business logic and orchestration. Stores are the only thing a service touches.Handlers— HTTP entry points. They call services, then render a Templ page or fragment.
Handlers never reach into a store directly, and stores never import a service. Keeping the arrows pointing one way is what makes each layer testable on its own.
Rendering
Templ compiles HTML components to Go, so templates are checked at build time. Full pages wrap layout.Base; HTMX fragments are rendered standalone and swapped into the DOM by their hx-target.
# Regenerate Go from .templ sources
~/go/bin/templ generate
Git transport
Both the HTTP smart protocol and the SSH server are pure Go — no git binary is required on the host. SSH authentication is public-key only, matched against keys stored per user.