Gothicdocs

Modules

Gothic is split into small Go modules with independent versions. Core gothic contains the compiler, runtime, views, components, routing, documents, and the HTTP server. Everything else is optional.

ModuleImport pathTag prefixDepends on
Gothicgithub.com/metruzanca/gothicvX.Y.Zchi, sqlite for tests
UI kitgithub.com/metruzanca/gothic/uiui/vX.Y.Zcore
Browsergithub.com/metruzanca/gothic/browserbrowser/vX.Y.Zstandard library
Virtualgithub.com/metruzanca/gothic/virtualvirtual/vX.Y.Zstandard library
Sessionsgithub.com/metruzanca/gothic/sessionsession/vX.Y.Zsqlite for tests
Authgithub.com/metruzanca/gothic/authauth/vX.Y.Zcore, sessions

Core

sh
go get github.com/metruzanca/gothic

The compiler, the client runtime, the server, Document, route, dom, and the gothicest test helpers. This is the only required module.

UI kit

sh
go get github.com/metruzanca/gothic/ui

Pure Button, Card, and Field components, plus stateful Counter, Tabs, Accordion, and Disclosure. The components are precompiled and expanded into the consuming app. ui.MountStyles serves the stylesheet.

Add the package to an app with:

go
//gothic:components github.com/metruzanca/gothic/ui

Browser

sh
go get github.com/metruzanca/gothic/browser

A curated, client-only surface for alerts, logging, titles, localStorage, clipboard, focus, reload, navigation, and element measurement. Calls lower to browser APIs in the generated JavaScript.

Virtual

sh
go get github.com/metruzanca/gothic/virtual

Headless window math for long lists. Use WindowFor for fixed rows and VariableWindow or WindowForRows for measured rows. The view stays in your app.

Sessions

sh
go get github.com/metruzanca/gothic/session

Server-side sessions with a signed HttpOnly cookie, memory and SQL stores, regeneration, and destruction. This module does not depend on core gothic.

Auth

sh
go get github.com/metruzanca/gothic/auth

Users, argon2id password hashes, session-backed login and logout, and user middleware. It depends on core gothic for the error envelope and on session.

Test helpers

gothicest is a package in the core module, not a separate module:

go
import "github.com/metruzanca/gothic/gothicest"

ts := gothicest.NewTestServer(t, s)

It wraps httptest.Server, keeps a cookie jar, and adds Call for procedures.

Examples

The directories under examples/ are development apps, not published modules. Some have their own go.mod so they can require the released modules and keep local replace directives. virtual/example is an example module too.

Local development

Modules that depend on core or another module use local replace directives or a go.work file while developing in this repository:

  • ui/go.work points at the checkout.
  • auth/go.mod replaces core and sessions with .. and ../session.
  • Example modules replace core, UI, browser, virtual, sessions, and auth.

Release commits remove those local paths and pin released versions. The follow-up commit restores them for development. See RELEASING.md.

Versioning

Each module has its own tag:

  • core: vX.Y.Z
  • UI: ui/vX.Y.Z
  • browser: browser/vX.Y.Z
  • virtual: virtual/vX.Y.Z
  • sessions: session/vX.Y.Z
  • auth: auth/vX.Y.Z

Tags are never moved or deleted. If a release is wrong, publish a new patch version. Release core first when core changes, then the modules that depend on it.