Deployment

Last updated on 2026-09-02

This guide covers deploying the kit to production with Vercel (hosting) and Supabase (database and auth). No Stripe or payment provider setup is needed.

Prerequisites

Step 1 -- Prepare Supabase for Production

Run Migrations

In your production Supabase project, run the migration files in order via the SQL Editor:

  1. 001_schema.sql -- 19 tables with indexes and full-text search vectors
  2. 002_rls.sql -- Shared workspace RLS policies
  3. 003_triggers.sql -- Profile auto-creation, updated_at, activity logging, last_contacted
  4. 004_storage.sql -- crm-assets storage bucket

Configure Auth

  1. Go to Auth > URL Configuration

  2. Set Site URL to your production domain (e.g., https://crm.yourcompany.com)

  3. Add redirect URLs:

    • https://crm.yourcompany.com/auth/callback
    • https://crm.yourcompany.com/auth/confirm
  4. Enable OAuth providers (Google, GitHub) with production credentials

Create Admin User

  1. Sign up on your production site
  2. In Supabase Dashboard, go to Table Editor > profiles
  3. Find your user's row and set role to admin

Seed Data (Optional)

For a fresh production site, you likely do not want the seed data. If you want to start with sample data for demo purposes, run seed.sql in the SQL Editor.

Step 2 -- Deploy to Vercel

Option A: Git Integration

# Push your code to GitHub
git push origin main

# Connect to Vercel
# 1. Go to vercel.com/new
# 2. Import your repository
# 3. Add environment variables (see below)
# 4. Deploy

Option B: Vercel CLI

npm i -g vercel
vercel --prod

Environment Variables

Set these in Vercel Dashboard > Project Settings > Environment Variables:

Variable Value Notes
NEXT_PUBLIC_SUPABASE_URL https://xxx.supabase.co Your project URL
NEXT_PUBLIC_SUPABASE_ANON_KEY eyJ... Public anon key
SUPABASE_SERVICE_ROLE_KEY eyJ... Private service role key
NEXT_PUBLIC_APP_URL https://crm.yourcompany.com Your production URL

Important: The SUPABASE_SERVICE_ROLE_KEY is sensitive. Never expose it in client-side code. It is only used in Server Actions.

Step 3 -- Verify Production

After deployment, test the full flow:

  1. Visit the login page and create an account
  2. Make yourself an admin in Supabase (update profiles.role)
  3. Browse the dashboard and verify data loads
  4. Create a contact and confirm it appears in the contacts list
  5. Drag a deal card on the Kanban board and verify it persists
  6. Check reports load with aggregate data
  7. Test team management under Settings

Custom Domain

  1. In Vercel Dashboard > Project Settings > Domains
  2. Add your custom domain
  3. Update DNS records as directed by Vercel
  4. Update NEXT_PUBLIC_APP_URL to your custom domain
  5. Update Supabase Auth Site URL and redirect URLs to match

Performance

The kit is optimized for production:

  • Server Components for initial render -- no client-side data fetching for page loads
  • Route-level code splitting via the App Router
  • Supabase connection pooling for database queries
  • Full-text search indexes for fast contact and company search
  • Optimistic UI updates on the Kanban board for instant feedback
  • next/image for avatar and logo images with lazy loading

Monitoring

  • Supabase Dashboard -- monitor database queries, auth events, storage usage, and RLS policy performance
  • Vercel Analytics -- monitor page load times and Web Vitals
  • Vercel Logs -- check server-side errors in Server Actions
  • Supabase Logs -- review database query performance and identify slow queries

Set up monitoring for:

  • Failed auth attempts (Supabase Auth logs)
  • Slow database queries (Supabase query performance)
  • Server Action errors (Vercel function logs)
  • Storage bucket usage (Supabase storage metrics)