Copy .dev.vars.example to .dev.vars and set the OpenAI API key.
Run the dev server, which runs both vite and wrangler servers in dev mode. You could use wrangler only but then you lose vite dev mode advantages like HMR etc, hence the duality. It's due to the fact that vite currently doesn't support websockets, nor cloudflare worker environment fully natively. TODO: Improve this as soon as vite supports it.
Note that the websocket proxy of vite is running on a fixed port 5174 (ie +1 of 5173, the vite default) so if there's something running on it, you'll get an error.
bun run devGenerate types for your Cloudflare bindings in wrangler.toml:
bun run typegenYou will need to rerun typegen whenever you make changes to wrangler.toml.
bun testFirst, build your app for production:
bun run buildSet the OpenAI API key secret for production:
bunx wrangler secret put OPENAI_API_KEYThen, deploy your app to Cloudflare Pages:
bun run deployWe use Tailwind CSS and schadcn/ui.