Skip to content

πŸš€ Deployment (MVP)

Overview

Simple deployment using Cloudflare's edge network with GitHub Actions.

Deployment Architecture

Cloudflare Pages (Static Sites)

  • Marketing Site: getcimple.com
  • Customer Docs: docs.getcimple.com (Public help docs)
  • Internal Docs: internal.docs.getcimple.io (Behind Cloudflare Access)
  • Automatic deployment on push
  • Global CDN distribution

Cloudflare Workers (Web App)

  • Main App: app.getcimple.com (SvelteKit)
  • API Routes: Integrated with SvelteKit
  • Edge compute for dynamic content
  • Uses adapter-cloudflare-workers

Environments

Development

  • Local development with Vite hot reload
  • Supabase local emulator (optional)
  • .env.local for secrets

Staging

  • staging.getcimple.com
  • Deployed on push to staging branch
  • Uses production services with test data

Production

  • app.getcimple.com
  • Deployed on push to main branch
  • Manual approval required

Deployment Process

1. Local Development

pnpm dev
# Opens http://localhost:5173

2. Push to GitHub

git add .
git commit -m "feat: add new feature"
git push origin feature-branch

3. Automatic Deployment

  • PR to staging β†’ Deploys preview
  • Merge to staging β†’ Deploys staging
  • Merge to main β†’ Deploys production

4. GitHub Actions Workflow

# .github/workflows/deploy.yml
name: Deploy
on:
  push:
    branches: [main, staging]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: pnpm/action-setup@v2
      - run: pnpm install
      - run: pnpm build # Vite builds SvelteKit
      - run: pnpm deploy # Wrangler deploys to Workers

Build Process (Vite + SvelteKit)

# Development (Vite dev server)
pnpm dev              # Fast HMR, instant updates

# Production Build
pnpm build            # Vite optimizes for production
                      # Creates .svelte-kit/cloudflare
pnpm preview          # Test production build locally

# Deploy to Cloudflare Workers
pnpm wrangler deploy  # Uses adapter-cloudflare-workers

Environment Variables

Required for All Environments

PUBLIC_SUPABASE_URL=https://[project].supabase.co
PUBLIC_SUPABASE_ANON_KEY=[anon-key]
KINDE_DOMAIN=https://[tenant].kinde.com
KINDE_CLIENT_ID=[client-id]
KINDE_CLIENT_SECRET=[secret]

Production Only

SENDGRID_API_KEY=[key]
TWILIO_ACCOUNT_SID=[sid]
TWILIO_AUTH_TOKEN=[token]
SENTRY_DSN=[dsn]

Monitoring

Basic Monitoring (MVP)

  • Cloudflare Analytics (built-in)
  • Supabase Dashboard (queries/performance)
  • Error logs in Cloudflare Workers
  • Sentry for error tracking

What We're NOT Doing Yet

  • Complex APM tools
  • Custom dashboards
  • Log aggregation
  • Synthetic monitoring

Rollback Process

  1. Quick Rollback: Cloudflare instant rollback button
  2. Git Rollback: Revert commit and push
  3. Database Rollback: Supabase point-in-time recovery

Security

MVP Security Basics

  • All secrets in environment variables
  • HTTPS everywhere (Cloudflare handles)
  • API keys rotated quarterly
  • Basic rate limiting (Cloudflare)

Internal Docs Protection

  • Cloudflare Access: Zero Trust authentication
  • Access Policy: Team members only
  • URL: internal.docs.getcimple.io
  • Setup: Simple email-based authentication
# Cloudflare Access Policy
Service: internal.docs.getcimple.io
Policy: Require email ending in @getcimple.com

Post-MVP Additions

  • WAF rules
  • DDoS protection (advanced)
  • Security scanning
  • Penetration testing

Keep deployment simple. Automate the basics. Add complexity later.