Vite Flare Starter
Clone and configure the batteries-included Cloudflare starter into a standalone project. Produces a fully rebranded, deployable full-stack app.
Stack
Cloudflare Bindings
Project Structure
Key Commands
Workflow
Step 1: Gather Project Info
Ask for:
Step 2: Clone and Configure
2a. Clone and clean
2b. Find-replace targets
Replace vite-flare-starter with the project name in these locations:
Also in wrangler.jsonc:
- Remove hardcoded
account_idline (let wrangler prompt or use env var) - Replace
database_idvalue withREPLACE_WITH_YOUR_DATABASE_ID
Reset package.json version to "0.1.0".
Use the Edit tool for replacements (preferred over sed to avoid macOS/GNU differences).
2c. Generate auth secret
2d. Create .dev.vars
Convert kebab-case project name: my-cool-app becomes Display My Cool App, ID my_cool_app.
2e. Create Cloudflare resources (optional)
2f. Install and migrate
2g. Initial commit
Step 3: Manual Configuration
- Google OAuth (if using): Go to Google Cloud Console, create OAuth 2.0 Client ID, add redirect URI
http://localhost:5173/api/auth/callback/google, copy Client ID and Secret to.dev.vars - Favicon: Replace
public/favicon.svg - CLAUDE.md: Update project description, remove vite-flare-starter references
- index.html: Update
<title>and meta description
Step 4: Verify Locally
Check: http://localhost:5173 loads, shows YOUR app name, sign-up/sign-in works (if OAuth configured).
Step 5: Deploy to Production
Critical: After first deploy, update BETTER_AUTH_URL with your actual Worker URL. Add the production URL to Google OAuth redirect URIs.
Security Fingerprints
Change all of these so attackers cannot identify your site uses this starter:
Environment Variables
Branding (VITE_ prefix = available in frontend)
Auth
Email (Optional)
Common Customisations
Adding a New Database Table
- Add schema in
src/server/db/schema.ts - Generate migration:
pnpm db:generate - Apply locally:
pnpm db:migrate:local - Apply to production:
pnpm db:migrate:remote
Adding a New API Route
- Create route file in
src/server/routes/ - Register in
src/server/index.ts - Add TanStack Query hook in
src/client/hooks/
Changing Auth Providers
Edit src/server/auth.ts: add provider to socialProviders, add credentials to .dev.vars and production secrets, update client-side login buttons.
Feature Flags
Control features via environment variables: VITE_FEATURE_STYLE_GUIDE=true, VITE_FEATURE_COMPONENTS=true. Add your own in src/client/lib/features.ts.
Troubleshooting
Production Deployment Checklist
-
BETTER_AUTH_SECRETset (different from dev!) -
BETTER_AUTH_URLmatches actual Worker URL -
TRUSTED_ORIGINSincludes all valid URLs - Google OAuth redirect URI includes production URL
- Remote database migrated (
pnpm db:migrate:remote) - No
vite-flare-starterreferences in config files - Favicon replaced
- CLAUDE.md updated
-
.dev.varsis NOT committed (check.gitignore)


