Architecture
How the binary, the admin panel, the API and the storage layers fit together, and why publishing never needs a rebuild.
One binary, three surfaces
hydro serve starts a single HTTP server that exposes three things:
/api/v1the REST API your frontends call. JSON only, every response uses the same envelope./adminthe embedded admin panel (a Svelte 5 SPA compiled into the binary)./media,/sitemap.xml,/healthz,/readyzand/metricsfor media delivery, SEO helpers and operational probes.
Modules and shared core
Content and commerce features live in modules under modules/ (pages, news, members, site, seo, commerce). Cross-cutting capabilities live in internal/ (auth, database, media, search, security, jobs, webhooks, caching). Which modules run is configured with the modules list in config.yaml; an inactive module adds no routes, migrations, workers or admin navigation entries.
| Layer | Responsibility |
|---|---|
Transport (transport/http.go) | Decode requests, call a service, write the JSON envelope. No SQL, no HTML. |
| Service | Business rules: validation, publishing, revisions, permissions. |
Repository (repository/sqlstore) | All SQL and dialect differences for SQLite, PostgreSQL and MySQL. |
| Content types (YAML) | Declarative collections: storage, validation, admin screens and public API are derived from the schema. |
Commerce module (modules/commerce) | Cart, stock reservation, checkout and orders, with provider interfaces for payment gateways, shipping and invoicing. |
Core and optional extensions
HydroGo is licensed under the PolyForm Shield License 1.0.0. It is a core plus optional add-ons.
- HydroGo Core: The standalone, PolyForm Shield licensed engine containing the complete CMS, embedded Svelte 5 admin studio, YAML content engine, and commerce core.
- Add-on modules: Optional commercial extensions (payment gateways, shipping carriers, e-invoicing) distributed separately and applied at build time. Core works without them.
- Hydro Cloud (coming soon): Managed multi-tenant hosting. It is not available yet.
Zero build on publish
The public API reads straight from the database. When an editor publishes, retracts or edits a page, a news article or a content record, the next request already returns the new state. This is a hard rule of the project: content changes never require a frontend rebuild, a static pre-rendering pipeline or a CI/CD redeploy.
For frontends this means server-side rendering (or client-side fetching) against the API, optionally behind a short cache you control. If you do choose a static frontend, use webhooks to trigger a rebuild; that is your choice, not a requirement of HydroGo.
Databases and optional services
| Component | Default | Alternatives |
|---|---|---|
| Database | SQLite file (data/hydro.db) | PostgreSQL, MySQL / MariaDB |
| Media storage | Local directory (data/media) | S3-compatible bucket, optional CDN base URL |
| Rate limits and caches | In process | Redis or Valkey, shared by several instances |
| Errors | Logs | Sentry / GlitchTip via observability.sentry_dsn |
docs/decisions/ folder: CMS focus, content types, the Svelte admin SPA and the template distribution model.