Clone smrt-start
Start from the template itself.
smrt-start is the public, MIT-licensed template thatsmrt cookbook apply copies by
default. Clone it on its own and you get a small working app, not an empty folder.1. Clone and run it
You'll 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. If you're
ever unsure, 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 you the same template with every smrt package pinned to the current release (0.62.10).
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, but it isn't the
place to start.
2. Read the first model
src/lib/models/Note.ts is the app's data model. Every time you run pnpm dev or 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.
When the schema changes, pnpm db:migrate applies it.
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 from another one.- The generated files under
.smrt/andsrc/routes/api/are gitignored. Edit the model and leave them be.
3. Keep going with the foundations
- Objects and collectionsRename Note, then add your 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 you need them.
- Generated interfacesChoose which REST, MCP, WebMCP and CLI actions each model exposes.