Rebuild platforms

What breaks first in a vibe-coded app

The failures that show up first when an app built with Lovable, Cursor or Bolt meets real users, and a checklist to run on your own app.

Access rules fail first

The first failure is silent. A user can read data that belongs to someone else, and nothing on screen tells you.

Many of these apps sit on a hosted database such as Supabase, and the browser talks to it directly. That design is fine when every table has row level security switched on, with a policy that says who can read each row. Generated code often skips the policy or writes one that allows everything. The app works either way while you are the only user, so nobody notices.

A correct policy is short. This one lets a signed-in user read only their own orders.

alter table orders enable row level security;

create policy "Users read their own orders"
on orders for select
using (auth.uid() = user_id);

To test it, create two accounts. Log in as the second and try to open a record the first one created by changing the ID in the URL. Then send the same request to the API with the second user's token. If either one returns the record, stop adding features and fix this.

Secrets end up in the browser

Anything you ship to the browser is public. Open your site, open the developer tools and search the loaded JavaScript for sk_live and service_role.

A Stripe publishable key or a Supabase anon key belongs in the browser. A Stripe secret key, an OpenAI key or a Supabase service role key does not. If you find one, rotate it today, then move the call that uses it into a server function. Deleting the key from the code does not help on its own, because it survives in old builds and in your git history.

Payments work until something goes wrong

Generated checkout code usually handles one path. The customer pays, Stripe redirects them to a success page, and the success page marks the order as paid.

That breaks when the customer closes the tab before the redirect. They have paid and your database says they have not. It breaks the other way too. If the success page alone marks the order paid, anyone who works out its URL may get the product without paying.

Stripe sends a webhook for each payment event, and the webhook is the record to trust. Your server should verify the webhook signature, then update the order when checkout.session.completed arrives. If you sell subscriptions, handle failed renewals and cancellations the same way. Stripe can deliver the same event more than once, so the handler has to produce the same result on the second delivery.

Errors vanish and nothing checks the code

Generated code tends to assume every request succeeds. When one fails, the user sees a blank screen or a spinner that never stops, and you hear nothing. Add an error tracker such as Sentry before you build anything else. Reading real errors beats guessing at them.

Tests are the other gap. Without them, each new prompt can break something that worked yesterday, and a customer finds it before you do. You do not need full coverage. Write automated tests for the flows that cost money when they break, which for most products means sign up, log in, pay, and the one action the product exists for.

Slow queries arrive last

Speed problems wait until the tables hold real data. The usual causes are a missing index on a column you filter by and a page that loads every row, then filters in the browser. A list that runs one query per item is the other common one. None of these show with a handful of rows, which is why the demo felt fast.

A checklist to run on your own app

  • Log in as a second user and try to read the first user's data, in the app and through the API.
  • Confirm row level security is on for every table, and read each policy.
  • Search the browser bundle for secret keys. Rotate any you find.
  • Make a test payment and close the tab straight after paying. Check the order still shows as paid.
  • Check that your server verifies Stripe webhook signatures.
  • Turn off your wifi halfway through an action and look at what the user sees.
  • Trigger an error on purpose and confirm the tracker reports it to you.
  • Run the core flows as automated tests before each deploy.
  • Fill a list page with a few thousand rows of test data and time how long it takes to load.

What to do with the results

Many vibe-coded apps do not need a rebuild. If the checklist turns up a few problems and the data model makes sense, fix those in the existing code and keep going. Any competent developer can do that, and it is the cheaper route.

If most items fail and nobody can explain how the code works, patching costs more than starting from a clean base and carrying the data across. That second case is what our rebuild service is for, and we do it without taking the app offline.

Bottom line: The tools got you a working demo, which is what they are for. Before you spend on marketing, run the two-account test and the closed-tab payment test, because those two failures cost you users and money first.

If you run the checklist and want a second opinion on what it found, send us the results.

Vibe codingRebuildsSecurity

Related service

Rebuild platforms. We rebuild old platforms that customers struggle with, and AI-built prototypes from Lovable, Cursor or Bolt that crack under real use. The new system grows beside the old one, with tested payments, checked data and a rollback ready, so you never switch off.

See the service→