Courses Curriculum Cities Blog Enroll Now
Build a SaaS with AI · Day 5 of 5 ~35 minutes

Day 5: Launch: Deploy, Monitor, and Grow

Deploy your SaaS to production, set up error monitoring and analytics, configure a custom domain, and run your first growth experiments.

1
Day 1
2
Day 2
3
Day 3
4
Day 4
5
Day 5
What You'll Build

A live SaaS deployed to Vercel with a custom domain, Sentry error tracking, PostHog product analytics, and a documented launch checklist you can reuse for every future product.

1
Section 1 · 8 min

Pre-Launch Checklist

Go through this before every launch. Skipping items here causes embarrassing bugs and lost signups in your first 24 hours.

Pre-Launch Checklist
npm run build
Zero TypeScript errors and zero build warnings
Test the full flow
Register → use free tier → hit limit → upgrade → verify PRO features work
Test Stripe test mode
Use card 4242 4242 4242 4242 to complete a test payment
Check mobile layout
Test pricing, hero, and dashboard on iPhone screen size
Verify env vars
All production env vars set in Vercel — no localhost URLs remain
Privacy + Terms
Required to run Stripe. Use a generator like termly.io for v1
Stripe live mode
Switch STRIPE_SECRET_KEY to live key (sk_live_) before real payments
2
Section 2 · 10 min

Deploy to Vercel with Production Environment

Deployment is the same as earlier courses — but now every environment variable matters. One wrong value means no payments, no auth, no AI.

bashterminal
# Deploy to Vercel
vercel --prod

# Required environment variables in Vercel:
# DATABASE_URL          — Neon/Supabase PostgreSQL URL
# NEXTAUTH_SECRET       — openssl rand -base64 32
# NEXTAUTH_URL          — https://yourdomain.com
# GOOGLE_CLIENT_ID      — from Google Cloud Console
# GOOGLE_CLIENT_SECRET  — from Google Cloud Console
# STRIPE_SECRET_KEY     — sk_live_... (switch from test)
# STRIPE_WEBHOOK_SECRET — from Stripe Dashboard webhooks
# ANTHROPIC_API_KEY     — from console.anthropic.com

# Add custom domain
vercel domains add yoursaas.com

# Run Prisma migration in production
# Add to Vercel Build Command:
# npx prisma migrate deploy && next build
3
Section 3 · 9 min

Add Error Monitoring and Analytics

You can't fix bugs you don't know about. Sentry catches errors in production. PostHog tracks user behavior. Both have free tiers that work for early-stage SaaS.

bashterminal
# Sentry: error monitoring
npm install @sentry/nextjs
npx @sentry/wizard@latest -i nextjs
# Follow prompts, creates sentry.config.js automatically

# PostHog: product analytics
npm install posthog-js
typescriptsrc/app/providers.tsx
'use client'
import posthog from 'posthog-js'
import { PostHogProvider } from 'posthog-js/react'
import { useEffect } from 'react'

export function PHProvider({ children }: { children: React.ReactNode }) {
  useEffect(() => {
    posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY!, {
      api_host: 'https://app.posthog.com',
      capture_pageview: true
    })
  }, [])
  return <PostHogProvider client={posthog}>{children}</PostHogProvider>
}

// Track custom events anywhere:
// posthog.capture('generation_created', { plan: 'FREE', tokens: 500 })
4
Section 4 · 8 min

Growth Loops for AI SaaS

Traffic doesn't come automatically. These are the three growth loops that work for early-stage AI SaaS with no marketing budget.

Growth Loops for Early AI SaaS
SEO content loop
Write 3 blog posts/week targeting problems your tool solves. Each post = free organic signups for years. This compounds.
Product Hunt launch
One-day spike of traffic, links, and signups. Prep for 2 weeks. Ask everyone you know to upvote at 12:01am PST on launch day.
Reddit/community
Post genuinely helpful content in subreddits your customers use. No spam. Share the tool only when it's directly relevant.
Free tool strategy
Build one free tool that does one thing really well. Link to your SaaS from it. Attracts backlinks and top-of-funnel traffic.
Cold email for B2B
Find your ideal customers on LinkedIn. Send 10 personalized emails/day. 2% reply rate = 20 conversations in 10 days.

What You Learned Today

  • Ran through the pre-launch checklist: full user flow test, Stripe test payment, mobile layout, environment variables
  • Deployed to Vercel with all production environment variables and connected a custom domain
  • Added Sentry for error monitoring and PostHog for product analytics — both on free tiers
  • Reviewed the five growth loops that drive early-stage AI SaaS growth without an ads budget
Your Challenge

Go Further on Your Own

  • Set up a Stripe test webhook in your Vercel dashboard pointing at /api/webhooks/stripe — test the full payment flow in production
  • Add a /dashboard/settings page where users can see their subscription status and open the Stripe Customer Portal
  • Write your first SEO blog post targeting 'AI [your use case] tool' and publish it to your /blog route
Day 5 Complete

Course Complete!

You finished all 5 days. Ready to go deeper?

Reserve Your Bootcamp Seat
Course Progress
100%

Want live instruction and hands-on projects? Join the AI bootcamp — 3 days, 5 cities.

Finished this lesson?