This repository contains the code for implementing authentication in Next.js 15 using Supabase. Follow along with the tutorial to learn how to add secure authentication to your Next.js applications.
Watch the step-by-step tutorial on YouTube: Build a Modern Auth System in 20 Minutes with NextJS 15 and Supabase
-
Create a Supabase project
- Sign up for a Supabase account
- Create a new project
- Go to Project Settings -> API to find your credentials
-
Set up environment variables Create a
.env.localfile in the root directory with the following variables:NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
-
Clone the repository:
git clone https://github.com/Kirsanow/nextjs15-auth-tutorial.git
-
Install dependencies:
npm install # or yarn install # or pnpm install
-
Run the development server:
npm run dev # or yarn dev # or pnpm dev
Open http://localhost:3000 with your browser to see the result.
- Next.js 15
- Supabase for authentication and database
- TypeScript
- Tailwind CSS
- Setting up Supabase in a Next.js project
- Implementing authentication flows
- Protected routes and middleware
- Managing user sessions
- TypeScript integration
- Best practices for auth in Next.js
- Email/Password authentication
- OAuth providers (Google, GitHub)
- Protected routes
- Middleware implementation
- Type-safe authentication
- Server and client components integration
If you found this tutorial helpful, please consider:
- Subscribing to my YouTube channel
- Following me on X(Twitter)
- Starring this repository
This project is MIT licensed.