Blog / engineering

How to Ship a Vibe-Coded MVP to Production: The Complete Rescue Playbook

Metafic Team May 20, 2026

Your founder friend shows you a demo they built in Bolt over the weekend. It looks great. Clean UI, smooth animations, the happy path works. They hit traction. The first hundred users are real. Now they’re asking what it takes to get this to production.

You look at the code.

The auth flow stores passwords in plaintext. Stripe keys are hardcoded on the client. There’s a database connection string in a public file. The “send email” function calls SendGrid with the user’s API key as a query parameter. The whole stack is on Replit’s free hobby plan with no backups.

This is the vibe-coded MVP. In 2026 it is the most common engineering shape we inherit, and the most misunderstood. Replit, Bolt, Lovable, Emergent, Cursor, and the next five tools that will exist by the time you read this can ship a working product in a weekend. They cannot ship a product that survives a serious user load, a regulator, an observability outage, or a senior engineer’s code review.

The gap between the working prototype and software that survives Monday morning is the most expensive distance in software. Most rescue engagements we take are not rewrites. They are triage. This post is the playbook.

Why most rescue projects fail

Before the playbook, the most common failure mode.

A founder hits traction with a vibe-coded MVP. They are smart, they know the code has issues, and they hire a developer to “rewrite it properly.” The developer starts a green-field new codebase in their preferred stack. Six months later, the new codebase is 60% feature-complete, the old codebase is still in production, and the founder is running both. The runway runs out. The new codebase never ships. The team falls back to the old codebase. Three months of fixing what should have been a triage.

The right model is the opposite. Keep the working code running. Stop the bleeding. Add observability. Quarantine the unsafe paths. Then incrementally replace what hurts. Strangler-fig pattern.

Week one: triage, not code

The first week is not coding. It is reading.

Read the code

  • Open the repo. Read every file. Make a list of:
    • Files that contain secrets (API keys, database strings, encryption keys)
    • Files that handle auth or session management
    • Files that touch money (Stripe, payouts, refunds)
    • Files that touch PII (signup, profile, support tickets)
    • Files that look generated and are not customised
    • Files that nobody can explain

Read the users

  • Watch the first ten users use the product. Either via session recordings (Hotjar, PostHog, FullStory) or via in-person calls.
  • Note where they get stuck. Note where they go off the happy path.

Read the founder

  • What is the actual business model. What is the conversion funnel. What features are paying.
  • This is the most important read. The founder often does not have a clear answer. Push until they do.

The output of week one is a one-page rescue plan with three sequenced bets. Not a rewrite. Three specific moves that, in order, take the product from “fragile prototype” to “production-ready.”

Week two: stop the bleeding

The bets in the rescue plan get sequenced by risk, not by complexity. Risk first.

Security

  • Rotate every secret. Every API key. Every database password. Every JWT signing key.
  • Move all secrets out of code and into environment variables or a secrets manager.
  • Audit the public git history for any committed secrets. GitHub itself will tell you via Secret Scanning if you turn it on. Rotate any it flags.
  • Verify auth. If passwords are stored plaintext, migrate to a real hash (Argon2id or bcrypt with a cost factor of at least 10). The migration is a per-login lazy rehash so users don’t have to reset.

Data

  • Backup the database. Today. Twice. To at least one location not controlled by the same vendor as the database.
  • Add automated daily backups going forward. Verify they restore.
  • If the database is on the vibe-code platform’s free tier, plan migration to a real database service in week two or three.

Auth

  • If you’re using a homegrown auth system, plan migration to a real auth provider (Clerk, WorkOS, Auth0, Supabase Auth, or your own service if you have an engineer who specialises). The vibe-code-generated auth is rarely safe enough for production.
  • Force-rotate sessions. Send the existing user base a password reset email if you’re migrating hash functions.

Logging

  • Turn on application-level logging. Pick a service (Sentry, Logtail, Datadog, or your own). Get errors and crashes into your inbox.
  • Without observability, you cannot tell when something is broken until a user emails you.

