During our 3rd semester web development capstone project, our group built a collaborative peer code-review platform using Next.js 16 App Router and Supabase. While the initial setup looks plug-and-play in documentation, managing auth tokens across Server Components, Route Handlers, and Client Components caused us several late-night debugging headaches before mentors helped us untangle the architecture.
The biggest pitfall freshers make is using the standard createClient from @supabase/supabase-js in Server Components instead of @supabase/ssr. If you don't forward cookies properly via cookieStore, your Server Components render unauthenticated state while client-side fetches show user sessions, causing hydration mismatches and broken redirects. Another classic mistake is relying on auth.uid() in RLS policies without understanding security definer vs invoker in Postgres views.
Our mentor spent an hour reviewing our database schema and showed us how to write robust row-level security (RLS) policies that enforce role-based access for students and reviewers directly at the database engine level. We also configured Supabase Realtime via PostgreSQL CDC for instant notification toasts when comments get submitted. Building real full-stack production apps with genuine security boundaries taught us more about modern web architecture than any theoretical web technologies textbook ever could. Always check network tab cookie headers when auth fails!
Edited