ReferenceCode map & folder structure
Code map & folder structure
Where everything lives in the repository and how layers import each other. Generated by go run ./tools/codegraph and enforced in CI.
HydroGo enforces strict architectural boundaries between the binary entrypoint, shared internal capabilities, and domain modules. You can explore the full interactive dependency graph in codegraph.html.
Repository layout
| Directory | Purpose |
|---|---|
cmd/hydro/ | CLI commands (serve, new, init, doctor, mcp, migrate, backup, audit) and server wiring. |
admin/ | Embedded Svelte 5 + TypeScript + Tailwind admin SPA (compiled into internal/adminui/dist). |
internal/ | Cross-cutting core engine: database dialects, collections, cache, security, MCP, media, auth, outbox, audit. |
modules/ | Feature modules: pages, news, members, site, seo, commerce. |
extension/ | Public Go extension SDK (extension/v1). |
content-types/ | Stock declarative YAML content-type definitions used by presets. |
migrations/ | Dialect-complete SQL migrations (SQLite, PostgreSQL, MySQL). |
packages/client/ | Typed @hydrohq/client TypeScript API client. |
tools/ | Developer harness and CI guards (check, codegraph, codeguard, moduleguard, bench). |
Layer dependency map
| Layer | Packages | Purpose |
|---|---|---|
cmd | 1 | Binary entry points: CLI commands, server composition, HTTP routes and admin APIs. |
extension | 2 | Public extension SDK. |
internal | 87 | Cross-cutting capabilities: auth, database, outbox, jobs, mailer, audit, config and more. |
modules | 17 | Feature modules: pages, news, members, site, seo, commerce. |
tests | 3 | Contract and end-to-end tests. |
tools | 13 | Repository guards and developer tooling. |
Open [codegraph.html](/codegraph.html) for the interactive package dependency graph generated by `go run ./tools/codegraph`.
Interactive Graph