git add -A
git commit -m "Initial commit from vite-flare-starter"
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
Check: http://localhost:5173 loads, shows YOUR app name, sign-up/sign-in works (if OAuth configured).
Step 5: Deploy to Production
# Set production secrets
openssl rand -base64 32 | npx wrangler secret put BETTER_AUTH_SECRET
echo "https://PROJECT_NAME.SUBDOMAIN.workers.dev" | npx wrangler secret put BETTER_AUTH_URL
echo "http://localhost:5173,https://PROJECT_NAME.SUBDOMAIN.workers.dev" | npx wrangler secret put TRUSTED_ORIGINS
# If using Google OAuth
echo "your-client-id" | npx wrangler secret put GOOGLE_CLIENT_ID
echo "your-client-secret" | npx wrangler secret put GOOGLE_CLIENT_SECRET
# Migrate remote database
pnpm run db:migrate:remote
# Build and deploy
pnpm run build && pnpm run deploy
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:
Location
Default Value
How to Change
Page title
"Vite Flare Starter"
index.html
App name in UI
"Vite Flare Starter"
VITE_APP_NAME env var
localStorage keys
vite-flare-starter-theme
VITE_APP_ID env var
API tokens
vfs_ prefix
VITE_TOKEN_PREFIX env var
GitHub links
starter repo
VITE_GITHUB_URL (set empty to hide)
Worker name
vite-flare-starter
wrangler.jsonc
Database name
vite-flare-starter-db
wrangler.jsonc
R2 buckets
vite-flare-starter-*
wrangler.jsonc
Environment Variables
Branding (VITE_ prefix = available in frontend)
Variable
Purpose
Example
VITE_APP_NAME
Display name in UI
"My Cool App"
VITE_APP_ID
localStorage prefix, Sentry
"mycoolapp"
VITE_TOKEN_PREFIX
API token prefix
"mca_"
VITE_GITHUB_URL
GitHub link (empty = hidden)
""
VITE_FOOTER_TEXT
Footer copyright text
"2026 My Company"
APP_NAME
Server-side app name
"My Cool App"
Auth
Variable
Purpose
Notes
BETTER_AUTH_SECRET
Session encryption
openssl rand -hex 32
BETTER_AUTH_URL
Auth base URL
Must match actual URL exactly
TRUSTED_ORIGINS
Allowed origins
Comma-separated, include localhost + prod
GOOGLE_CLIENT_ID
Google OAuth
From Google Cloud Console
GOOGLE_CLIENT_SECRET
Google OAuth
From Google Cloud Console
ENABLE_EMAIL_LOGIN
Enable email/password
"true" to enable
ENABLE_EMAIL_SIGNUP
Enable email signup
Requires ENABLE_EMAIL_LOGIN
Email (Optional)
Variable
Purpose
Notes
EMAIL_FROM
Sender address
For verification/password reset
EMAIL_API_KEY
Email service API key
Resend recommended
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
Symptom
Cause
Fix
Auth redirects to homepage silently
Missing TRUSTED_ORIGINS
Set TRUSTED_ORIGINS with all valid URLs
"Not authorized" on deploy
Wrong account_id
Remove account_id from wrangler.jsonc or set yours
Database 500 errors
Missing migrations
Run pnpm db:migrate:local and pnpm db:migrate:remote
localStorage shows "vite-flare-starter"
Missing VITE_APP_ID
Set VITE_APP_ID=yourapp in .dev.vars
Auth fails in production only
BETTER_AUTH_URL mismatch
Must match actual Worker URL exactly (https, no trailing slash)
"redirect_uri_mismatch" on Google sign-in
OAuth redirect URI missing
Add production URL to Google Cloud Console OAuth redirect URIs
Secret changes have no effect
Not redeployed
wrangler secret put does NOT redeploy. Run pnpm deploy after