Supabase Authentication & Database
Prerequisites
Before using Supabase authentication and database features, please ensure you have completed the following prerequisites:
We also recommend reading through Supabase's documentation on integrating Auth in Next.js, which will greatly help you understand how to use Supabase Auth:
Architecture Overview
lib/supabase/
├── client.ts # Browser-side Client
├── server.ts # Server-side Client
├── middleware.ts # Middleware authentication and access control
├── isAdmin.ts # Admin permission check
└── types.ts # Database type definitions
components/providers/
└─── AuthProvider.tsx # Authentication state management
actions/
├── users/ # User-related database operations
├── blogs/ # Blog-related database operations
└── .../ # Other database operations
app/auth/
├── callback/ # OAuth callback handling
└── confirm/ # Email confirmation handling
middleware.ts # Project entry middleware
The following documentation will be based on the current architecture.
Auth Integration
This guide will walk you through integrating Supabase Auth in a Next.js project, helping you understand the specific implementation of authentication functionality in the Nexty.dev template.
Database Operations
Detailed introduction to Supabase database operation methods and best practices.