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:
001_schema.sql-- 19 tables with indexes and full-text search vectors002_rls.sql-- Shared workspace RLS policies003_triggers.sql-- Profile auto-creation, updated_at, activity logging, last_contacted004_storage.sql-- crm-assets storage bucket
Configure Auth
-
Go to Auth > URL Configuration
-
Set Site URL to your production domain (e.g.,
https://crm.yourcompany.com) -
Add redirect URLs:
https://crm.yourcompany.com/auth/callbackhttps://crm.yourcompany.com/auth/confirm
-
Enable OAuth providers (Google, GitHub) with production credentials
Create Admin User
- Sign up on your production site
- In Supabase Dashboard, go to Table Editor > profiles
- Find your user's row and set
roletoadmin
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_KEYis 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:
- Visit the login page and create an account
- Make yourself an admin in Supabase (update
profiles.role) - Browse the dashboard and verify data loads
- Create a contact and confirm it appears in the contacts list
- Drag a deal card on the Kanban board and verify it persists
- Check reports load with aggregate data
- Test team management under Settings
Custom Domain
- In Vercel Dashboard > Project Settings > Domains
- Add your custom domain
- Update DNS records as directed by Vercel
- Update
NEXT_PUBLIC_APP_URLto your custom domain - 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/imagefor 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
Recommended Alerts
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)