Skip to content

a-barzanti/SupabaseAuthKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MIT License PRs Welcome Built with pnpm

SupabaseAuthKit

Next.js + Supabase + TypeScript starter with built-in authentication, RBAC, protected routes, admin panel.

🚀 Features

  • Next.js 15 (App Router)
  • TypeScript-first
  • Supabase Auth (email/password login, OAuth ready)
  • Role-based access control (via RLS)
  • Styling with Tailwind CSS
  • Components with shadcn/ui. This template comes with the default shadcn/ui style initialized. If you instead want other ui.shadcn styles, delete components.json and re-install shadcn/ui
  • SSR-compatible (via @supabase/ssr)
  • Password-based authentication block installed via the Supabase UI Library
  • Protected routes & middleware
  • Admin panel (assign user roles)
  • JWT-based API access

📦 Quick Start

  1. Rename .env.example to .env.local and update the following:

    NEXT_PUBLIC_SUPABASE_URL=[INSERT SUPABASE PROJECT URL]
    NEXT_PUBLIC_SUPABASE_ANON_KEY=[INSERT SUPABASE PROJECT API ANON KEY]
    

    Both NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY can be found in your Supabase project's API settings

  2. You can now run the Next.js local development server:

    npm run dev

    The template app should now be running on localhost:3000.

Enable Auth hook

In the dashboard, navigate to Authentication > Hooks and select the appropriate function type (SQL or HTTP) from the dropdown menu.

🔐 Security Considerations

For improved security and to ensure timely invalidation of user sessions upon role changes (demotion or promotion), it is recommended to set the JWT expiration time to 10-15 minutes. This can be configured in your Supabase project settings.

About

Next.js + Supabase + TypeScript starter with built-in Auth, RBAC, admin panel, protected routes.

Topics

Resources

License

Contributing

Stars

Watchers

Forks