This is not code shipping. This is operational hardening. Week two should not introduce new features.

Week three: critical-path tests

You now know what the product does, what it looks like, where the risk lives, and you have observability. Time to make change safe.

The goal is not 100% test coverage. The goal is to identify the 10 to 20 user journeys that, if they break, the business stops. Then write Playwright tests against those journeys.

For an e-commerce product: signup → browse → add to cart → checkout → confirmation. Add a return-flow test. Add a refund-flow test if you handle refunds. Add a cart-recovery test if you have abandoned cart emails.

For a B2B SaaS: signup → onboarding → first key action → invite teammate → second session. Run them on a real preview environment, not a mocked one.

For an AI product: signup → first prompt → response received → second prompt with context. Add a fallback test for when the LLM is slow or down.

The tests should run on every PR. If they break, the PR doesn’t ship.

This is the single biggest jump in production-readiness for a vibe-coded MVP. The codebase quality stays the same, but you can change it safely. That changes everything.

Week four to eight: the strangler fig

Now you can start moving code.

The pattern is strangler-fig: the old code stays running, the new code runs alongside, traffic gets routed at the boundary. Old code retires only after new code has been in production long enough to prove itself.

What to migrate first

The components that hurt the most. Examples we’ve inherited:

  • Auth. The most common day-one migration. Move to Clerk or WorkOS. Migrate user data in the background. Cut over per user as they sign in.
  • The database. From the vibe-code platform’s database to a real Postgres (Supabase, Neon, or your own RDS). Run dual-write for a week, then cut over.
  • The hosting layer. From Replit/Bolt’s free hosting to Cloudflare Pages, Vercel, Fly.io, or your own infra. The vibe-code platforms are not designed for production scale; their pricing breaks at usage. Plan the migration before you hit the wall.
  • AI calls. Move OpenAI/Anthropic calls from the frontend to the backend. The vibe-code-generated code often calls these from the client with the API key exposed. This is a security hole and a cost hole.

What to leave alone

  • The UI prototype. Most vibe-code-generated frontend code is actually fine. It might be ugly, but if it works and the user flows are right, leave it.
  • The product features that are converting. If you don’t have to touch them, don’t.
  • The third-party integrations that work. Stripe, Slack, Postmark. If they work, leave them.

How long does the strangler fig take?

For a typical vibe-coded MVP at the point of rescue:

  • Week 1: triage
  • Weeks 2-3: stop the bleeding
  • Week 4: critical-path tests
  • Weeks 5-8: first big migration (usually auth + database)
  • Weeks 9-16: second migration (usually hosting + observability)
  • Weeks 17-20: ongoing feature work alongside continued migration

By month three, you should have:

  • All secrets rotated and externalised
  • A real database with backups
  • A real auth provider
  • Logging and error tracking
  • Critical-path Playwright tests
  • One major component (usually auth) fully migrated off the vibe-code platform

By month six, you should have:

  • Most major components migrated
  • A team that can ship features safely
  • A foundation that can grow without further rescue

Specific vibe-code platforms: what to watch for

The platforms are not interchangeable. Each generates code with characteristic problems.

Replit

  • Often has the actual production hosting on Replit. Plan migration off.
  • Database is usually Replit’s Postgres or PocketBase. Migrate to a managed Postgres.
  • AI agent (Agent) tends to over-engineer. Look for unused dependencies and dead code paths.
  • Secrets are usually in Replit Secrets, which is fine, but verify nothing leaked to git.

Bolt

  • Generates Next.js or React + Supabase by default. The Supabase code is usually decent.
  • Auth is often Supabase Auth, which is acceptable for early production. Verify RLS policies before launch.
  • The UI code is often very component-heavy. Component prop interfaces drift. Worth a typing pass.

