Clone smrt-start
Start from the template itself.
smrt-start is the public, MIT-licensed template thatsmrt cookbook apply copies by
default. Cloned on its own it is a small working application, not an empty folder.1. Clone and run it
You need Node 26 or newer, git and pnpm 11.25, the version the template's packageManager pins. app:setup builds, creates the local database and issues a one-time owner
invitation; app:open opens the page where your name and email make you the owner. pnpm app:doctor prints where the data lives and anything it finds wrong.
git clone https://github.com/happyvertical/smrt-start.git my-app
cd my-app
pnpm install
cp .env.example .env # ANTHROPIC_API_KEY, for the assistant only
pnpm app:setup
pnpm dev # http://127.0.0.1:5173
pnpm app:open # in a second terminal: the one-time owner setup pageA clone keeps the template's own package pins, lockfile, git history and remote. smrt cookbook apply gives the same template with every s-m-r-t package pinned to the current release (0.57.40).
A clone stays on the version the template last moved to until you bump it. The older @happyvertical/smrt-template-sveltekit package is still published; it is not the starting
point.
2. Read the first model
src/lib/models/Note.ts is the application's data model. On every pnpm dev and pnpm build, the smrt() Vite plugin turns
this one class into the schema and the REST routes under /api/notes. The same
class supplies the WebMCP read tools, the assistant's tools and the remote MCP read tools. pnpm db:migrate applies schema changes.
import { SmrtObject, smrt } from '@happyvertical/smrt-core';
import { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';
@smrt({
api: { include: ['list', 'get', 'create'], writable: ['title', 'body'] },
mcp: { include: ['list', 'get', 'create'] },
})
@TenantScoped({ mode: 'required' })
export class Note extends SmrtObject {
@tenantId()
tenantId: string = '';
title: string = '';
body: string = '';
}writableis the allowlist for REST writes;includepicks which generated operations exist at all.@TenantScopedwithmode: 'required'means every note belongs to one organization and is never read across them.- The generated files under
.smrt/andsrc/routes/api/are gitignored. Edit the model, not them.
3. Continue through the foundations
- Objects and collectionsRename Note and add the first useful fields and relationships.
- TenantsDecide whether records are global, tenant-owned, or part of a tenant hierarchy.
- Users and profilesConnect your sign-in provider and keep product identity separate.
- Memberships and permissionsSeed roles and protect app-owned mutations.
- Pages and live dataLoad on the server, then hydrate browser collections only where needed.
- Generated interfacesChoose the REST, MCP, WebMCP, and CLI actions each model should expose.