How the pieces connect
There is no API server in the middle. The React client holds a Supabase client created with createClient(url, anonKey), and every supabase.from('table').select() call is a PostgREST request sent straight to Postgres over HTTPS. After signInWithPassword or an OAuth flow, Supabase Auth returns a JWT that the client library attaches as the Authorization: Bearer header on each request. Postgres reads the sub claim from that JWT and exposes it as auth.uid() inside the session. RLS policies you defined with CREATE POLICY then run on every row touched, so the database itself decides what the query returns. The anon key is public and safe in the bundle precisely because RLS, not the key, is the gate. Without an enabled policy, a table with RLS on returns zero rows rather than failing open.