Can two Lovable apps share one database? What the docs say and your realistic options
· 9 min read
Harbour & Hire is a made-up business, but you may know its type. It rents party equipment: marquees, trestle tables, a few hundred chairs. In the spring, the owner built a booking app with Lovable. Customers pick a date, choose items and pay a deposit. It worked well enough that she is now thinking about a second app, a stock and maintenance tracker for the warehouse team.
Then a small question appears. When a driver marks twelve chairs as damaged, should the booking app know?
The short answer to the technical question is yes. Two Lovable projects can share one database, but not in the way most people first expect. The more useful question is what sharing does to the rest of your setup, and whether it is the right way to connect two apps at all.
What Lovable supports
By default, a Lovable project uses the built-in backend, and every project on it gets its own isolated database. One project cannot read another’s. If you want several apps to use the same data, Lovable’s answer is to connect them to the same external Supabase project, which is a database service you hold your own account with.
Lovable confirms that this works and gives an example very close to our hire business: a customer app and an admin dashboard sharing one database. A few details in the same documentation matter more than the headline:
- Each Lovable project connects to one Supabase project at a time.
- Projects that share a Supabase project read and write the same data.
- They also overwrite each other’s secrets, including
LOVABLE_API_KEY, so any feature that uses that key stops working. - There is no automatic migration between the built-in backend and your own Supabase project, in either direction. Moving means recreating the schema and moving the data.
- Lovable shows a warning icon next to any Supabase project that another Lovable project already uses. You can still connect if the sharing is intentional.
That is the whole feature. It is a plumbing option, and it hands you the consequences. The rest of this article is about those.
The decision you may already have made
If the owner of Harbour & Hire built her booking app without choosing a backend, it is almost certainly on the built-in one, because that is the default. Lovable describes it as the fastest route to a working app and the option most projects never leave.
That creates the first awkward fact. To share a database, both apps must point at the same Supabase project, and her first app does not live in one. Because there is no automatic move, she would have to recreate the booking app’s data structure in Supabase and carry the bookings across by hand or with help. The earlier the app, the cheaper this is. With three months of real customer bookings, it is a small migration project.
So the first practical step is to find out where your existing app keeps its data. Then ask whether the second app really needs that data, or only some of it.
What actually changes when two apps share a database
Sharing sounds like one decision. In practice it is four, and each one is easy to overlook because you were never asked to make it for the first app.
Secrets get overwritten
A secret is a credential an app uses to talk to another service: to send an email, to take a payment, to call an AI model. When two Lovable projects share a Supabase project, they store those credentials in the same place, and the last one to write wins. Lovable names LOVABLE_API_KEY specifically. Anything that depends on it in the other project stops working.
For Harbour & Hire, the failure mode would look like this. The owner asks the second app to add a feature, and something in the booking app that worked on Friday quietly breaks on Monday. Nothing in the booking app changed. The cause sits in a different project, and unless you know about the overwriting, you will spend a long time looking in the wrong place.
The warning icon is a useful prompt, but it only helps if the person connecting the project understands what it means. Lovable’s documentation says anyone with edit access to a project can connect it to a linked Supabase project, so that person is not necessarily the owner.
Both apps can change the same records
The warehouse app marks twelve chairs as damaged. The booking app, which has its own idea of how many chairs exist, keeps accepting bookings for the full set. Nothing is wrong with either app. They are both reading and writing the same data, and each was built from a different description of what a chair is.
If one app records a quantity and the other records individual items with a condition, sharing the table does not reconcile them. Someone has to decide what counts as the single truth, and then make both apps respect it. Lovable’s advice is blunt: design your schema and access rules with the shared data in mind. That means designing the data once for both apps, ideally before building the second.
Permissions need to be thought through
Behind a Supabase database sit row-level security policies. In plain terms, these are rules inside the database that say which signed-in person can see or change which records. In a single app, they mostly protect customers from seeing each other’s bookings.
With two apps, the rules have to cover two kinds of people. A customer should see their own bookings and never the warehouse’s maintenance notes. A warehouse worker should see stock, and perhaps not deposits. If those rules are loose, the second app can expose something the first app was careful to hide. Sign-in settings also live in the Supabase dashboard rather than in either Lovable project, so there is a new place to look when someone cannot log in.
Later changes affect both apps
Lovable handles schema changes as reviewed migrations. It writes the change, shows it to you, asks for approval in the chat and then saves the migration file in that project’s code. That is a sensible safeguard for one app. With two, an approved change in one project reshapes a database the other depends on, and the record of that change sits only in the first project.
If the warehouse app renames a column or splits a table, the booking app can stop working without its own code having changed. This is the maintenance cost that does not show up on day one. Every future change to shared data now needs a moment of asking: who else reads this?
Four realistic options
None of these is wrong in every case. They differ in how much ongoing attention they ask of you.
Option 1: extend the first app instead
If the warehouse tracker is really a few more screens for the same business process, it may not need to be a separate app at all. Staff roles, stock and bookings would live in one project with one database. You lose some separation, since a mistake in one area can affect another. You gain a single schema and nothing to overwrite. For a business with one team and a modest number of users, this is often the least risky route.
Option 2: keep separate databases and share only what must move
Let each app own its data, and decide which handful of facts need to cross the gap, for instance a list of items and their availability. You then copy those facts one way, from the app that owns them to the one that needs them. The cost is that someone must keep that copy working and notice if it stops. The questions that come up here, such as which side is the source of truth and what happens if both are edited, are covered in our guide to sync patterns between business apps. The article uses a different example, but the reasoning carries over.
This option suits apps that mostly work independently and exchange a small amount of information.
Option 3: share one Supabase project, deliberately
This is the route Lovable documents. It is a good fit when the apps are two faces of the same data, such as the customer app and admin dashboard in Lovable’s own example. It asks more of you:
- Move or start the first app on Supabase, since the built-in backend cannot be shared.
- Create the Supabase account and pay for it separately. Billing and infrastructure such as backups and instance size become your responsibility rather than Lovable’s.
- Write down which app owns which tables, and who is allowed to approve changes to them.
- Test both apps after every change to the shared structure.
- Keep a note of which secrets each project depends on, given that they can overwrite each other.
If you have someone, in-house or a contractor, who is comfortable with databases, this can work well for years. If you do not, you are taking on a part-time job.
Option 4: start from a platform where sharing is built in
The three options above all try to connect tools that were designed to be separate. The alternative is to build the second app somewhere that assumes it will have neighbours.
That is what we are building Cosmos to do. In Cosmos, applications you describe in natural language live in a common workspace and are designed to share data, identity and workflows from the start. The booking app and the warehouse tracker would draw on the same list of items and the same set of people, rather than each keeping a copy or being wired together afterwards. Hosting, databases and sign-in are handled by the platform, so the questions about secrets, backends and migrations are not ones you have to answer before you can build.
There is a trade-off, and it is worth stating plainly. Moving existing work to a different platform costs time, and a mature, widely used tool has advantages a newer one has to earn. Cosmos is most useful when you know from the outset that you are building a set of connected applications. If your first app is a finished, stable tool and the second is a modest addition, Option 1 or 2 may serve you better.
A quick way to choose
A few questions will usually point to the right option:
- Does the second app need live access to the first app’s records, or only a few facts from them? A few facts points to Option 2. Live access points to 1, 3 or 4.
- Where does the first app keep its data? On the built-in backend, Option 3 means a migration. Count the cost honestly.
- Who will own the shared data structure? If the answer is nobody in particular, avoid Option 3.
- How often will the apps change? Frequent change multiplies the cost of every shared structure.
- Would a wrong number in one app cause real harm in the other? Overbooked equipment is annoying. A wrong payment amount is worse. The higher the stakes, the more you want a single source of truth with clear ownership.
The pattern in these questions is that the technical possibility is rarely the constraint. Lovable can share a database. What matters is whether anyone in your business is prepared to be accountable for what happens afterwards.
Before you build the second app
Spend an hour writing down three things. Which records both apps will touch. Which app is allowed to change each one. And who will be told when the structure of those records changes.
If you can answer all three comfortably, sharing a database is a reasonable choice. If you cannot, that is useful information too: it means the decision is about ownership and maintenance, and the choice of database is secondary.
Cosmos is in early access. Come build with us.