example

command module
v0.0.0-...-a245447 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

The example

The one app that uses all of charter, and what go tool charter create copies. Deployed at https://charter-example.ubuntusoftware.net. charter's docs: https://charter.gedw99.workers.dev/docs/.

npm install at the repo's top, then here:

go tool charter dev                              # leave it running → http://localhost:5173
go tool charter check && go tool charter test    # before a push
go tool charter deploy                           # then: go tool charter test --deployed
Folder What is in it
pages/ The page tree (structpages): the home page with its live list, the pages of how it's built (Built), and the routes they call
api/ The notes API's contract and handlers; api.Notes is the one feed behind the page's list and the API's stream; api.Auth, api.Roles and api.MayRemove are who may do what, for the pages and the API alike
db/ schema.sql, the tables as they are now, and queries.sql; charter writes migrations/ and queries.gen.go from them
fnox.toml The deployed Worker's secrets: their names and the provider that keeps each, never a value (go tool charter run secrets)
seed.go, api/fixtures.go What the local database starts with, and what the tests know is there: three people, one of each role, with a token each (ch_seed_ada, ch_seed_grace, ch_seed_lin), and their notes. The deployed example is filled by the same seed (go tool charter run db:seed --deployed charter-example), without the tokens
built/ What the app does with what Cloudflare gives a Worker, one job each, through workers-go's own packages: a file attached to a note (R2), what happened (Queues, a Cron Trigger, D1, followed live through a Durable Object), a notice for everyone (KV), mail, a rate limit and the cache, a request to another site
locales/ English, German, Arabic
docs/ The app's own docs, as Markdown
pages/screens/ charter's screens (charter add screen:<name>): the docs' pages, the language list and offer, the theme switch
test/ page_*_test.go: the pages in a real browser (a note typed in one tab shows in another; Arabic is right to left; a card per Cloudflare binding). api_test.go: the API through sdk/go. test/devloop works on the app under charter dev
sdk/go/ The Go client, generated from the contract

Generated, never edited. Built each time and not in git: *.x.go, *.built.go, .charter/. Committed and checked: db/migrations/, db/queries.gen.go, fern/ and sdk/go/ (written by check --fix and pack -publish). ui/ and web/gsxui/ are gsxui's components, vendored by charter add ui:<name>.

Documentation

Overview

The example: one app that uses all of charter. Pages (structpages, gsx, gsxui, htmx 4) in three languages, an API from a contract with auth, limits, streams, MCP and SDKs, one live feed behind both, and a card for everything Cloudflare gives a Worker.

go tool charter dev       work on it: a save rebuilds and reloads → http://localhost:5173
go tool charter check && go tool charter test
go tool charter deploy    then: go tool charter test --deployed

Directories

Path Synopsis
Package api is the notes API, contract first, in Go.
Package api is the notes API, contract first, in Go.
Package built is what the app does with what Cloudflare gives a Worker: each thing does one job in the notes app, and has a page of its own that shows it (pages: the group Built).
Package built is what the app does with what Cloudflare gives a Worker: each thing does one job in the notes app, and has a page of its own that shows it (pages: the group Built).
Package docs is the app's docs: each Markdown file of this folder as a page.
Package docs is the app's docs: each Markdown file of this folder as a page.
Package locales is the app's messages: the catalogs of this folder (<language>.toml).
Package locales is the app's messages: the catalogs of this folder (<language>.toml).
Package pages is the site's pages, as a tree structpages reads: every route is a field of Pages, with its route in the field's tag.
Package pages is the site's pages, as a tree structpages reads: every route is a field of Pages, with its route in the field's tag.
sdk
go module
ui
i18n
Package i18n holds the one type every gsxui component writes its own English strings through.
Package i18n holds the one type every gsxui component writes its own English strings through.
icon
Package icon is the Lucide icon set as tag-callable gsx components: <icon.ChevronDown class="size-4"/>.
Package icon is the Lucide icon set as tag-callable gsx components: <icon.ChevronDown class="size-4"/>.
merge
Package merge holds the Tailwind-aware class merger named by gsx.toml's class_merger.
Package merge holds the Tailwind-aware class merger named by gsx.toml's class_merger.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL