Topic Hub · 52 articles

Next.js + Supabase: The Complete Resource Hub

This hub is the entry point for the Next.js + Supabase stack. Start with the foundations, then move into auth, data modeling, and production hardening. Every linked article is battle-tested on real projects.

Start here

7 items

Authentication & authorization

11 items
08
Guide·50 min read

Advanced Authentication Patterns with Next.js and Supabase

Advanced Next.js + Supabase auth patterns: OAuth, magic links, passwordless, custom JWT, multi-tenant auth, and enterprise SSO integration.

Read
09
Guide·16 min read

Supabase SSR Sessions in Next.js App Router (2026 Guide)

How createServerClient, createBrowserClient and middleware cooperate to refresh the Supabase auth cookie — and why getUser() belongs on the server.

Read
10
Guide·16 min read

Supabase RLS Policy Design Patterns Beyond the Basics

Master advanced Supabase RLS policy patterns for multi-role access, team permissions, and hierarchical authorization.

Read
11
Guide·28 min read

Supabase + Google OAuth on Next.js 15: Working Guide (2026)

Complete Google OAuth setup for Supabase + Next.js 15 (App Router, @supabase/ssr): Cloud Console config, redirect allowlists, refresh tokens, scopes.

Read
12
Guide·38 min read

Supabase Auth + Middleware: Session Guide for Next.js 15

Supabase auth and session management in Next.js 15: middleware patterns, cookie handling, refresh tokens, MFA, and the silent failures that ruin auth.

Read
13
Guide·34 min read

Build a Real-Time Chat App: Next.js + Supabase Production

A complete real-time chat app with Next.js 15 + Supabase: schema, RLS policies, presence, typing indicators, pagination, and production gotchas.

Read
14
Guide·11 min read

Supabase Auth vs Clerk in 2026: The Production Verdict

Verdict up front: Clerk for complex org and B2B auth, Supabase Auth when your data already lives in Postgres behind RLS. 2026 MAU pricing compared.

Read
15
Article·10 min read

Supabase AuthSessionMissingError in Middleware: 5 Fixes

AuthSessionMissingError, AuthRetryableFetchError, 406 responses and redirect loops in Next.js middleware — the root cause and exact fix for each one.

Read
16
Article·11 min read

Supabase Auth Callback Redirect Not Working? Next.js Fix

redirectTo only works when the URL is allowlisted in Supabase Auth settings — otherwise it falls back to Site URL. Next.js callback route included.

Read
17
Article·11 min read

11 Supabase Auth Lessons From a Year in Production

Eleven recurring Supabase Auth traps in Next.js: getSession vs getUser, custom auth.users columns, refresh-token expiry, MFA scope, RLS gotchas.

Read
18
Article·22 min read

Clerk vs Better Auth vs Supabase: Next.js Auth in 2026

What the official docs won't tell you: how Clerk, Better Auth, Supabase Auth and Auth.js differ on middleware, MAU pricing and migration cost.

Read

Performance

7 items
19
Guide·40 min read

Next.js Performance Optimization for Indie Developers

Ship a fast Next.js app: Core Web Vitals, image and font optimization, bundle trimming, caching, and the RUM checks that catch regressions.

Read
20
Guide·36 min read

Scaling Next.js + Supabase: 0 to 100K Users Playbook

Scaling Next.js + Supabase from 0 to 100K users: connection pooling, caching layers, read replicas, queue offloading, and cost controls.

Read
21
Guide·38 min read

Next.js 15 Partial Prerendering: Guide

Next.js 15 Partial Prerendering: the static shell / dynamic holes model, Suspense boundaries, streaming, caching, and migration paths.

Read
22
Article·11 min read

Next.js 15 Caching Explained: Why Data Shows Stale

Next.js 15 changed caching defaults. How fetch(), unstable_cache, and revalidate work in the App Router — and why pages stopped refreshing.

Read
23
Article·14 min read

Next.js + Supabase Performance: 10 Real Fixes

10 verified fixes for slow Next.js + Supabase apps: RLS-indexed columns, N+1 joins, the pooler trap on serverless, image transforms, and caching.

Read
24
Article·10 min read

Next.js 15 vs 14: Real Benchmarks + Upgrade Verdict (2026)

