Better Auth Full Tutorial with Next.js, Prisma ORM, PostgreSQL, Nodemailer

Опубликовано: 24 Май 2026
на канале: GiraffeReactor
43,689
1.2k

Connect with me on LinkedIn:   / khurram-ali1  
☕ Buy Me A Coffee ➜ https://www.buymeacoffee.com/giraffer...
Github Repo:https://github.com/giraffereactor/ref...
(repo includes all parts as branches)

Welcome to a tutorial on building an authentication system using Better Auth with Next.js, Prisma ORM, and PostgreSQL. In this 5+ hour video, we cover everything from client-side user authentication to server-side credentials management.

Technologies Covered (all 100% free services):
🚀 Next.js + TypeScript
💨 Tailwind + shadcn/ui
🔒 Better Auth
📚 Prisma ORM
🗄️ NeonDB + PostgreSQL
📩 Nodemailer

🚀 Tutorial Highlights:
User Authentication in Client & Server Components
Integrating Google & GitHub OAuth Providers
Custom Errors Handling and Middleware Implementation
Implementing User Roles & Admin Dashboard
Advanced Features: Email Verification & Password Reset (with nodemailer)

🕓 Timestamps:
00:00:00 - Introduction
00:01:51 - Demo
00:03:54 - PART 0: Setup Next.js application with TypeScript, Tailwind CSS, shadcn/ui
00:07:48 - PART 1: Email and Password Authentication (CLIENT SIDE)
00:11:17 - Setup PostgreSQL with ‪@neondatabase‬ and Prisma ORM
00:32:23 - Sign Up with Email & Password Authentication
00:49:15 - Sign Out
00:52:58 - Sign In
00:56:28 - PART 2: Email and Password Authentication (SERVER SIDE)
01:10:03 - Change database primary key type
01:13:16 - Change password hashing algorithm
01:19:09 - Server side Sign Up and Sign In
01:34:53 - nextCookies() plugin
01:36:41 - PART 3: Client Side Session, Middleware, Hooks
01:45:00 - Middleware
01:52:04 - Error Handling
01:57:33 - Hooks
02:09:16 - PART 4: Roles (USER, ADMIN), Admin Panel, Database Hooks
02:13:57 - Infer additional types on the user
02:21:03 - Admin Panel
02:42:20 - Database Hooks
02:47:22 - Admin Plugin
03:15:15 - PART 5: Google and GitHub Authentication
03:22:35 - Google OAuth
03:34:17 - GitHub OAuth
03:38:08 - Account Linking
03:46:14 - PART 6: Email Verification, Forgot Password, Reset Password
03:47:26 - Setup Nodemailer
03:57:54 - Email Verification
04:31:16 - Forgot / Reset Password
04:47:29 - PART 7: Update User, Custom Session, Magic Link, Cookie Caching
04:48:30 - Update User, Change Password
05:10:37 - Custom Session
05:18:55 - Magic Link Authentication
05:34:45 - Cookie Caching
05:36:06 - Thank You

🔗 References:
Better Auth Docs: https://www.better-auth.com/docs/intr...

Thank you ‪@neondatabase‬ the creator account!

Check out my Poetry Book: https://a.co/d/54CDa0u

#betterauth #nextjs #TypeScript #TailwindCSS #shadcnui #prismaorm #NeonDB #PostgreSQL #GoogleOAuth #GitHubOAuth #SessionManagement #AdminDashboard #EmailVerification #PasswordReset #nodemailer