0
Challenge · 01Setup, the Mental Model & Your First Secure App
The request journey
Modelused in ~95% of apps
Concept 0 convinced you the database is the bouncer. But open your browser's Network tab while your app runs and you will not see "Postgres" anywhere — you will see an ordinary-looking HTTP request to a URL that mentions none of this. If you cannot read that request and the response that comes back, the mental model you just built is theory, not a skill you can debug with at 2am.
Core idea. A supabase-js call is not a special protocol. It compiles down to one plain HTTP request — a method, a path, a querystring that encodes your filters, and a couple of identifying headers — sent to a single gateway address, and one ordinary HTTP response with a status code and a JSON body. There is exactly one exception: the moment you subscribe to Realtime, that request stops being a request/response at all and becomes a long-lived, two-way connection.
poke it, drag it,
try to break it
try to break it
no slides here.
you drive.
you drive.
Playground, this isn't a screenshot
you write
supabase.from('posts')
.select('id,title')
.eq('is_public', true) goes over the wire
GET /rest/v1/posts?select=id,title&is_public=eq.true
apikey: sb_publishable_...
Authorization: Bearer <jwt, if signed in>
comes back
HTTP/1.1 200 OK
[{ "id": 1, "title": "Why I switched to Postgres" },
{ "id": 3, "title": "Ships on Fridays" }]Every method call in the chain writes one piece of the URL. `.select('id,title')` becomes `?select=id,title`. `.eq('is_public', true)` becomes `&is_public=eq.true` — the `eq.` prefix IS the operator; that querystring dialect is PostgREST's, not JavaScript's. There is no request body on a GET at all.
↑ play a little first, then dig in