Deployment
Deploy to Vercel and configure your custom domain.
Deploy to Vercel
- Push your code to GitHub
- Go to vercel.com and click Add New Project
- Import your GitHub repository
- Add your environment variables (copy from
.env.local):
| Variable | Value |
|---|---|
NEXT_PUBLIC_APP_URL | https://yourdomain.com (must include https://) |
NEXT_PUBLIC_SUPABASE_URL | Your Supabase project URL |
NEXT_PUBLIC_SUPABASE_ANON_KEY | Supabase anon key |
SUPABASE_SERVICE_ROLE_KEY | Supabase service role key |
STRIPE_SECRET_KEY | Your Stripe secret key (sk_live_...) |
STRIPE_WEBHOOK_SECRET | Your production webhook secret (whsec_...) |
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY | Your Stripe publishable key (pk_live_...) |
RESEND_API_KEY | Your Resend API key (optional) |
- Click Deploy
Important: NEXT_PUBLIC_APP_URL must include the protocol (https://). Setting it to just yourdomain.com without https:// will cause the build to fail with an "Invalid URL" error.
Custom Domain
Use non-www (recommended)
Use your bare domain (e.g., yourdomain.com) as the primary domain, not www.yourdomain.com. This is the industry standard for SaaS apps.
- In Vercel, go to Settings > Domains
- Add
yourdomain.comas your primary domain - Add
www.yourdomain.comas a redirect toyourdomain.com - Vercel will automatically redirect all www traffic to the non-www version
DNS Configuration
In your domain registrar's DNS settings, add:
| Type | Name | Value |
|---|---|---|
| A | @ | 76.76.21.21 |
| CNAME | www | cname.vercel-dns.com |
Vercel will generate an SSL certificate automatically.
Update your environment variables
After adding your domain, update these values:
- Vercel: Set
NEXT_PUBLIC_APP_URLtohttps://yourdomain.com - config.ts: Set
domainNametoyourdomain.com(no https://, no trailing slash) - Supabase: Update the Site URL and Redirect URLs in Authentication > URL Configuration:
- Site URL:
https://yourdomain.com - Add redirect:
https://yourdomain.com/auth/callback
- Site URL:
- Stripe: Create a production webhook endpoint pointing to
https://yourdomain.com/api/webhooks/stripe
SEO Checklist
After deploying, verify your SEO setup:
https://yourdomain.com/sitemap.xmlreturns your sitemaphttps://yourdomain.com/robots.txtallows crawling of public pageshttps://yourdomain.com/opengraph-imagereturns your OG image- All URLs in sitemap use
https://yourdomain.com(non-www, with protocol) - Google Search Console is set up and sitemap is submitted
Redeploying
Vercel automatically redeploys when you push to your main branch. To trigger a manual redeploy:
- Go to your project in the Vercel dashboard
- Click Deployments > latest deployment > Redeploy
Or use the Vercel CLI:
npx vercel --prod