Skip to content
You are reading the v0.20 documentation. Go to the latest version (v1.0)

Getting started

Starters

Pick a stack for vukem new — HTMX, HTMX with templ, Inertia with React, Vue or Svelte, or a JSON API — all on Vite and Tailwind CSS v4.

Last updated:

vukem new renders one of five starters. On a terminal without a stack flag it asks which one you want; in scripts pass the flag.

Terminal
vukem new blog                       # HTMX + html/template (default)
vukem new blog --templ               # HTMX + templ components
vukem new blog --inertia react       # Inertia + React (also: vue, svelte)
vukem new shop --api                 # JSON-only REST API
vukem new blog --no-install          # skip npm install
StarterViewsFrontendNode.js
HTMX (default)html/template in resources/viewshtmx 4 (vendored), Vite 8, Tailwind CSS v4for Vite builds
HTMX + templtempl components in resources/views (package views)same as HTMXfor Vite builds
InertiaReact, Vue or Svelte pages in resources/js/pagesVite 8, TypeScript, Tailwind CSS v4required
APInonenonenot used

Every starter ships SQLite, migrations, a posts CRUD example and tests that pass with go test ./.... vukem new runs go mod tidy, writes APP_KEY, runs npm install when npm is on PATH (frontend starters) and git init.

HTMX on Vite#

The default starter vendors htmx 4.0.0 (served by the static middleware, SHA-256 pinned), and builds CSS and scripts with Vite 8 and Tailwind CSS v4 (@tailwindcss/vite):

Text
package.json, vite.config.ts
resources/css/app.css       @import "tailwindcss" + starter styles in @layer base
resources/js/app.ts
resources/vite/vukem.js     hot-file plugin (writes public/hot while the dev server runs)
resources/public/build/     vite build output, embedded in the binary

The layout loads assets with {{ vite "resources/css/app.css" "resources/js/app.ts" }} (Vite). Without a dev server or a build, the tag renders an HTML comment in development, so Go tests never need Node. Starter views have no inline scripts or handlers and run under the default CSP. See HTMX for the request and response helpers.

templ#

vukem new app --templ is the HTMX starter with the same pages and tests written as templ components:

  • templ is pinned as a Go tool (tool line in go.mod); run it with go tool templ generate.
  • The generated *_templ.go files are committed, so go build and go test work without running templ.
  • vukem serve runs go tool templ generate before every build when .templ files exist and watches them; vukem build generates before vite build.
  • resources/views/helpers.go wraps the context helpers (route, asset, viteTags, script, flash, old, fieldError, csrfField). Scripts go through helpers that add the CSP nonce, so components contain no raw <script> tags.
Go
return c.View(views.PostsIndex(posts), web.Partial(views.PostList(posts)))

web.Partial renders the fragment for htmx partial requests and the page otherwise. Components read request data through web.FlashFrom(ctx, key), web.OldInput(ctx, field), web.ErrorsFrom(ctx), csrf.Token(ctx) and middleware.CSPNonce(ctx).

Inertia (React, Vue, Svelte)#

Terminal
vukem new app --inertia react         # or vue, svelte
vukem install:inertia --force --vue   # convert an existing HTMX starter

The app gets vukem.WithInertia(inertia.Config{}), controllers that call inertia.Render, the root view resources/views/app.html, TypeScript pages in resources/js/pages, a default layout in resources/js/layouts and tests with AssertInertia. npm run typecheck runs tsc (React), vue-tsc or svelte-check. vukem install:auth on an Inertia app adds Auth/* and Dashboard pages. See Inertia.

API#

vukem new shop --api is a JSON-only app: /api/v1 routes, token guard, CORS, rate limiting and problem+json errors, no views or Node. See REST APIs.

Add-ons#

These scaffolds work on top of any web starter:

CommandAdds
vukem install:auth [--social …] [--2fa]Authentication, social login, two-factor
vukem install:adminAdmin panel at /admin
vukem install:billingStripe subscriptions
vukem install:apiToken-authenticated /api/v1 routes
vukem boost:installGuidelines, skills and an MCP server for AI coding agents