Skip to main content
Keep routes and middleware under src. Everything else is optional until you need it.
Generated at runtime (gitignored):

Conventions

Files and folders that start with _ are not routes. _layout.tsx, _document.tsx, _error.tsx, _404.tsx, and _middleware.ts are special files. Use _Button.tsx for colocated components. Directories wrapped in parentheses are groups. (marketing)/about.tsx still maps to /about.

Required vs optional

You can ship a site with only src/routes and src/middleware. Add src/worker.ts and wrangler.jsonc when you deploy to Cloudflare — the plugin then infers target: "cloudflare". Node apps do not need either file.