Deployment

Deploy xcity-home to Cloudflare Pages with the Node adapter + Wrangler.

xcity-home ships as an Astro hybrid app behind the Node adapter, with Cloudflare Pages as the production runtime.

Local build

npm install
npm run build       # astro build → ./dist
npm run start       # node ./dist/server/entry.mjs — preview the production bundle

Cloudflare Pages

npm run pages:dev      # wrangler pages dev ./dist
npm run pages:deploy   # build + wrangler pages deploy ./dist

wrangler.toml pins the project name; Cloudflare environment variables hold all secrets — STRIPE_SECRET_KEY, GOTRUE_ADMIN_TOKEN, LITELLM_MASTER_KEY, etc. See Operations: Secrets for the full list.

Required environment variables

VarPurpose
PUBLIC_SUPABASE_URLLocal dev fallback identity provider
PUBLIC_SUPABASE_ANON_KEYAnon key for dev
GOTRUE_URLSelf-hosted GoTrue base (https://auth.xcity.one)
GOTRUE_ADMIN_TOKENLong-lived service JWT for webhook user updates
STRIPE_SECRET_KEYStripe secret
STRIPE_WEBHOOK_SECRETStripe webhook signing secret
STRIPE_PRICE_PRO_MONTHLYStripe price id for Pro
STRIPE_PRICE_TEAM_MONTHLYStripe price id for Team
LITELLM_BASE_URLhttps://tokenhub.xcity.one
LITELLM_MASTER_KEYTokenHub master key for key provisioning
XCT_CORS_EXTRA_ORIGINSComma-separated dev/external origins

Smoke test the deploy

After every deploy:

  1. Hit / — homepage 200.
  2. Hit /api/auth/me — should be 401 when not signed in.
  3. Hit /dashboard while signed in — sidebar shell renders.
  4. Trigger a Stripe test event (stripe trigger checkout.session.completed) — webhook returns 200.

Or just run the smoke suite:

npm run test:smoke

See Operations: Test framework.

Last updated: