Directories
¶
| Path | Synopsis |
|---|---|
|
Package accounts signs users up and in, with passwords or passkeys, and keeps their accounts: email verification, password resets, and the devices they're signed in on, any of which they can sign out.
|
Package accounts signs users up and in, with passwords or passkeys, and keeps their accounts: email verification, password resets, and the devices they're signed in on, any of which they can sign out. |
|
cmd
|
|
|
tern
command
Command tern is the command-line interface for the Tern framework.
|
Command tern is the command-line interface for the Tern framework. |
|
tern/templates/api/internal/store
Package store keeps todos in memory.
|
Package store keeps todos in memory. |
|
tern/templates/blog/internal/blog
Package blog reads the posts in src/content/posts.
|
Package blog reads the posts in src/content/posts. |
|
tern/templates/saas/internal/app
Package app holds what the routes share: the database, user accounts, email and background jobs.
|
Package app holds what the routes share: the database, user accounts, email and background jobs. |
|
tern/templates/saas/migrations
Package migrations holds the app's database migrations, applied in order when the app starts (see the migrate package).
|
Package migrations holds the app's database migrations, applied in order when the app starts (see the migrate package). |
|
Package content loads Markdown collections from an app's src/content directory, with typed YAML front matter:
|
Package content loads Markdown collections from an app's src/content directory, with typed YAML front matter: |
|
Package docs embeds Tern's documentation, so tools such as tern mcp can serve the docs for the version in use.
|
Package docs embeds Tern's documentation, so tools such as tern mcp can serve the docs for the version in use. |
|
Package goscript is the Go side of Tern's <script lang="go">: component logic written in Go with Svelte-style runes, while the markup stays Svelte.
|
Package goscript is the Go side of Tern's <script lang="go">: component logic written in Go with Svelte-style runes, while the markup stays Svelte. |
|
livetest
Package livetest runs live components in Go tests, without a browser:
|
Package livetest runs live components in Go tests, without a browser: |
|
internal
|
|
|
codegen
Package codegen generates the code that connects a Tern app's routes to the runtime: tern.gen.go for the Go server, the client route manifest for Vite, and TypeScript types for every route.
|
Package codegen generates the code that connects a Tern app's routes to the runtime: tern.gen.go for the Go server, the client route manifest for Vite, and TypeScript types for every route. |
|
dbtest
Package dbtest opens the databases that Tern's database packages are tested against: a fresh SQLite file always, and PostgreSQL when TERN_TEST_POSTGRES holds a connection string (CI sets it).
|
Package dbtest opens the databases that Tern's database packages are tested against: a fresh SQLite file always, and PostgreSQL when TERN_TEST_POSTGRES holds a connection string (CI sets it). |
|
formrules
Package formrules parses validation tags and checks submitted form values against them.
|
Package formrules parses validation tags and checks submitted form values against them. |
|
htmltext
Package htmltext turns HTML into readable plain text, for the text part of emails.
|
Package htmltext turns HTML into readable plain text, for the text part of emails. |
|
i18n
Package i18n formats translated messages.
|
Package i18n formats translated messages. |
|
jsondiff
Package jsondiff computes small patches between two JSON values, so live components send what changed in a list instead of the whole list.
|
Package jsondiff computes small patches between two JSON values, so live components send what changed in a list instead of the whole list. |
|
jsonenc
Package jsonenc encodes values as encoding/json does, byte for byte, except that a nil slice is written as [] instead of null: Tern sends [] for pages, typed endpoints and live components, so their TypeScript types are T[] rather than T[] | null.
|
Package jsonenc encodes values as encoding/json does, byte for byte, except that a nil slice is written as [] instead of null: Tern sends [] for pages, typed endpoints and live components, so their TypeScript types are T[] rather than T[] | null. |
|
jsvalue
Package jsvalue makes native rendering's JavaScript values straight from Go values: what JSON.parse would make of the JSON internal/jsonenc writes for them, value for value and in the same key order, without writing or parsing the JSON.
|
Package jsvalue makes native rendering's JavaScript values straight from Go values: what JSON.parse would make of the JSON internal/jsonenc writes for them, value for value and in the same key order, without writing or parsing the JSON. |
|
markdown
Package markdown renders Markdown with YAML front matter.
|
Package markdown renders Markdown with YAML front matter. |
|
mcp
Package mcp is a small Model Context Protocol server over stdio: tools and resources, as JSON-RPC 2.0 messages, one per line.
|
Package mcp is a small Model Context Protocol server over stdio: tools and resources, as JSON-RPC 2.0 messages, one per line. |
|
native
Package native compiles the modules of an app's server build to Go, so pages render without the JavaScript engine (ADR 0011).
|
Package native compiles the modules of an app's server build to Go, so pages render without the JavaScript engine (ADR 0011). |
|
nilslices
Package nilslices makes nil slices empty before encoding/json sees them.
|
Package nilslices makes nil slices empty before encoding/json sees them. |
|
routes
Package routes discovers Tern routes on the filesystem and matches URLs against them.
|
Package routes discovers Tern routes on the filesystem and matches URLs against them. |
|
seal
Package seal encrypts and authenticates small values, such as cookie contents, with AES-256-GCM.
|
Package seal encrypts and authenticates small values, such as cookie contents, with AES-256-GCM. |
|
ssr
Package ssr renders Svelte pages on the server by running the app's server bundle in embedded QuickJS VMs.
|
Package ssr renders Svelte pages on the server by running the app's server bundle in embedded QuickJS VMs. |
|
ui
Package ui formats the Tern CLI's terminal output: colors, symbols, spinners and tables.
|
Package ui formats the Tern CLI's terminal output: colors, symbols, spinners and tables. |
|
version
Package version reports the version of the Tern build.
|
Package version reports the version of the Tern build. |
|
Package jobs runs background work: durable jobs with retries, stored in SQLite or PostgreSQL, and recurring schedules.
|
Package jobs runs background work: durable jobs with retries, stored in SQLite or PostgreSQL, and recurring schedules. |
|
Package kit is the server runtime for Tern applications.
|
Package kit is the server runtime for Tern applications. |
|
Package mail sends email, written as Svelte components in src/emails:
|
Package mail sends email, written as Svelte components in src/emails: |
|
Package migrate applies SQL migrations to SQLite or PostgreSQL.
|
Package migrate applies SQL migrations to SQLite or PostgreSQL. |
|
native
|
|
|
js
Package js is a Go model of JavaScript values with the language's exact semantics, for components that tern build compiles to Go (ADR 0011).
|
Package js is a Go model of JavaScript values with the language's exact semantics, for components that tern build compiles to Go (ADR 0011). |
|
svelte
Package svelte holds what compiled components need from Go beyond the JavaScript they were compiled from: Go versions of Svelte's hottest server helpers (intrinsics).
|
Package svelte holds what compiled components need from Go beyond the JavaScript they were compiled from: Go versions of Svelte's hottest server helpers (intrinsics). |
|
plugins
|
|
|
compress
Package compress gzips a Tern app's dynamic responses (pages, data, endpoint JSON) for clients that accept it:
|
Package compress gzips a Tern app's dynamic responses (pages, data, endpoint JSON) for clients that accept it: |
|
cors
Package cors lets other origins call a Tern app's endpoints:
|
Package cors lets other origins call a Tern app's endpoints: |
|
health
Package health adds liveness and readiness endpoints to a Tern app:
|
Package health adds liveness and readiness endpoints to a Tern app: |
|
images
Package images resizes remote images for <Image src="https://…">:
|
Package images resizes remote images for <Image src="https://…">: |
|
metrics
Package metrics exposes Prometheus metrics for a Tern app, with no dependencies:
|
Package metrics exposes Prometheus metrics for a Tern app, with no dependencies: |
|
oauth
Package oauth adds "Sign in with GitHub, Google or any OpenID Connect provider" to a Tern app:
|
Package oauth adds "Sign in with GitHub, Google or any OpenID Connect provider" to a Tern app: |
|
oidc
Package oidc makes a Tern app an OAuth 2.0 authorization server and OpenID Connect provider: other apps (or your own frontends, mobile apps and services) sign users in with it, and your APIs accept its tokens.
|
Package oidc makes a Tern app an OAuth 2.0 authorization server and OpenID Connect provider: other apps (or your own frontends, mobile apps and services) sign users in with it, and your APIs accept its tokens. |
|
ratelimit
Package ratelimit limits how often each client can call a Tern app:
|
Package ratelimit limits how often each client can call a Tern app: |
|
requestlog
Package requestlog logs every request a Tern app serves, with slog:
|
Package requestlog logs every request a Tern app serves, with slog: |
|
secure
Package secure sets security headers on every response of a Tern app:
|
Package secure sets security headers on every response of a Tern app: |
|
sessions
Package sessions stores per-user data in an encrypted cookie:
|
Package sessions stores per-user data in an encrypted cookie: |
|
Package rbac checks permissions by role:
|
Package rbac checks permissions by role: |
|
Package realtime is a publish/subscribe hub for pushing updates to browsers over server-sent events or WebSockets:
|
Package realtime is a publish/subscribe hub for pushing updates to browsers over server-sent events or WebSockets: |
|
pgbroker
Package pgbroker is a [realtime.Broker] on PostgreSQL's LISTEN and NOTIFY, so an app running several processes delivers realtime messages and live component updates to all of them without another service:
|
Package pgbroker is a [realtime.Broker] on PostgreSQL's LISTEN and NOTIFY, so an app running several processes delivers realtime messages and live component updates to all of them without another service: |
|
Package sqldb holds the small amount of SQL dialect knowledge shared by Tern's database packages (migrate and jobs).
|
Package sqldb holds the small amount of SQL dialect knowledge shared by Tern's database packages (migrate and jobs). |
|
Package storage keeps files: uploads, generated exports, anything that doesn't belong in the database.
|
Package storage keeps files: uploads, generated exports, anything that doesn't belong in the database. |
Click to show internal directories.
Click to hide internal directories.