Environment Setup
Set your site address and service keys, then enable only what you need
Run the project using Quick Start first. Fill in the services you want to use and leave the rest empty.
Where Settings Go
| What you are setting | Locally | When deployed |
|---|---|---|
| Website URL | .env → VITE_APP_URL | wrangler.jsonc → vars.VITE_APP_URL |
| Other public settings, such as analytics IDs | .env | .env.production or Cloudflare build variables |
| Authentication, AI, email, and payment secrets | .dev.vars | Cloudflare Worker secrets |
| Theme, credit rewards, payment provider, and other options | Admin → Settings | Your live site's Admin → Settings |
Settings beginning with VITE_ are visible in the browser. Put private keys only in .dev.vars or Worker secrets. To change the product name, logo, and description, use Website Settings.
1. Check Your Site Address
Open .env:
VITE_APP_URL=http://localhost:3377
VITE_ENV=development
VITE_CURRENCY=USDWhen testing payments and AI locally, also set the top-level vars.VITE_APP_URL in wrangler.jsonc to http://localhost:3377.
Keep VITE_ENV=development. In this project, the value production enables waitlist mode and restricts access to docs and application pages. Keep development when opening the full site to visitors, including after launch. It does not prevent deployment to Cloudflare's production environment.
After changing configuration files, stop and restart pnpm dev.
2. Enable Registration and Admin Access
Initialize the local database, then fill in .dev.vars:
| Setting | Value |
|---|---|
BETTER_AUTH_SECRET | A random secret generated with the tool below |
SUPER_ADMIN_EMAIL | The email you will use to sign in to admin |
EMAIL_PROVIDER | resend |
EMAIL_FROM | A sender address on your verified Resend domain |
RESEND_API_KEY | An API key created in Resend |
Follow Authentication to register that email, click the verification link, and open admin. If the email does not arrive, check your sender domain and settings using the Email guide.
3. Choose Your Features
| I want to enable | Setup guide |
|---|---|
| Google or GitHub sign-in | Authentication |
| Subscriptions or one-time payments | Stripe or Creem; choose one |
| AI chat, image, video, or audio generation | AI Features |
| File storage and reference image uploads | File Storage |
| Welcome credits and credit packages | Credits |
| Website analytics | Google Analytics |
Each guide lists the keys you need, where to get them, and how to test the feature.
Optional: Sign-in CAPTCHA
Create a widget in Cloudflare Turnstile and add the domains you use locally or online.
- In
.env, fill inVITE_TURNSTILE_SITE_KEYand setVITE_TURNSTILE_CAPTCHA_ENABLED=true. - In
.dev.vars, fill inTURNSTILE_SECRET_KEYand setTURNSTILE_CAPTCHA_ENABLED=true.
Restart the site, open sign-in, and complete the CAPTCHA and login. Keep both switches set to false if you are not using CAPTCHA yet.
Change Options in Admin
Sign in as an administrator and open /admin/config. Editable options such as themes and credit rewards can be saved here. Service keys are read-only; update them in .dev.vars or your live Worker's secrets.
If a regular option is locked, the page indicates that it is controlled by an environment setting. Remove that setting and restart or redeploy to edit it in admin.
When You Go Live
Follow the deployment guide and set vars.VITE_APP_URL in wrangler.jsonc to your public HTTPS site URL. Production builds use the same setting. Keep VITE_ENV=development or leave it unset to keep all site pages accessible. No CLOUDFLARE_ENV setting is needed.
Local secrets are not uploaded automatically. Run this once for each required secret, replacing BETTER_AUTH_SECRET with its name:
pnpm exec wrangler secret put BETTER_AUTH_SECRETEnter the value when prompted, then run pnpm run deploy. The live database and admin settings are separate from your local setup, so check each enabled feature after deployment.