# 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:

```txt
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 `App` from `client/index.tsx`.
- Use `ctx.auth.userId` for user-owned rows.
- Use `useQuery` and `useMutation` rather than inventing a client API.
- Style with Tailwind classes in JSX.

## Examples

- [`todo`](./todo): per-user rows, ownership checks, checkbox mutation, clear-completed mutation.
- [`guestbook`](./guestbook): shared feed, author metadata from auth, bounded text validation.

Run the checked-in todo example:

```sh
npx lakebed dev examples/todo
```

Open separate tabs with different guest identities:

```txt
http://localhost:3000/?lakebed_guest=alice
http://localhost:3000/?lakebed_guest=bob
```
