Next.js 16 & React 19: Build a Fullstack App with Prisma, Postgres & NextAuth.js

A 31-step tutorial series for React developers who want to learn Next.js. We build a complete blog application — NextJs-FullStack-App-Blog-APP — with authentication, a real database, full CRUD operations, and deploy it to Vercel, one small step at a time.

What You Will Build

Throughout this series you will build NextJs-FullStack-App-Blog-APP — a fullstack blog application where users can register, sign in, create, update, and delete their own posts. The project covers every layer of a modern web app: the React UI, the Next.js server, the Prisma ORM, a PostgreSQL database, and NextAuth.js authentication — all written in TypeScript and deployed on Vercel.

View the source code on GitHub — each step has its own branch (e.g. step1, step2, … step30). Step 31 is a theory reference with no branch.

Technologies & Tools

Framework & Language

  • Next.js 16 (App Router)
  • React 19 (Server & Client Components)
  • TypeScript

Database & ORM

  • Prisma ORM
  • PostgreSQL (Prisma Postgres)
  • Prisma Accelerate
  • Prisma Studio

Authentication

  • NextAuth.js v5 (Auth.js)
  • Credentials Provider
  • bcrypt password hashing
  • JWT sessions

Styling & UI

  • Tailwind CSS
  • Responsive design

Deployment

  • Vercel
  • Turbopack (dev server)

Developer Tools

Next.js Features Covered

  • App Router — file-based routing
  • Server Components — default rendering
  • Client Components — "use client" directive
  • Layouts — shared UI with layout.tsx
  • Dynamic Routes — [id] segments
  • Route Handlers — API endpoints
  • Server Actions — form mutations
  • Proxy (Middleware) — route protection
  • Streaming & Suspense — progressive rendering
  • loading.tsx — skeleton loading states
  • error.tsx — error boundaries
  • not-found.tsx — custom 404 pages
  • generateMetadata — dynamic SEO
  • Open Graph tags — social sharing
  • searchParams — URL-based state
  • next/image — image optimization
  • next/link — client-side navigation
  • next/navigation — redirect, notFound, useRouter, usePathname
  • next/font — font optimization
  • Title template — consistent page titles
  • remotePatterns — external image config

React 19 Features Covered

  • Server Components — async components with direct data access
  • Client Components — interactive UI with hooks
  • use() hook — read promises during render
  • useActionState — form state with server actions
  • useFormStatus — pending state for forms
  • <Suspense> — loading boundaries & streaming
  • useState — client-side state management
  • useEffect — side effects & data fetching
  • useSession — client-side session access
  • useRouter — programmatic navigation
  • useSearchParams — reading URL search params
  • useRef — mutable refs (debounce timers)
  • form action — server action as form handler

Prerequisites

  • Node.js 18+ installed (nodejs.org)
  • A code editor (VS Code recommended)
  • A Vercel account (for Prisma Postgres and deployment)
  • Basic knowledge of React (components, props, state) — see our React 19 tutorial

Tutorial Roadmap — 31 Steps

  1. 01
    Your First Next.js Page — Project setup, App Router, Server Components[branch]
  2. 02
    File-Based Routing — Creating pages, understanding routes[branch]
  3. 03
    Layouts & Navigation — Shared UI, the Link component, Client Components[branch]
  4. 04
    Introduction to Prisma ORM — Setting up the database layer[branch]
  5. 05
    Modeling Your Data — Schema design, User & Post models, migrations[branch]
  6. 06
    Seeding Test Data — Populating the database with sample content[branch]
  7. 07
    Connecting to the Database — The Prisma Client singleton pattern[branch]
  8. 08
    Rendering Posts from the Database — Server Components and data fetching[branch]
  9. 09
    Advanced Prisma Queries — Deep dive into include, select, relations, and performance — compared with Laravel Eloquent
  10. 10
    Dynamic Routes — Building the post detail page with [id][branch]
  11. 11
    Building an API — Route Handlers and JSON responses[branch]
  12. 12
    Client Components & Pagination — Interactive UI, useEffect, and data fetching[branch]
  13. 13
    Adding Authentication — NextAuth.js setup and configuration[branch]
  14. 14
    Login & Register — Building authentication forms[branch]
  15. 15
    Session & Protected UI — Middleware, route protection, session management[branch]
  16. 16
    Creating Posts — Server Actions and form handling[branch]
  17. 17
    Deleting Posts — Completing the CRUD cycle[branch]
  18. 18
    Deploy to Vercel — Environment variables, Prisma migrations, and going live[branch]
  19. 19
    Updating Posts — Edit form, Server Actions, and prisma.post.update() — completing full CRUD[branch]
  20. 20
    Refactoring Pagination — Replace useEffect with Server Components, Suspense, and URL-based pagination[branch]
  21. 21
    The use() Hook in Practice — Stream data from Server to Client Components with use(), Suspense, and Prisma[branch]
  22. 22
    Middleware to Proxy Migration — Migrate from the deprecated middleware convention to the new proxy file convention[branch]
  23. 23
    Error Handling — Add error boundaries with error.tsx and custom 404 pages with not-found.tsx[branch]
  24. 24
    Loading UI & Skeletons — Show instant loading states with the loading.tsx file convention and skeleton screens[branch]
  25. 25
    Dynamic Metadata & SEO — Add page titles, descriptions, and Open Graph tags with the Metadata API[branch]
  26. 26
    Search & Filtering — Add search to the posts page using URL searchParams and server-side Prisma queries[branch]
  27. 27
    useActionState for Forms — Refactor forms with useActionState for pending states and inline server validation errors[branch]
  28. 28
    Input Validation with Zod — Add robust input validation to forms and server actions using the Zod library throughout the codebase.[branch]
  29. 29
    Image Optimization — Add author avatars with the next/image component and automatic image optimization[branch]
  30. 30
    Profiling Queries with Query Insights — Identify slow queries, N+1 problems, and missing indexes using the Query Insights dashboard built into Prisma Postgres
  31. 31
    Next.js 16 File Conventions — Complete reference to every special file name in the App Router — what each file does and which ones you actually need

Published Steps