All articles

Does your AI-built app need a backend?

By Magdalena Furman, 7 minute read

Many apps built with Lovable, Bolt or Cursor have no backend of their own. The screens in the browser talk straight to Supabase. People ask me whether that is wrong. The short answer is no, not by itself. But it moves where your security lives, and that is exactly where these apps tend to go wrong.

What "no backend" means here

Supabase gives every project a ready-made API to the database, and a public key that the browser uses to call it. That is how Supabase is designed to be used. Your app's code runs in the browser, and the browser asks Supabase for data directly.

The catch is that anyone can open the browser's developer tools, see those requests, copy them, and send the same request with different values. Whatever your screens allow, the API allows more. The screen is a suggestion. It is not a rule.

Why AI tools build it this way

  • It is the path in Supabase's own quickstart, so it is what the tools have seen most.
  • It is the shortest route to a working app. There is no server to write, host or secure.
  • AI tools are good at screens, and weaker at the checks that belong on a server, which are harder to see working.

The result is an app that looks finished and demos well. The gap is invisible until someone looks for it.

What changes when there is no backend

The database rules are your whole security model. In Supabase these are called row level security. They decide who can read and change each row. If a table has no rules, or a rule is too loose, a visitor can read or change that data without logging in, whatever the screens show.

The browser cannot keep a secret. Anything that needs a private key has to run somewhere else. That means payments, sending email, and calls to an AI model that costs money per request.

The browser cannot enforce a limit. A price, a role, a quota or a rate limit that is checked only in the browser can be skipped by someone who calls the API directly.

Your data model is visible. Table and column names are in the requests. That is not a problem on its own, but it tells an attacker exactly what to try.

When it is fine

A direct connection from the browser to Supabase is a reasonable choice when:

  • each user only reads and edits their own rows,
  • the database rules are tight, and you tested them with a second account,
  • there are no payments, no paid AI calls and no admin actions,
  • nothing needs to be hidden or calculated before it reaches the user.

Plenty of small tools, internal dashboards and simple apps fit that description.

When you need a server layer

Add a small backend, such as Supabase edge functions or a thin API, when the app has any of these:

  • Payments and webhooks. The server must verify the request really came from the payment provider, and it must hold the secret key.
  • Calls to an AI model. They cost money, so they need a key the browser cannot see and a limit per user.
  • Admin actions. "Only an admin may do this" must be checked where the user cannot change it.
  • Steps that must succeed or fail together, such as creating an order and reducing the stock.
  • Rate limits and abuse protection.
  • Data that needs to be changed or hidden before a user sees it.

You do not need to move everything. Keep it thin. Move only what has to be trusted.

One test that tells you most of what you need

Ask this question: what can someone do by calling the API directly that my screens do not offer?

You can try it on your own project in a few minutes:

  • Create two accounts. Log in as the first, and open the browser's network tab while you use the app.
  • Copy a request that reads or changes data, and change an ID to one that belongs to the second account. If it works, anyone can do it.
  • Try to change a field the screen never shows, such as a role, a price or an owner.
  • Check what a logged-out visitor can read. Replace the placeholders with your own project address and public key, and run this against your own project only:
curl 'https://YOUR-PROJECT.supabase.co/rest/v1/orders?select=*' \
  -H 'apikey: YOUR_PUBLIC_KEY' \
  -H 'Authorization: Bearer YOUR_PUBLIC_KEY'

If it returns rows without anyone logging in, that table is open. Do it for every table your app uses.

A simple rule for where code belongs

If the code would cause harm when the user changed it, it belongs on the server or in the database rules, not in the browser. Showing a button belongs in the browser. Deciding who may press it does not.

What I see in audits

The problems are rarely in the screens. In one audit, four database functions could be run by anyone with the public key, because nobody had checked who was allowed to call them. See the security example report. In another, a read quietly stopped at 1,000 rows and truncated an export, which the scalability example report shows.

For the full pre-launch checklist, see how to audit a Lovable or Cursor app before launch.

Want someone to run this test for you

If your app runs on Supabase, I check exactly this: the database rules, the functions, the storage and the secrets, and I write down a fix for every finding. See the Supabase security audit, or try the free skill on your own project. Prices are in the pricing section.

Need a senior engineer to review your AI-built system?

I review the architecture, security and infrastructure of AI-built products and tell you what to fix before launch or before you scale.

Want to run these checks on your own project?