Getting Started
From clone to live — run it, customize it, deploy it
Last updated October 21, 2026
This page takes you from cloning the repo to a live site. Four stages, every step with a copyable command.
When you finish you have a site on Cloudflare Workers with your own name, logo, and navigation.
Prerequisites
| Need | Notes |
|---|---|
| Node.js 22 / 24 | Even LTS only. Odd versions (23 / 25) are unsupported by vitest@5 |
| pnpm | Version pinned by packageManager in package.json; do not use pnpm 9 |
| Cloudflare account | The free plan is enough. You can run locally without one |
node --version # v22.x or v24.x
pnpm --versionSetup
0. Make it your own project
pnpm run initThe script asks for a site name, short name, domain, and support email, then:
- replaces the brand name across messages,
manifest,package.json, andwrangler.jsonc; - resets content module switches to your choices (all off by default; use
--modules docs,blog to enable them);
- generates
.envfrom.env.exampleand fills in empty keys such asBETTER_AUTH_SECRET.
Pressing Enter through every prompt gives you a runnable project. --non-interactive is for scripted setups, and --dry-run prints the files that would change. Re-running is safe: existing .env values and brand names are not rewritten.
Modules default to off on purpose. The template ships withanalytics, and others enabled, and each of them requires its own credentials — a fresh clone would otherwise fail production validation immediately. Turn on what you need.
1. Install dependencies
pnpm install2. Provision local resources
pnpm run setupThe script asks for a project name, then creates (or reuses) a D1 database and a KV namespace, generates the auth secret, and writes the results to .env and wrangler.jsonc. Existing .env values are kept — only the keys the script manages are rewritten.
R2 is not created for you: the bucket must be activated once in the Cloudflare dashboard (it requires a payment method, so the API cannot do it). See Storage for the manual steps.
If you are not logged in to Cloudflare it warns you but continues — local development uses a SQLite-backed D1 and needs no real resources. To log in:
pnpm exec wrangler login3. Start the dev server
pnpm devOpen http://localhost:3000. If the database was not initialized, run it manually:
pnpm exec wrangler d1 migrations apply DB --local4. Customize the site
All site identity lives in src/config/website.ts:
// src/config/website.ts
export function createWebsiteConfig(env: PublicEnv): WebsiteConfig {
return {
baseUrl: env.VITE_BASE_URL,
metadata: {
name: '<your-site-name>', // ← your site name
images: { ogImage: '/logo.png', /* … */ },
},
docs: { enabled: true }, // ← set false to drop the docs site
// …
}
}See Website Config for every field.
5. Deploy
pnpm deployThis runs production env validation → build → client bundle leak check → wrangler deploy.
Local.envvalues do not become production secrets. Configure them separately withwrangler secret put, and never put a secret behind aVITE_prefix — those are inlined into the browser bundle.
To deploy automatically on push to main, see Cloudflare · CI deployment.
Commands
| Command | Purpose |
|---|---|
pnpm dev | Dev server on port 3000 |
pnpm build | Production build |
pnpm deploy | Validate → build → check → deploy |
pnpm check | Biome + TypeScript + env + locale (run before committing) |
pnpm test | Unit and component tests |