What actually changed: fetch() is no longer cached by default, params go async, Turbopack dev is stable (build isn't yet). Sourced against Next.js's own release notes.

Read
25
Article·11 min read

Fix next/image Layout Shift (CLS) in Next.js

Why next/image still causes layout shift (CLS): missing width/height, fill without a positioned parent, unset sizes, and preload vs priority in Next.js 16.

Read

Architecture patterns

25 items
26
Guide·16 min read

Next.js + Supabase Data Fetching: Server Components

Data fetching patterns in Next.js with Supabase: Server Components, streaming, parallel queries, and caching for optimal performance.

Read
27
Guide·30 min read

Database Design for Next.js + Supabase: Optimization Guide

Master PostgreSQL database design, indexing strategies, query optimization, and scaling patterns for high-performance Next.js and Supabase applications.

Read
28
Guide·38 min read

Supabase Multi-Tenant Architecture: Best Practices 2026

One codebase, isolated tenants: RLS policies, subdomain routing, and billing for a multi-tenant SaaS on Next.js + Supabase — with schema and code.

Read
29
Guide·18 min read

Next.js Server Actions with Supabase: Complete Guide

Complete guide to Next.js Server Actions with Supabase. Learn validation, error handling, optimistic updates, and production patterns for type-safe forms.

Read
30
Guide

Next.js & Supabase Stripe Subscriptions: SaaS Guide

SaaS billing with Stripe subscriptions in Next.js + Supabase: webhooks, user syncing, and gated content for production.

Read
31
Guide·30 min read

Supabase Storage File Uploads in Next.js: 2026 Guide

Upload files from Next.js to Supabase Storage with working code: bucket RLS policies, signed URLs, progressive uploads and image transforms via CDN.

Read
32
Guide·45 min read

Next.js Webhook Handling and Event-Driven Architecture

Webhook handling and event-driven architecture with Next.js and Supabase: security, retry mechanisms, and distributed system patterns.

Read
33
Guide·15 min read

Next.js + Supabase Background Jobs & Async Patterns

Background jobs and async patterns for Next.js + Supabase: database queues, pg_cron, and Edge Functions — no external services.

Read
34
Guide·38 min read

Supabase Edge Functions in Next.js: Setup to Cron (2026)

From supabase functions new to production: Deno runtime gotchas, built-in SUPABASE_URL and SERVICE_ROLE_KEY env vars, webhook triggers and cron jobs.

Read
35
Guide·30 min read

Error Handling and Observability for Next.js + Supabase

Comprehensive guide to error handling, logging, monitoring, and observability for production Next.js and Supabase applications.

Read
36
Guide·19 min read

Type Safety Guide for Next.js + Supabase in TypeScript

Type safety in Next.js with Supabase: database type generation, Zod validation, type-safe queries, and production TypeScript patterns.

Read
37
Guide

React Server Components: Complete Deep Dive

Master React Server Components with this comprehensive guide. Learn RSC architecture, data fetching patterns, streaming, and best practices for Next.js 15.

Read
38
Guide

Supabase Realtime: Guide to Building Live Applications

Master Supabase Realtime: Postgres Changes, Presence, Broadcast, and building real-time features like chat, notifications, collaborative editing.

Read
39
Article·10 min read

Next.js Server Actions vs API Routes: When to Use Each

Server Actions vs API Routes in Next.js 15: the real differences, when to use each, with examples and performance comparisons.

Read
40
Article·8 min read

Fix Next.js revalidatePath Not Working in Server Actions

Server Action runs, database updates, UI stays stale? `revalidatePath` silently no-ops in 6 production situations.

Read
41
Article·9 min read

Fix "cookies() should be awaited" Error in Next.js 15

Next.js 15 made cookies() async — await cookies() in Server Components, Actions and Route Handlers. Covers the codemod and NEXT_STATIC_GEN_BAILOUT.

Read
42
Article·11 min read

Stripe Webhook Signature Verification Failed in Next.js

"No signatures found matching expected signature" in Next.js? Raw-body fix for App Router, Pages Router, Vercel Edge — plus retry strategy.

Read
43
Article·14 min read

Next.js + Supabase: 10 Production Mistakes + Fixes (2026)

RLS left off, anon key on the server, missing await cookies(), no connection pooling — the ten misconfigurations that break apps, each with its fix.

Read
44
Article·11 min read

Next.js 'Module not found: Can't resolve': 6 Fixes

Builds pass locally but fail on Vercel? The usual suspects: case-sensitive imports, tsconfig path aliases, devDependencies and monorepo hoisting.

Read
45
Article·12 min read

Fix 'Hydration failed' in Next.js: 8 Root Causes (2026)

'Hydration failed because the initial UI does not match' usually means Date.now(), locale formatting or browser-only state. 8 causes, 8 code fixes.

Read
46
Article·9 min read

Next.js Turbopack Stuck on Compiling? 5 Fixes (2026)

Turbopack stuck on 'Compiling…' in Next.js? Clear the .next cache, fix ENOENT _buildManifest.js.tmp, or force webpack with next build --webpack.

Read
47
Article·10 min read

Next.js Environment Variables Undefined on Vercel? Fix

NEXT_PUBLIC_ variables stay undefined on Vercel until you redeploy — env vars are inlined at build time. 5 exact fixes, from prefix to environment scope.

Read
48
Article·13 min read

Migrate JavaScript to TypeScript with ts-migrate (2026)

Migrate JavaScript to TypeScript incrementally: enable allowJs, convert file by file, automate with ts-migrate, then tighten strict mode. No big rewrite for codebases over 10,000 lines.

Read
49
Article·7 min read

Fix: "[object Date]" Cannot Be Serialized as JSON

getStaticProps or getServerSideProps serialised a Date object. Convert it to a string or timestamp before returning it as a prop.

Read
50
Article·8 min read

NextAuth: Property 'session' does not exist on type '{}'

Next.js 12.3 typed pageProps as {} by default, so pageProps.session fails to compile. Fix: AppProps<{ session?: Session | null }>.

Read