CI/CD & Deployment

Status: Proposed Owner: @bilal @deen Last Updated: 2026-02-15

Infrastructure and deployment planning. Detailed configs and scripts live in the repo.

Pipeline Overview

PR → Lint + Type-Check → Unit Tests → Build → Security Scan → AI Code Review
  → DB Migrations → Deploy to Vercel → Smoke Tests → Live

Environment Strategy

EnvironmentDatabaseHostingStatus
LocalSupabase local (Docker)localhost:3000Active
ProductionSupabase CloudVercelPlanned
StagingSupabase Cloud (separate)Vercel PreviewFuture

Branch Strategy

main                → Production
├── staging         → Staging (future)
└── feature/*       → Development
    └── claude/*    → AI-generated branches

Local Development

Requires: Docker 24+, Node.js 20+, pnpm, Supabase CLI 1.150+.

supabase start            # Start local Supabase (first run downloads ~2GB)
pnpm install && pnpm dev  # Start Next.js

Local services: App (:3000), Supabase API (:54321), Studio (:54323), PostgreSQL (:54322), Inbucket (:54324).

Seed users: admin@test.local, landlord@test.local, staff@test.local (all password123).

Environment Variables

Required for Production

CategoryVariables
CoreDATABASE_URL, DIRECT_URL, NEXTAUTH_URL, NEXTAUTH_SECRET
SupabaseNEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY, SUPABASE_SERVICE_ROLE_KEY
LLMANTHROPIC_API_KEY, OPENAI_API_KEY
CommsTWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, TWILIO_WHATSAPP_NUMBER, VOICE_WEBHOOK_SECRET
EmailSENDGRID_API_KEY, SENDGRID_FROM_EMAIL
OptionalSENTRY_DSN, UPTIME_ROBOT_KEY, KIMI_API_KEY, GLM_API_KEY

CI Pipeline (GitHub Actions)

StepToolRuns On
Lint + type-checkESLint, tscEvery PR
Unit testsVitest (42 tests)Every PR
BuildNext.jsEvery PR
Secret scanningTrufflehogEvery PR
SASTSemgrepEvery PR
Dependency auditpnpm auditEvery PR
AI code reviewCodeRabbitPRs only

CD Pipeline

StepTool
DeployVercel (auto on main push)
DB migrationsSupabase CLI (supabase db push)
Smoke testscurl health + message endpoints
Rollbackvercel rollback (automatic on failure)

Security Tooling

ToolPurposeFrequency
TrufflehogSecret detectionEvery PR
SemgrepSAST / code analysisEvery PR
TrivyDependency scanningEvery PR
OWASP ZAPDAST / web scanningWeekly
pnpm auditDependency vulnerabilitiesEvery PR + Dependabot

Local Isolation Strategy

External services are stubbed for local development:

ComponentLocalProduction
PostgreSQLSupabase localSupabase Cloud
AuthSupabase local (seeded users)Supabase Auth
LLMStub provider (LLM_PROVIDER=stub)Real API keys
EmbeddingsDeterministic stub (content hashing)OpenAI
TwilioTest credentials (no send)Real API
EmailInbucket (port 54324)SendGrid
VoiceFixture payloadsVAPI/Retell

Implementation Phases

Phase 0: Local Isolation — DONE (partial)

  • Supabase local stack
  • Seed auth users
  • .env.example with local defaults
  • LLM stub provider
  • Embedding stub
  • Webhook test fixtures

Phase 1: Foundation — IN PROGRESS

  • Basic CI (lint + test on PR)
  • Type-check + build in CI
  • Vercel deployment
  • Health check endpoint

Phase 2: Security — PLANNED

  • Trufflehog
  • Semgrep
  • pnpm audit
  • CodeRabbit AI review

Phase 3: Automation — PLANNED

  • OWASP ZAP scheduled scans
  • Slack notifications
  • Rollback automation

Phase 4: Staging — FUTURE

  • Staging Supabase project
  • Staging environment config
  • Data sync scripts