π 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.localfor secrets
Staging¶
staging.getcimple.com- Deployed on push to
stagingbranch - Uses production services with test data
Production¶
app.getcimple.com- Deployed on push to
mainbranch - Manual approval required
Deployment Process¶
1. Local Development¶
2. Push to GitHub¶
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¶
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¶
- Quick Rollback: Cloudflare instant rollback button
- Git Rollback: Revert commit and push
- 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.