Deploy Vibe Coded Apps
Pick your app's language and framework. Every section below—the deployment steps, pre-flight checklist, hosting picks and cost estimate—rewrites itself for your stack.
Deployment path Next.js
Four steps, exact commands and production gotchas for shipping a Next.js app.
Most vibe coded full-stack apps (from v0, Cursor, Claude Code or Codex) land on Next.js. It deploys cleanly to serverless platforms, or as a standalone Node server on a container host when you need WebSockets, long AI calls or flat-rate billing.
-
Verify the production build & lock Node
Dev mode hides TypeScript errors, missing
"use client"directives and dynamic-route issues. Build and boot in production mode locally and pin your Node version.node -v > .nvmrc npm ci npm run build && npm start
-
Pick serverless or standalone container output
Vercel and Netlify auto-detect Next.js. For Railway, Fly.io or a VPS with Docker, enable
output: "standalone"innext.config.tsto shrink the image dramatically.// next.config.ts export default { output: 'standalone' }; # Deploy to Vercel npx vercel --prod -
Set env vars and run database migrations
Add every secret from
.env.examplein the host dashboard (keep only safe public values inNEXT_PUBLIC_*) and run migrations as a release step.npx vercel env add DATABASE_URL production npx prisma migrate deploy # or: npx drizzle-kit migrate
-
Connect your domain & check redirects
Point DNS at your host, verify HTTPS, and update OAuth callback URLs and Stripe webhooks from
localhost:3000or*.vercel.appto your real domain.dig +short yourapp.com curl -sI https://www.yourapp.com | head -n 5
⚠️ Next.js production gotchas
- Vercel Hobby is non-commercial: once you charge users or run a business site, move to Vercel Pro ($20/user/mo), Cloudflare OpenNext or a flat-rate VPS.
- NEXT_PUBLIC_ leaks: any variable prefixed with
NEXT_PUBLIC_is inlined into client JS. Keep LLM, Stripe and DB keys strictly server-side. - Serverless timeouts: slow AI completions, scraping or PDF generation hit function timeout limits. Stream responses or offload to a background job.
- Image Optimization billing: uncached
<Image>transforms and heavy ISR revalidation can cost more than compute on usage-based plans.
Pre-flight checklist Next.js
Only the 10 checks that actually apply to Next.js. Expand any item to see why it breaks and copy an AI fix prompt.
Secrets, Config & Build
Why it fails in production: AI agents happily create a .env file and commit it, or paste a key straight into config. Bots scan public GitHub for keys within minutes of a push, and deleting the file later does not remove it from git history.
Explore the repository first and show me a short plan before editing anything. Audit this Next.js repository for leaked secrets. 1) Make sure .env, .env.local and any secret config files are in .gitignore. 2) Search every tracked file and git history (git log -p) for API keys, tokens, passwords, database URLs and private keys. 3) Move any hardcoded secret to an environment variable, document variable names (never values) in .env.example, and tell me which keys I must rotate.
Why it fails in production: Anything prefixed with VITE_, NEXT_PUBLIC_ or PUBLIC_ is baked into the JavaScript every visitor downloads. In prototypes it is common for an OpenAI key, Stripe secret or Supabase service_role key to sit right inside DevTools.
Explore the repository first and show me a short plan before editing anything. Find every environment variable exposed to the browser in this Next.js app (VITE_, NEXT_PUBLIC_, PUBLIC_, or anything imported in client code). For each one, tell me if it is safe to be public. Move every secret key behind a server-side API route or edge function and update the client to call that route instead.
Why it fails in production: Your local .env is not uploaded on deploy. A missing variable rarely crashes cleanly unless you check it at boot—instead it shows up later as a broken auth flow or "undefined" URL in production.
Explore the repository first and show me a short plan before editing anything. Create a single config module for this Next.js app that reads and validates every environment variable at startup and exits with a clear message naming any missing variable. Replace scattered env reads with this module and generate an up-to-date .env.example with one-line comments.
Database, State & Files
Why it fails in production: Serverless and container hosts wipe their filesystem on every deploy or restart, silently resetting SQLite or JSON files to empty. Prototypes also sometimes store state in memory or localStorage.
Explore the repository first and show me a short plan before editing anything. Inspect where this Next.js app stores data today. If it uses local SQLite on an ephemeral filesystem, JSON files, in-memory arrays or localStorage, migrate it to hosted Postgres (Neon or Supabase) with proper migration files instead of runtime auto-sync, read the connection string from DATABASE_URL, and configure connection pooling.
Why it fails in production: Files written to ./uploads vanish on the next container deploy or fail across multiple instances—and on PHP hosts, unfiltered uploads to a web-accessible folder can allow arbitrary script execution.
Explore the repository first and show me a short plan before editing anything. Find every place this Next.js app writes user files (uploads, images, PDFs, exports) to local disk. Move them to object storage (Cloudflare R2, S3 or Supabase Storage) with strict max file size and MIME type allowlists, private buckets by default, and signed URLs for access.
URLs, Routing & CORS
Why it fails in production: fetch("http://localhost:3000/api") works on your laptop and breaks for every real visitor. Canonical links, sitemaps and email links break the same way when pointing to preview domains.
Explore the repository first and show me a short plan before editing anything. Search the entire Next.js codebase for hardcoded localhost, 127.0.0.1, 0.0.0.0, port numbers and preview domains (*.lovable.app, *.vercel.app, *.netlify.app, *.ngrok.io). Replace them with a SITE_URL / API_BASE_URL config variable or relative same-origin paths, and verify sitemaps, OG tags and canonical URLs.
Why it fails in production: Sign-in works in preview, then fails live with redirect_uri_mismatch—or Stripe webhooks keep firing at the old URL so paid users never get upgraded.
Explore the repository first and show me a short plan before editing anything. List every external integration in this Next.js app that needs production URLs (auth providers, OAuth apps, Stripe/Resend webhooks, email templates). Tell me the exact dashboard setting for each, update code redirects to use SITE_URL, and verify webhook signature checks.
Security, Limits & Ops
Why it fails in production: Prototypes often hide admin screens in the UI while leaving the backing API open to curl requests, ID tampering or negative prices.
Explore the repository first and show me a short plan before editing anything. Audit every route, controller, server action or handler in this Next.js app. For each one: 1) enforce authentication where required, 2) verify resource ownership/role from the session (never from the request body), 3) validate input with a strict schema/validator, and 4) return generic error messages without internal stack traces.
Why it fails in production: An unthrottled AI endpoint becomes a free LLM proxy for the internet, and an unprotected email or auth endpoint gets scripted within days.
Explore the repository first and show me a short plan before editing anything. Add rate limiting to this Next.js app for login, signup, password reset, email sending, file uploads and any LLM/paid API calls. Apply per-IP and per-user limits returning HTTP 429 with Retry-After, plus a daily quota on AI calls. Show the limits you chose.
Why it fails in production: Nobody watches server stdout in production. Without Sentry/logging and provider spend caps, you learn about broken checkouts from angry users and abused API keys from your bank.
Explore the repository first and show me a short plan before editing anything. Prepare this Next.js app for production observability. 1) Add a lightweight /health endpoint (checking DB connectivity if used). 2) Wire structured error logging / Sentry with PII scrubbed. 3) Give me a short checklist of manual spend caps and billing alerts to enable on my host, database and LLM provider.
Hosting options Next.js
Ranked for Next.js (Serverless / Node.js SSR), with stack-specific caveats.
| Platform | Free tier | Paid from | Billing model | For Next.js & watch-outs |
|---|---|---|---|---|
|
Vercel Best fit |
Hobby plan (non-commercial use only) | Pro $20/user/mo + usage | Usage-based | Zero-config reference host for Next.js. Budget $20/user/mo once commercial and enable Spend Management. |
|
Cloudflare Pages & Workers Best fit |
Unmetered static bandwidth + 100k Worker req/day | Workers Paid $5/mo | Requests + CPU time | Runs via OpenNext Cloudflare adapter; great flat cost, but check Node API compatibility. |
|
Railway Best fit |
One-time trial credit | Hobby $5/mo incl. $5 usage | Usage (CPU + RAM) | Idle containers still bill for allocated RAM, so memory-heavy frameworks cost more than Rust/Go. |
|
VPS + Coolify / Dokploy (Hetzner, DO) Best fit |
n/a (open-source PaaS on your box) | ~$5–12/mo flat | Flat rate | Run output: "standalone" with Coolify/Dokploy to escape usage-based serverless bills at scale. |
|
Netlify Good fit |
Free plan with monthly bandwidth/build caps | Pro ~$19/member/mo | Credits / usage | Free sites pause if monthly limits run out; frequent AI commits burn build minutes. |
|
Fly.io Good fit |
Pay as you go | ~$2–6/mo per small machine | Usage per machine | Extra regions and detached volumes keep billing; auto-stop machines add brief wake latency. |
|
Supabase Good fit |
2 free projects (pause after ~7 days idle) | Pro $25/mo per org | Flat + usage | Managed Postgres + Auth + Storage; use Supavisor transaction pooling in serverless routes. |
|
Neon Postgres Good fit |
Free serverless Postgres (0.5 GB storage) | Launch ~$19/mo + usage | Usage (compute + storage) | Free computes scale to zero after idle (brief cold wake); check connection pooler URL. |
Approximate list prices in USD as of December 2026. Plans change often—confirm on each vendor's pricing page before committing.
Hosting cost estimator Next.js
Estimated monthly spend for a Full-stack Next.js (SSR) at different traffic tiers.
Free / starter tiers
Vercel Hobby (non-commercial), Cloudflare Workers
Managed PaaS
Vercel Pro ($20/user) + Neon / Supabase
Flat-rate VPS
Hetzner / DO VPS + Coolify (next start)
Free tier for side projects; Pro once commercial
Next.js deploys zero-config on Vercel. Free Hobby works for personal projects, or budget $20/mo for Pro (or a $5 VPS with Coolify) the moment you charge users.
- Vercel Hobby is strictly non-commercial.
- Serverless function timeouts (10–60 s) break long AI calls unless you stream or use a background queue.
Rough monthly estimates for one app, excluding your domain (~$10–15/year). "Outgrown" means free caps, sleep rules or non-commercial limits won't hold up at that traffic.