Skip to content
Source
Sign inSign up
TanStack/schemas
Open History to see the last commit

README.md

39 lines2.2 KB

1# Examples
2​
3Three small [TanStack Start](https://tanstack.com/start) apps showing the
4modelschemas packages in real use. Each links to the workspace packages by
5`workspace:*` reference — run `bun install` at the repo root first.
6​
7| Example | Shows | Port |
8| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ---- |
9| [schema-studio](./schema-studio) | `@modelschemas/vite` — schemas pulled at dev time, committed, verified offline at build; rendered as generative UI (schema-driven form) | 3201 |
10| [image-dimensions](./image-dimensions) | `@modelschemas/client` — live discovery of image models; supported dimensions extracted from each input schema and drawn to scale | 3202 |
11| [video-composer](./video-composer) | `@modelschemas/client` — video request builder whose model/aspect-ratio/duration pickers only offer values the schema allows | 3203 |
12​
13```bash
14bun install # repo root — links workspace packages
15cd examples/schema-studio # or image-dimensions / video-composer
16bun run dev
17```
18​
19All three fetch from the live service at `https://modelschemas.com` by
20default. Point them at another deployment (e.g. a local dev server with
21freshly synced providers) with:
22​
23```bash
24MODELSCHEMAS_URL=http://localhost:3100 bun run dev
25```
26​
27API calls happen server-side (TanStack Start server functions, or the
28`@modelschemas/vite` plugin at dev/build time), so no CORS setup is needed.
29​
30## Deploying
31​
32Every example ships with a Cloudflare Workers setup: `bun run deploy` inside
33an example builds it and deploys it to your own account, running at the root
34of your workers.dev subdomain (reading from the live modelschemas API by
35default). The `modelschemas` Wrangler environment
36(`CLOUDFLARE_ENV=modelschemas bun run deploy`) is the canonical deployment,
37which mounts each app at `modelschemas.com/examples/<name>/` via a zone
38route — only deployable by maintainers, since it targets the
39modelschemas.com zone.