Documentation
¶
Overview ¶
Command frontend-guide is the runnable companion to docs/FRONTEND_SPEC_LLM.md (`appximo frontend-spec`): ONE binary serving a frontend + the generated API + one custom byte-serving route, exercising every pattern the spec teaches —
- Config.Static: a no-build vanilla SPA (web/) embedded and served at "/"
- auth: signup/login from the SPA (enable signup with APPXIMO_AUTH_SIGNUP_ROLE=editor), the 401-bounce, expiry
- generated CRUD: posts list/create with the multi-field 422 mapped to inputs and the screen states (loading/empty/error+retry)
- files: upload with XHR progress → attach via the `photo` file field → display through a short-lived signed URL (authenticated) and through the PUBLIC route below (anonymous)
- Ctx.ServeFile: /api/public-photo — the storefront-image pattern: a Public + ByteServing route that authorizes by relationship ("the photo of a PUBLISHED post") and streams with Range/ETag/sendfile
The SPA is deliberately plain JS with no build step so this example runs from a bare clone (`go run ./examples/frontend-guide`) — a real product would use SvelteKit + adapter-static exactly as the spec §2 recommends; the contract exercised here is identical.
Run it:
DATABASE_URL=… JWT_SECRET=… ADMIN_KEY=… APPXIMO_AUTH_SIGNUP_ROLE=editor \ go run ./examples/frontend-guide --schema examples/frontend-guide/schema.json
then register a tenant on the control plane and open http://<tenant>.localhost:8080/.
Click to show internal directories.
Click to hide internal directories.