Deployment guide

Run xPanda on Cloudflare

Build the site, connect the existing Supabase project, then attach your Cloudflare domain.

1. Set the public Supabase values before building

These two values are used by the browser bundle. Set them in your build environment; do not put private keys in source files.

  • VITE_SUPABASE_URL — your Supabase project URL
  • VITE_SUPABASE_PUBLISHABLE_KEY — the project publishable key

2. Build and deploy

Run these commands from the project folder. The build creates the Cloudflare deployment configuration.

npm install
npm run build
npx wrangler deploy --config .output/server/wrangler.json

3. Add Worker variables and the private key

In Cloudflare, open the Worker’s Settings → Variables and Secrets. Add the project URL and publishable key as variables, and the service-role key as a secret.

  • SUPABASE_URL — same project URL
  • SUPABASE_PUBLISHABLE_KEY — same publishable key
  • SUPABASE_SERVICE_ROLE_KEY — secret; never place this in browser settings or source code

Save the settings and deploy again. Until these values are present, database-backed pages and administrator tools cannot work on the Cloudflare copy.

4. Attach the domain

  1. A.In Cloudflare, open the Worker’s Settings → Domains & Routes and add the domain.
  2. B.Wait for Cloudflare to finish DNS and HTTPS setup.
  3. C.In xPanda administrator settings, set the same hostname as the primary domain.

The primary domain is used for canonical links and the sitemap; it does not redirect visitors from other domains.

5. Check the live site

Open the home page, sign in with an existing Supabase account, check a video page, then visit /robots.txt and /sitemap.xml. Keep public sign-up disabled unless an administrator intentionally enables it.