What Actually Happens When You Export Code from Lovable and Bolt
Hitting "Export to GitHub" does not mean your B2B app is ready to deploy. Here is what you actually own.
What You Need to Know
When you export code from AI builders like Lovable or Bolt, you receive the frontend files, but the backend infrastructure often remains tied to the platform. Deploying independently requires manually migrating databases, securing exposed environment variables, and rewriting build scripts for external hosting.
At a Glance
- Code Portability
- High for frontend, Low for backend
- Lovable Export
- React/Vite frontend, tied to managed Supabase
- Bolt Export
- WebContainer setup, often breaks on Vercel/AWS
- Security Risk
- Exposed API keys and missing database rules
- Next Step
- Audit keys and migrate the database schema
Best For
- Founders moving AI-generated MVPs into production
- Operations managers looking to self-host internal tools
- B2B teams needing UK/AU data residency compliance
Not For
- ×Hobbyists building personal side projects
- ×Developers building enterprise architecture from scratch
- ×Users happy to keep their apps hosted on the builder platform
Key Takeaways
- Exporting from AI builders gives you frontend code, not full infrastructure ownership.
- Lovable apps require you to manually migrate the Supabase database to sever ties with the platform.
- Bolt exports often contain hardcoded paths that break when deployed to standard cloud servers.
- Always revoke and regenerate API keys after exporting AI code to prevent credential leaks.
- Database security policies must be rewritten by a human before handling live B2B data.
You spent the weekend in Lovable building a functional supplier portal. It handles the CSV uploads, the dashboard looks like a real product, and your internal team is actually using it to track inbound freight.
Now you want to put it on your own company subdomain, secure the data on a Sydney or London-based server to meet compliance rules, and stop relying on a consumer-grade AI builder to host your operations software. You click "Export to GitHub".
What happens next is where most non-technical B2B operators get stuck.
The assumption is that exporting your code means you now own a self-contained, ready-to-deploy software product. The reality is that AI builders are massive abstraction layers. They hide the ugly plumbing of software development so you can focus on the user interface. When you export the code, you strip away that abstraction layer, exposing a tangle of dependencies, hardcoded environment variables, and deeply coupled backend infrastructure.
Here is what you actually get when you eject from popular AI builders, what stays locked to the platform, and what you need to do to take real ownership of your B2B software.
The Illusion of the Clean Export
When you build custom software the traditional way, your engineering team sets up a repository, configures a database, and writes deployment scripts. You own the infrastructure from day one.
When you use an AI builder, the platform handles all of this in the background. To make the code run instantly in your browser, tools like Lovable, Bolt, and Base44 make aggressive assumptions about where the app lives, how it talks to the database, and how authentication is handled.
Exporting the code gives you the frontend files. It does not automatically untangle your application from the builder's shadow infrastructure.
Ejecting from Lovable: The Supabase Tether
Lovable is currently the dominant tool for generating functional business interfaces. When you export a Lovable project, you receive a relatively clean React and Vite frontend. As far as AI-generated code goes, it is surprisingly readable and well-structured.
However, Lovable is heavily coupled to Supabase (a popular backend-as-a-service). When you build an app in Lovable, it provisions a Supabase database on your behalf.
When you export your Lovable code to GitHub and deploy it to a hosting provider like Vercel or Netlify, the application will still point to that original Supabase instance.
To achieve true ownership, you cannot just export the frontend. You must physically migrate the database schema, the authentication configurations, and the database policies to a Supabase project that your company controls entirely. If you skip this step, you do not own your backend infrastructure. Worse, if you relied on the AI to write your database security rules, you are likely deploying an application with critical vulnerabilities.
As we noted when detailing the Supabase security flaw leaving your Lovable app wide open, default AI generations frequently leave Row Level Security (RLS) disabled, meaning anyone with the URL could theoretically read your entire database.
Ejecting from Bolt: The WebContainer Trap
Bolt (bolt.new) takes a different approach. It runs your application in a WebContainer—essentially a simulated server environment running directly inside your web browser.
This is brilliant for prototyping, but it creates immediate friction when you try to export the project. Because Bolt simulates a server in the browser, the file paths, the environment variables, and the build commands are often configured specifically for that browser environment.
When you download a full-stack Bolt project and try to run it on a standard Node.js server or a cloud provider, it routinely breaks. File paths to local databases fail. API connections drop.
More concerningly for B2B operators, Bolt prototypes frequently hardcode sensitive information directly into the frontend files to make the browser preview work. If you push this exported code straight to a public GitHub repository, you risk exposing your production credentials. We see this often enough that we wrote a dedicated guide on how your Bolt prototype is leaking live API keys during the export process.
Base44: The Opinionated Boilerplate
Base44 represents a different category. Rather than generating code dynamically in a chat interface, it provides a highly opinionated SaaS boilerplate.
You get all the code upfront. There is no "export" button because you start with the full repository.
The trade-off here is not platform lock-in, but architectural lock-in. Base44 chooses your database ORM (Prisma), your authentication provider, and your payment processor (usually Stripe). If those match your exact business requirements, you are in a strong position. But if you need to integrate a legacy Australian payment gateway or connect to an on-premise SQL server in the UK, you will spend more time ripping out the boilerplate's opinions than you would have spent writing the code from scratch.
Three Steps to Take True Ownership of Your Code
If you have used an AI builder to validate a B2B process—like a client onboarding flow or an inventory tracker—and you are ready to take it off the platform, do not just point a custom domain at the exported code.
You need to sever the ties to the builder's environment. Here is the exact process.
1. Audit and Cycle Your Environment Variables
Your application needs API keys to talk to databases, email providers, and third-party services. In a builder environment, these are often handled behind the scenes or injected dynamically.
When you export, you must strip all keys out of your codebase and place them securely in a .env file. Never commit this file to your code repository. Once the code is isolated, log into your providers (Supabase, Resend, Stripe) and generate fresh API keys, revoking the ones the AI builder used.
2. Disentangle the Database and Apply Security Policies
If your exported app connects to a database provisioned by the AI platform, you are still renting your infrastructure.
You need to export the database schema and migrate it to a host you control. Once migrated, you must manually write and test your database security policies. AI builders are notorious for writing lazy database rules just to make the prototype function. In a B2B context—where one client absolutely cannot see another client's quotes—relying on vibe-coded SaaS architecture without human intervention is a massive liability.
3. Rewrite the Deployment Pipeline
You will need to configure a hosting provider (like Vercel, AWS, or Railway) to build and serve your application. This usually requires rewriting the package.json build scripts so that a real server knows how to compile the code that was previously running in a simulated browser environment.
When Should You Keep It on the Platform?
Not every prototype needs to be ejected.
If you have built an internal tool that is only used by three staff members to format a weekly report, leaving it on Lovable or Bolt is perfectly fine. The platform subscription fee is cheaper than the engineering hours required to migrate and maintain custom hosting.
But you must eject and take ownership if:
- You handle sensitive client data: Relying on a third-party builder's default database configuration violates basic B2B compliance and data residency requirements.
- You need custom domains and branding: While some builders offer custom domains, you have zero control over the underlying server architecture, uptime, or CDN routing.
- You need to integrate with legacy systems: AI builders struggle to connect to closed corporate networks or legacy ERPs. You need control of the server to write custom middleware.
Hardening Before Deployment
Taking code out of an AI builder and putting it into a production environment is a critical transition point for any business. The code works, but it is fragile.
Before you attach a live domain to an exported AI project and invite your clients to use it, the codebase needs a structural review. The frontend components are usually salvageable, but the backend connections, database security, and API handling almost always require professional refactoring.
If you have a functional MVP exported from an AI builder, do not guess at the deployment configuration. Have an engineer review the repository, secure the endpoints, and configure the hosting properly. At Samvara, review and hardening of AI-generated B2B applications starts at £199.
It is a small price to pay to ensure your new software actually belongs to you, rather than remaining silently tethered to a shadow environment you do not control.
Quick Comparison
| Builder | Code Export Type | Database Coupling | Deployment Friction |
|---|---|---|---|
| Lovable | Clean React/Vite | Tied to managed Supabase | Medium (requires DB migration) |
| Bolt (bolt.new) | Full stack (WebContainer) | Memory-only or external DB | High (build script errors) |
| Base44 | Opinionated boilerplate | Standard SQL/Prisma | Low (but hard to customise) |
Frequently Asked Questions
Do I own the code generated by Lovable and Bolt?
Can I deploy a Lovable app straight to Vercel?
Why does my exported Bolt app fail to build?
How much does it cost to review and harden an exported AI app?
Bottom line
Do not deploy exported AI code directly to a production server without untangling the backend. You must migrate the database to your own account, cycle all API keys, and manually harden the security policies before connecting a custom business domain.
How Samvara researches this guide
We write for exhibition organisers and import/export operators in Australia, the UK, Europe, the US and India. Guides favour specific, verifiable operational advice over generic tips — grounded in systems we have shipped, client workflows, and current industry practice. We revisit articles as tooling and regulations change.
Written by
Shreyansh Doshi, Founder of Samvara
Shreyansh Doshi is the founder of Samvara Technologies, a product studio building operator software and SaaS products for exhibition, import/export, travel and fitness businesses in the UK and Australia. He writes about product delivery, operations systems, and where AI does and does not belong in a real workflow.
Keep Reading
More in Scope & Ship