Supabase RLS 4-Tier RBAC Starter with Role Onboard

By (author)Syed Abdullah

Tech stack:
JS
TS
CSS

A reusable Supabase starter for multi-role apps with 4-tier RBAC (learner, instructor, vendor, admin). Includes server-side profile creation after sig...
read more
AI Contributions:5
Published At:October 20, 2026
Files Included:10 file(s)
Updated At:October 22, 2026

Read Me

. Create a free Supabase project (supabase.com) and copy your Project URL and anon key. 2. Run supabase/migrations/001_rbac_schema.sql in the Supabase SQL Editor. 3. Run supabase/migrations/002_auth_profile_trigger.sql next. 4. Copy lib/supabase/, modules/auth/, and types/database.ts into your Next.js (App Router) project. 5. Add @supabase/ssr and @supabase/supabase-js to package.json (npm install @supabase/ssr @supabase/supabase-js). 6. Create a .env file with NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY. 7. Mount SignUpForm, SignInForm, OnboardingWizard, and wrap protected pages with RouteGuard. 8. Sign up a test user → a profile row appears automatically in public.users. 9. Promote an admin: insert their auth user id into public.admins (INSERT INTO public.admins (user_id) VALUES ('...')).

Loading

Loading

Loading

More like this View all

Supabase TOTP 2FA for Next.js App Router

Drop-in 2FA for Next.js and Supabase: authenticator setup with a QR code, a code check at sign-in, and a guard that blocks pages, API routes and database rows until 2FA is done.

  • 0

    Ratings

  • 5

    Files

    • JS
    • TS
    • +2

    Tech stack

GitHub Repo Indexer: functions, calls and metrics

Point it at a public GitHub repo and get every Python, JavaScript and TypeScript function with exact line ranges, a call graph and simple metrics. Uses tree-sitter. No cloning, no code execution.

  • 0

    Ratings

  • 7

    Files

    • JS
    • TS
    • +2

    Tech stack

Unclaimed librarynext-enterprise

💼 An enterprise-grade Next.js boilerplate for high-performance, maintainable apps. Packed with features like Tailwind CSS, TypeScript, ESLint, Prettier, testing tools, and more to accelerate your development.

  • 0

    Ratings

  • 0

    Files

    • TS
    • JS
    • +2

    Tech stack