The short answer
When an app built with Lovable, Bolt, Replit, Cursor or v0 starts failing under real users, the first instinct is often “let’s build it properly this time”. Sometimes that is right. More often the product is sound and the problems sit in a few invisible layers: access rules, payment handling, backups, monitoring. Those can be fixed without throwing away what already works — the screens, the flows customers have learned, the data they have entered.
The reliable way to decide is an audit that looks at specific criteria. Below are the four we use, what each looks like in a rescuable app and in one that needs a new core, and the order in which a rescue should run.
What a rewrite really costs
The price of a rewrite is not just the invoice. It is easy to underestimate the rest.
- Frozen product. While the new version is built, the old one gets only emergency fixes. Competitors and customers do not wait.
- Rediscovered edge cases. The current app, however messy, encodes months of small decisions: discounts, refunds, odd customer requests. A rewrite has to find them all again, usually through bugs.
- Data migration. Customers, orders and payments have to move to the new structure without loss, and be verified.
- Two systems at once. For a while you run, pay for and support both.
- New bugs. Fresh code has not met real users yet. The old bugs are gone; the new ones have not been found.
None of this means never rewrite. It means a rewrite has to beat these costs, and that only happens when the foundation itself is wrong.
Four criteria that decide it
user_id or team_id). Rewrite if the same data sits in five places, key information is stuffed into free-form JSON, and nothing says which user a row belongs to — then access rules cannot even be written reliably.Two things often look like rewrite signals but are not. “The code is ugly” is a matter for refactoring, module by module, once tests exist. “The AI keeps breaking things when we ask for changes” usually points to missing tests and review, not to a broken foundation.
The usual answer: rescue in parts
Between “patch everything” and “start over” there is a third path that fits most projects. Keep the interface and the parts that work, put tests around them, and replace the dangerous modules one at a time behind the same screens. Users see the same app getting more reliable; you never have a months-long gap without releases.
An ordered rescue plan
The order follows the damage, not the difficulty. The same first steps apply even if the final decision is a rewrite, because the current app keeps serving customers while the new one is built.
- 01
Inventory and access
List every account: repository, database, hosting, domain, payment provider, app stores, the AI builder, email and AI APIs. Move each into the company’s name. Nothing else is safe until this is done.
- 02
Close data exposure
Enable RLS with correct policies, move secret keys off the client and rotate any that leaked. Our Supabase RLS checklist shows what to look at.
- 03
Fix how money is confirmed
Orders become paid only on server-side confirmation from the provider; duplicates are ignored; a daily reconciliation compares your orders with the provider’s records. Details in our article on payment idempotency.
- 04
Backups you have restored
Daily backups in separate storage and one real test restore. On Supabase, daily backups come with paid plans; on the Free plan, Supabase recommends exporting your data regularly yourself.
- 05
Monitoring and alerts
Uptime checks, error tracking and alerts on failed payments, so you hear about problems before customers do.
- 06
Tests on critical flows
Sign-up, sign-in, checkout and your core action, run automatically before every release — including releases made with AI help.
- 07
Refactor or replace the worst modules
Now, with a safety net in place, clean up or rewrite the parts that cause the most incidents, one at a time.
- 08
Documentation and handover
Where everything lives, how to deploy, how to restore. So the product no longer depends on any single person, us included.
What it costs with us
Our project rescue has three tiers. At 2026 prices: Diagnosis — a 5-day audit of code and access with a written plan — costs $1,500–3,500 and takes a week. Stabilization — critical bugs, vulnerabilities and monitoring — costs $6,000–15,000, about four weeks. Relaunch — refactoring, automated tests and new features — costs $15,000–50,000, about ten weeks. Our engineers work from Tashkent; every other range is on the pricing page.
The diagnosis report ends with a recommendation: rescue, rescue in parts, or rewrite the core, with the reasoning and the price of each option. It is yours to take to any team. If you are comparing offers, our guide on hiring someone to fix an AI-built app covers what a good proposal contains, and what to check first in a vibe-coded app gives a 15-minute self-check.
Frequently asked questions
Is it cheaper to rewrite an AI-built app from scratch?
Usually not. A rewrite looks cheaper because the old problems disappear, but it brings a feature freeze, data migration, rediscovered edge cases and new bugs. It pays off when the data model is incoherent or you cannot access your own code and accounts.
Our app has no tests. Does that mean a rewrite?
No. Many AI-built apps start without tests. The fix is to add tests around the critical flows first and then change the code under their protection.
Can we keep using Lovable, Bolt or Cursor after a rescue?
Often yes, as long as the code lives in your repository and changes go through tests and an engineer’s review before release. The tools are good at speed; the review covers what they do not see.
How long does a rescue take?
With us, the diagnosis takes a week, stabilization about four weeks, and a relaunch with refactoring and new features about ten weeks. The diagnosis tells you which of these you actually need.
What if the builder will not let us export the code?
Then the live app becomes the specification: its screens, flows and data define what the new version must do. Customer data is exported and migrated with verification, so users keep their history.
Sources
Every claim here can be checked: below are the primary sources, not a retelling.
- 01Lovable docs: GitHub integration — Two-way sync with GitHub, export to deploy outside Lovable, code download on paid plans
- 02Supabase docs: Database backups — Daily backups on Pro, Team and Enterprise; Free plan projects advised to export data regularly
- 03Supabase docs: Row Level Security — Policies depend on rows having an owner column such as user_id
These articles are written by engineers working on the projects and published under the desk’s name. The studio and the desk’s published rules stand behind every text, not a single author; articles about our own open-source code carry the author’s name.
How we write and what we verify