0

Where did the backend go?

Modelused in ~100% of apps

You have built the classic three-box app before: a browser, a backend server you wrote, and a database behind it. Supabase deletes the middle box — and the first time you see it, letting a browser run `select` against your database feels like leaving the front door open. It is not, and understanding exactly why is the single mental model the rest of this course is built on.

Core idea. In a traditional stack the API server is the bouncer: it holds the only database credentials, and every rule about who-may-see-what lives in its code. Supabase removes that server. The browser talks to an auto-generated HTTP API sitting directly in front of Postgres, and the DATABASE becomes the bouncer — Postgres itself checks every single row against Row Level Security (RLS) policies you write before it returns anything.
Playground, this isn't a screenshot
await supabase.from('posts').select()
1 / 6
supabase-js

Your call becomes an HTTP request. It carries the publishable key in the `apikey` header, and — if someone is signed in — their JWT in `Authorization: Bearer`. The publishable key is safe here: it grants no privilege on its own.

"Letting the browser query the database directly" sounds reckless until you see stop 5. The browser never gets raw database access — it gets a constrained HTTP API, running as a low-privilege role, and Postgres filters every row through your policies before answering.

↑ play a little first, then dig in