Vercel Deploy
Vercel turns git push into a live URL. No servers, no Docker, no YAML. Push code, get a website. This is the deployment layer of your AI stack — and it eliminates an entire category of DevOps work.
Why Vercel Changes Everything
Traditional deployment means provisioning servers, configuring Nginx, setting up SSL certificates, building CI/CD pipelines, and praying nothing breaks at 2am. Vercel replaces all of that with one concept: push to GitHub, get a live site.
Vercel built Next.js, so the integration is seamless — zero configuration, automatic optimizations, and deployment that works the way it should: instantly and invisibly.
The Deploy Pipeline
Every time you push to your main branch, Vercel triggers this exact sequence. Understanding it helps you debug when something goes wrong.
npm install to fetch dependenciesnext build for Next.js), catches errors hereyour-project.vercel.app (and your custom domain)Environment Variables: The Security Gate
Environment variables are how your app accesses secrets (API keys, database URLs) without hardcoding them in your source code. In Next.js, the NEXT_PUBLIC_ prefix is the dividing line between safe and dangerous.
Included in the browser bundle. Anyone can see these in your page source. Only use for values designed to be public — Supabase URL and anon key are fine (RLS protects data).
Only accessible in server-side code (API routes, Server Components, middleware). ALL secret keys go here — Stripe secret, service role key, webhook secrets. Never prefix these with NEXT_PUBLIC_.
# PUBLIC — safe for browser (RLS protects data)
NEXT_PUBLIC_SUPABASE_URL=https://<your-ref>.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOi...
# SECRET — server-side only (NEVER prefix with NEXT_PUBLIC_)
SUPABASE_SERVICE_ROLE_KEY=eyJhbGciOi...
STRIPE_SECRET_KEY=sk_live_...
STRIPE_WEBHOOK_SECRET=whsec_...
RESEND_API_KEY=re_...
Preview Deploys: Test Before You Ship
Every pull request gets its own unique URL. This is one of Vercel's most powerful features — it turns code review from "reading diffs" to "clicking a link and testing the actual app."
Create a PR on GitHub → Vercel builds and deploys that branch → a unique preview URL (like my-app-git-feature-xyz.vercel.app) appears as a comment on your PR. Click it to test the changes in a real browser. The preview uses the same infrastructure as production.
Preview deploys catch problems that code review misses — layout bugs, broken links, mobile rendering issues, environment variable misconfigurations. They also let non-technical stakeholders review changes without setting up a local dev environment.
This lesson is for Pro members
Unlock all 520+ lessons across 52 courses with Academy Pro.
Already a member? Sign in to access your lessons.