November 16, 2026 · Updated November 17, 2026 · 10 min read · Thomas Osayi
Your Lovable or Bolt app works locally. Here is what breaks at launch.
The five problems I see most often when founders bring me an AI-built app that is almost ready, and how to fix each one before real users arrive.
AI app builders are great at the first 80 percent. Most of the apps people send me look finished: the screens are there, the sign-up form works, the demo goes well. They fall over on the details that only matter once real users and real money show up.
The same five problems come up again and again: a database anyone can read, payments that never confirm, secrets that only exist on one laptop, duplicated code, and no error handling. None of them show in a preview window. Here is how each one happens, how to check your own app for it, and how to fix it.
Why does an AI-built app work in preview and break in production?
Because the preview only tests the happy path with one user, and production adds strangers, real payments and a different environment. A builder like Lovable or Bolt is judged on whether the screen you asked for appears. It is not judged on what happens when a second user signs up, when a card is declined, or when the app runs on a server that has never seen your laptop.
Three things change at launch:
- The environment. Preview URLs, test keys and local files are replaced by your own domain, live keys and the hosting provider's settings.
- The users. People you do not know will open the browser tools, refresh at the wrong moment and type things you did not expect.
- The stakes. A bug in a demo is embarrassing. A bug that exposes customer data or takes money without delivering anything is a liability.
The list of things that go wrong is short and predictable. The five sections below are in the order I check them.
Can anyone read my users' data?
Quite possibly, because the most common issue is a database with open security rules. The app checks if you are logged in, but the database does not check who you are. With Firebase and Supabase the browser talks to the database directly, and the project ID or URL and the public key sit in the page source by design. Anyone with them can ask for data. The rules are the only thing deciding whether they get it.
Firebase
Open Firestore Database, then Rules, in the Firebase console. If you see allow read, write: if true, the database is open to the world. If the rule only checks request.auth != null, every signed-in user can read every other user's records. A correct rule compares request.auth.uid to an owner field on the document, such as userId, and you need one for every collection.
Supabase
Open the Table Editor and look for tables marked with row level security disabled. With RLS off, the anon key in your front end can select every row. Turn RLS on for each table and add policies such as auth.uid() = user_id for select, insert, update and delete. Never put the service role key in front-end code, because it bypasses every policy.
How to test it
Create two accounts. Sign in as the second and try to load a record that belongs to the first by changing an ID in the URL or the request. If it loads, the rules are open.
Apps with more than one kind of user need rules that understand roles as well as ownership. Guardian MindCare, a therapy practice platform I built, has five user roles, and each one sees only what it should. That kind of separation has to live in the rules, because hiding a button in the interface protects nothing.

