Demo mode — data resets on refresh.

Production Patterns

Authentication

Auth in Next.js

Authentication in Next.js typically involves: verifying credentials, creating a session (JWT or database-backed), and storing a token in an HTTP-only cookie.

Middleware

Next.js middleware runs before every request and is ideal for auth checks. You can redirect unauthenticated users before the page renders, preventing flashes of protected content.

Libraries

NextAuth.js (now Auth.js) provides a complete auth solution with support for dozens of providers. Clerk and Auth0 offer managed auth-as-a-service.