Next.js + Supabase + TypeScript starter with built-in authentication, RBAC, protected routes, admin panel.
- 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.jsonand 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
-
Rename
.env.exampleto.env.localand 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_URLandNEXT_PUBLIC_SUPABASE_ANON_KEYcan be found in your Supabase project's API settings -
You can now run the Next.js local development server:
npm run dev
The template app should now be running on localhost:3000.
In the dashboard, navigate to Authentication > Hooks and select the appropriate function type (SQL or HTTP) from the dropdown menu.
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.