Overview
EpiNeko uses Supabase for authentication, database management, and Row Level Security (RLS). The integration provides separate client and server utilities for optimal performance and security.Supabase utilities are located in
src/utils/supabase/ with separate implementations for client-side, server-side, and middleware usage.Environment Variables
Add these environment variables to your.env.local file:
Client-Side Usage
Use the client-side Supabase client for browser-based operations in Client Components.Creating a Client
Implementation Details
Usage Examples
Server-Side Usage
Use the server-side Supabase client for Server Components, Route Handlers, and Server Actions.Creating a Server Client
The server client is an async function that must be awaited. It handles cookie management automatically.
Implementation Details
Usage Examples
Middleware Integration
The middleware updates the user session on every request, ensuring authentication state is always fresh.Implementation
Using in middleware.ts
The middleware automatically refreshes the user session on every request, keeping authentication state synchronized between client and server.
Authentication Patterns
Sign Up
Sign In
Sign Out
Get Current User
Database Operations
Insert
Select
Update
Delete
Type Safety
Generate TypeScript types from your database schema:Best Practices
Common Issues
Related Resources
Database Schema
View complete database schema
Row Level Security
Learn about RLS policies
Supabase Docs
Official Supabase documentation
Library Service
High-level library operations