Lakebed Examples
Use these capsules as patterns for app-building agents. Each example is a complete Lakebed app with the same file layout your generated app should use:
server/index.ts
client/index.tsx
shared/
What To Copy
- Put schema, queries, and mutations in
server/index.ts. - Keep validation helpers and shared types in
shared/. - Export
Appfromclient/index.tsx. - Use
ctx.auth.userIdfor user-owned rows. - Use
useQueryanduseMutationrather than inventing a client API. - Style with Tailwind classes in JSX.
Examples
todo: per-user rows, ownership checks, checkbox mutation, clear-completed mutation.guestbook: shared feed, author metadata from auth, bounded text validation.
Run the checked-in todo example:
npx lakebed dev examples/todo
Open separate tabs with different guest identities:
http://localhost:3000/?lakebed_guest=alice
http://localhost:3000/?lakebed_guest=bob