Backend-as-a-Service (BaaS):

Row Level Security

// for client components, uses anon public key, RLS is always enforced

// for server components, can bypass rls, use own auth rule code

create policy "Users can read own profile"
on profiles
for select
using (auth.uid() = id);

Auth flow:

User logs in
   ↓
Supabase Auth
   ↓
JWT issued
   ↓
JWT sent with every request