Lovable

  • Generates a similar Next.js + Supabase stack.
  • The shadcn/ui adoption is usually correct. The state management is often inconsistent.
  • Lovable’s auth flows have improved across versions; verify which version generated your code.

Cursor / AI IDEs

  • These produce a wider quality range because they amplify whatever the developer was doing.
  • The code is usually idiomatic for the chosen framework but may not be production-aware (logging, error handling, rate limits).
  • Often missing tests entirely.

Emergent / agent-based codegen

  • Recent generation, varying quality.
  • Tends to produce more abstractions than needed. Worth a simplification pass.
  • Often generates server actions or API routes with weak validation. Add Zod or io-ts validation at every input boundary.

The security audit checklist

For every vibe-coded MVP we rescue, the first audit covers these items. Run it on yours.

  • No secrets in code or in committed config files
  • No secrets in client-side JavaScript bundles (check Network tab in DevTools while logged in)
  • Passwords stored with Argon2id or bcrypt (not plain SHA, not MD5, not plaintext)
  • Sessions tied to a server-validated token, not client-side state
  • No customer PII in logs or error reports
  • HTTPS everywhere with HSTS
  • Database backups, automated, restore-tested
  • Rate limits on all auth endpoints
  • Input validation on every public API endpoint
  • CSRF protection on state-changing endpoints
  • Content Security Policy headers
  • No service-account credentials in shared 1Password vaults

If your MVP fails three or more of these, the rescue is more urgent than feature work.

When a rewrite actually is the answer

Most rescues are triage. But about 1 in 10 are genuine rewrites. The signal:

  • The original codebase has no consistent patterns. Each file solves the same problem a different way.
  • The data model is so wrong that re-modelling it would require touching every file.
  • The original platform (Bubble, Glide, etc.) is so opinionated that hosting elsewhere requires a from-scratch rebuild.
  • The product has pivoted enough that the original code reflects the old vision, not the current one.

In those cases, the right move is still strangler-fig, just at a larger scale. You don’t rewrite from scratch. You build new alongside old, route traffic, and retire piece by piece. The full rebuild that ships in six months is rare. The strangler-fig that ships in twelve and survives is the right bet.

How to brief a rescue team

If you’re going to bring in outside help (a pod, an agency, a senior contractor) for the rescue:

  1. Share the codebase before the kickoff call. A team that reads the code first will give you better answers.
  2. Share your real product traction numbers. Users, revenue, retention, churn. They affect the rescue priority order.
  3. Be specific about what is non-negotiable. “Cannot have any downtime” is a real constraint. “Want it to be perfect” is not.
  4. Share what’s already broken. Founders often hide this because they’re embarrassed. Hidden breakage is the most expensive kind to discover in week three.
  5. Agree on rollback authority. If the rescue team needs to disable a feature to safe the system, can they? Without a call?

The right rescue partner will refuse the engagement if the founder is not transparent about what’s broken. The rescue conversations that go badly are the ones where the founder thought they were buying a face-lift and the rescue team thought they were buying triage.

A note on AI-generated code in 2026

Vibe-coded MVPs are not a passing trend. The tools keep getting better. By the time you read this, the next generation of AI coding tools will ship products that look more polished than the ones in this post.

The gap between “AI can write the prototype” and “AI can write code that survives production” is closing slowly. It is not closed yet. Probably won’t be closed for another two to three years.

Until it does, the rescue playbook applies. Triage first. Stop the bleeding. Add observability. Migrate piece by piece. Keep what works. Replace what hurts.

If you’re sitting on a vibe-coded MVP that’s hitting real users and you’re not sure where to start, we do this work. The MVP rescue pods page covers the engagement shape. The calculator will tell you what a five-month rescue costs versus building net-new in-house.

Or just book a call. The triage conversation is free. We will tell you in 25 minutes whether the rescue is the work or whether you need something else entirely.

More like this, in your inbox.

One engineering teardown a week. Real pods, real code, no fluff. About 3 minutes a week.

You're in. First teardown lands Sunday.