Skip to content

Deployment

The app deploys to Cloudflare Pages (frontend) and Cloudflare Workers (backend API).

Prerequisites

  • Cloudflare account
  • wrangler CLI: bun add -g wrangler
  • Supabase project (for database + auth)
  • Cloudflare R2 bucket (for assets)

Environment Variables

Set these in the Cloudflare Dashboard → Pages → Settings → Environment Variables:

env
# Supabase
PUBLIC_SUPABASE_URL=https://[project].supabase.co
PUBLIC_SUPABASE_ANON_KEY=eyJ...
SUPABASE_SERVICE_ROLE_KEY=eyJ...

# Anthropic
ANTHROPIC_API_KEY=sk-ant-...

# Cloudflare R2
R2_ACCOUNT_ID=...
R2_ACCESS_KEY_ID=...
R2_SECRET_ACCESS_KEY=...
R2_BUCKET_NAME=design-assets

Build & Deploy

bash
# Build
bun run build

# Deploy to Cloudflare Pages
wrangler pages deploy .svelte-kit/cloudflare

# Or use the deploy script
bun run deploy

wrangler.toml

toml
name = "design-platform"
compatibility_date = "2026-01-01"
pages_build_output_dir = ".svelte-kit/cloudflare"

[[r2_buckets]]
binding = "ASSETS"
bucket_name = "design-assets"

SvelteKit Cloudflare Adapter

javascript
// svelte.config.js
import adapter from '@sveltejs/adapter-cloudflare'

export default {
  kit: {
    adapter: adapter({
      routes: {
        include: ['/*'],
        exclude: ['<all>']
      }
    })
  }
}

Domain Setup

  1. Go to Cloudflare Pages → Custom Domains
  2. Add design.localsolutions.de
  3. DNS: CNAME → [project].pages.dev

CI/CD

Cloudflare Pages automatically triggers a build on every push to main. To disable auto-deploy and use manual deploy only, set the branch policy in the Cloudflare Dashboard.

Rollback

bash
# List recent deployments
wrangler pages deployment list

# Rollback to specific deployment
wrangler pages deployment rollback [deployment-id]

Internal documentation for development team