Skip to content
View as .md

Local development

apps/www is the only worker.

Web app

Terminal window
bun run dev # Vite + Caddy h2 proxy → https://localhost:8443
bun run dev:trust # one-time, only if the browser distrusts localhost:8443

Open https://localhost:8443. bun run dev also serves Vite on :8888, but use the Caddy origin for house/thread pages and agent browser testing: Electric long-polls can exhaust browser HTTP/1.1 sockets on :8888, while Caddy multiplexes them over h2. Combined dev logs are in apps/www/tmp/dev.log.

If TLS is marked insecure, keep bun run dev running and run bun run dev:trust in another terminal. On WSL it imports Caddy’s local CA into the Windows current-user trust store; restart the browser if needed. An expired or missing leaf certificate needs regeneration, not trust repair; follow Repair localhost TLS. In DevTools, /api/shapes/* should show protocol h2.

Use Wrangler only when you need full Cloudflare bindings:

Terminal window
bunx wrangler dev -c apps/www/wrangler.jsonc # full bindings, no HMR

Vite dev does not provide Cloudflare-specific bindings such as the rate limiter. Most routes do not need them. Secrets live in apps/www/.env.local (SUPABASE_JWT_SECRET, DURABLE_STREAMS_SECRET, ELECTRIC_*, OPENROUTER_API_KEY; ANTHROPIC_API_KEY is optional).

Checks

Terminal window
bun run check # format + lint + typecheck across packages
bun run test # all packages
# scope: bun run --filter '@arbe/cli' check

check subsumes lint — never run both. Biome handles most packages; apps/www uses eslint + prettier because of the Svelte plugin.

Code: apps/www/Caddyfile.dev, apps/www/.env.example.
See system/environment-variables, system/deployment, debugging.