Why does Stripe charge the card but nothing changes in the app?
Because the webhook was never set up, or it points at localhost. Stripe Checkout runs on Stripe's servers. After the payment, Stripe tells your app about it by sending an event to a URL you registered. If there is no URL, or the URL is a preview address, the card is charged and your database never hears about it.
What a working setup looks like
- An endpoint in your app, for example /api/webhooks/stripe, that accepts POST requests.
- That endpoint registered in the Stripe dashboard under Developers, then Webhooks, using your production domain.
- The signing secret, which starts with whsec_, saved as an environment variable on the host, and a handler that verifies every event with stripe.webhooks.constructEvent before trusting it.
- Handling for checkout.session.completed at minimum. Subscriptions also need customer.subscription.updated, customer.subscription.deleted and invoice.payment_failed.
- A database write that updates the user's plan, matched by the Stripe customer ID or a user ID you passed in the session metadata.
The mistakes I see most
Verification fails with "No signatures found matching the expected signature for payload" when the framework has already parsed the body as JSON. The handler needs the raw request body. The other classic is test mode against live mode. They have separate keys, separate webhook endpoints and separate signing secrets, so a setup that worked with test cards does nothing after you switch to live keys.
Why does the build pass locally and fail on Vercel?
Usually because the keys live in a local file that never reaches the host. A .env or .env.local file is kept out of git on purpose, so when Vercel builds from your repository those values do not exist. The build fails, or it succeeds and the app crashes on the first request with an error like "supabaseUrl is required".
The fix has three parts:
- Copy every variable into the host. On Vercel that is Settings, then Environment Variables, for both Production and Preview. Redeploy afterwards, because new values do not apply to a build that has already run.
- Check the prefixes. In Next.js only variables that start with NEXT_PUBLIC_ reach the browser. In Vite, which many Lovable and Bolt projects use, the prefix is VITE_. Anything with those prefixes is public. A Stripe secret key, a Supabase service role key or an OpenAI key must never carry one.
- Update the settings that still point at the preview. In Supabase, set Site URL and Redirect URLs under Authentication, then URL Configuration. In Firebase, add your domain under Authentication, Settings, Authorized domains. Otherwise login emails send users to a preview address, or sign-in fails with auth/unauthorized-domain.
Some failures only appear on deploy because the production build is stricter. It runs the TypeScript compiler, so a "Type error" the dev server let slide now stops the deploy.
If a secret was ever committed or shipped to the browser, rotate it. Deleting it from the code does not remove it from git history.
Why does every new change break something else?
Because each prompt adds a new version of the same thing instead of editing the old one. After a few weeks there are three pricing cards, two auth hooks and four copies of the function that formats a date. You ask for a fix, the tool updates one copy, and the screen you are looking at uses another.
Signs of it in the repository:
- Files named Dashboard, DashboardNew and DashboardV2.
- The same data request written out in several components, each with slightly different handling.
- Types set to any, or the same type declared in five files.
- Pages and components that nothing links to any more.
The fix is unglamorous: consolidate to one component per job so the next change happens in one place. I search for duplicates, find the version the live screens actually use, delete the rest, and move database access into one module.
This is also where prompting again makes things worse. Asking the tool to clean up a project in this state often produces one more parallel version. Cleanup needs someone to read what is there and decide what to keep.
What happens when a request fails?
In most AI-built apps, the page goes blank. The generated code assumes every request succeeds. When an API call fails, a list comes back empty or a session has expired, a component tries to read a property of undefined and React takes down the whole screen. The user sees white and you hear nothing.
Every request needs three states: loading, success and error. On top of that:
- An error boundary around each route, which in the Next.js App Router is an error.tsx file, so one broken component shows a message and a retry button instead of an empty page.
- A check on what the server returned before using it. Supabase calls return an error object instead of throwing, so an unchecked call fails silently.
- Validation of user input on the server, not only in the form.
- Logging. The host's runtime logs are the minimum. An error tracker such as Sentry shows which page failed and how often.
What does a pre-launch check look like in practice?
It is a fixed sequence that starts with what can hurt users and ends with polish. When someone hands me a repository, this is the order I work in:
- Clone it and run a production build, not the dev server. The errors that will stop the deploy show up here.
- Read the database rules or RLS policies and run the two-account test.
- Search the code and the built bundle for secret keys.
- Trace one payment end to end in Stripe test mode: checkout, webhook, database write, the user's screen updating.
- Set the production environment variables, auth redirect URLs and domain, then deploy.
- Sign up as a brand new user on a phone, on the live URL, and go through the main workflow.
- Turn the network off and feed the forms bad input to find blank screens.
- Write down what was wrong and what changed.
Picture a subscription app built in Lovable with Supabase and Stripe. A typical set of findings would be two tables with RLS disabled, a checkout with no webhook behind it, a Site URL still set to localhost:3000, and a paid feature unlocked by the redirect to the success page. That is four fixes, none of them large, and they are the difference between a demo and a product people can safely pay for.
How much does it cost and how long does it take?
Less than most founders expect, because the problems are specific. My pricing for this work is fixed:
- Quick Fix, from $60, 2 days: one bug or error fixed and explained. A failing build or a broken login redirect fits here.
- Fix Plus Features, from $200, 5 days: several fixes plus a feature or integration added, for example locking down the database and wiring up Stripe webhooks.
- Finish and Launch, from $600, 10 days: taking the app from stuck to live in production, deployed to Vercel with a custom domain.
What moves a project between tiers is the number of problems and the state of the code, not the tool that produced it. Every project ends with a short write-up of what was wrong and what changed.
I keep what works and fix what does not. A rewrite only comes up if it is truly cheaper for you than repairing what is there.
When should you stop prompting and hire help?
When the same error has come back three times, or when the problem is one you cannot see from the screen. AI builders are good at producing new screens and weak at reasoning about a whole system. Security rules, webhooks and environment settings also live partly outside the code, in dashboards the tool cannot open.
Good moments to bring in a developer:
- Before you take the first real payment.
- Before you store anything sensitive about other people.
- When each fix breaks something that used to work.
- When the deploy fails and the error message means nothing to you.
To make a handoff fast, put the code in a GitHub repository, give access to the database and hosting projects, and list what works and what is broken. That is enough for me to start.
The bottom line
A Lovable or Bolt app that works locally is close, not finished. Check the database rules, the Stripe webhook, the environment variables, the duplicated code and the error states, in that order, before real users arrive. Each one is fixable in a few hours by someone who reads the code directly. If you are stuck on any of these, I fix and launch AI-built apps as a fixed-price service.
Questions, answered in one line
Why does my Lovable app work in preview but not in production?
Usually because redirect URLs, environment variables or webhooks still point at the preview environment. Production needs its own values set in the host and in Supabase or Firebase.
Is my AI-built app secure?
Not by default. Check that database rules or row level security tie every record to its owner, and that no secret keys are shipped to the browser.
How much does it cost to fix an AI-built app?
Thomas Osayi fixes single bugs from $60, several fixes plus a feature from $200, and takes a stuck app to launch from $600.
How do I know if my Firebase or Supabase database is open?
Create two accounts and try to load the first account's records while signed in as the second. If they load, your Firebase security rules or Supabase row level security policies are not tying records to their owner.
Why is my Stripe webhook not firing in production?
Usually the endpoint was never registered in the Stripe dashboard for the live domain, or the live signing secret is missing from the host. Test mode and live mode have separate keys, endpoints and secrets.
Should I rebuild my AI-built app from scratch?
Usually not. Most stuck AI-built apps have a short list of specific problems, and fixing those costs less than a rewrite.
Sources
- Get started with Cloud Firestore Security Rules Firebase
- Row Level Security Supabase Docs
- Receive Stripe events in your webhook endpoint Stripe Docs
- Environment variables Vercel Docs
Related articles
- Supabase auth redirect URL not working? Fix localhost, preview and production redirects
- Environment variables undefined on Vercel? Every cause and fix
- How to fix a CORS error on a Next.js API route
- Firestore "Missing or insufficient permissions": what triggers it and how to fix it
Fix, finish and launch your AI-built app
Built your app with Lovable, Bolt, v0, Replit or Cursor and got stuck? I fix the bugs, connect auth and payments, clean up the code and deploy it to production.
See the service