Skip to content
FrontHeaven
Light mode

Next.js

Advanced

A three-level Next.js roadmap covering the App Router, React Server Components, Server Actions, caching, authentication, databases, testing, and production deployment.

0 / 32 lessons
Lessons

32

Complete to finish this stage

Est. time

20.5h

At a comfortable pace

Difficulty

Advanced

For complete beginners

Next.js Roadmap — 3 Difficulty Levels

Target: Modern Next.js with the App Router, React Server Components, Server Actions, caching, SSR/SSG, authentication, databases, testing, and production deployment.

This roadmap is organised as a progression from building pages, to shipping complete full-stack applications, to designing production systems. Follow the lessons below in order and use the checklists to track the concepts you can explain and apply.

🟢 Level 1 — Beginner

1. Prerequisites

React

  • JSX
  • Components and composition
  • Props and state
  • Events and forms
  • Hooks: useState, useEffect, useContext
  • Conditional rendering and lists

TypeScript

  • Types, interfaces, and type aliases
  • Generics and union types
  • Type narrowing
  • Function types
  • React types

2. Next.js Fundamentals

  • What Next.js is and why it exists
  • Next.js vs React
  • Creating a project with create-next-app
  • Project structure, package.json, and next.config
  • Environment variables
  • Development server, production build, and production server

3. App Router

  • app/ directory and file-based routing
  • page.tsx, layout.tsx, and template.tsx
  • loading.tsx, error.tsx, not-found.tsx, and global-error.tsx
  • default.tsx

4. Routing and Layouts

  • Basic, nested, dynamic, catch-all, and optional catch-all routes
  • [id], [slug], [...slug], and [[...slug]]
  • Route groups: (group)
  • Parallel routes basics
  • Navigation with Link, useRouter, usePathname, and useSearchParams
  • Root and nested layouts
  • Shared UI and layout persistence
  • Route-specific layouts
  • Template vs layout

5. Server and Client Components

  • React Server Components
  • Server Components by default
  • Client Components and "use client"
  • Server Functions and "use server"
  • Component boundaries and serializable props
  • Passing data across server/client boundaries

6. Data Fetching and Rendering

  • fetch() and async Server Components
  • API requests and direct data access
  • Loading and error states
  • Parallel and sequential data fetching
  • CSR, SSR, SSG, static, dynamic, and hybrid rendering
  • Understanding when a page renders

7. Metadata, Styling, Images, and Fonts

  • Static and dynamic metadata with metadata and generateMetadata
  • Open Graph, Twitter metadata, robots, sitemap, and canonical URLs
  • Global CSS, CSS Modules, Tailwind CSS, and Sass
  • Responsive design and dark mode
  • next/image, responsive sizing, optimization, and image priority
  • next/font, local fonts, and Google fonts

8. Route Handlers and Environment Variables

  • route.ts and Route Handlers
  • GET, POST, PUT, PATCH, and DELETE
  • Requests, responses, headers, and cookies
  • .env, .env.local, .env.development, and .env.production
  • Server-only variables, NEXT_PUBLIC_*, and secret management

9. Beginner Projects

  • Portfolio
  • Blog
  • Documentation site
  • News website
  • Product catalog
  • Simple dashboard
  • Basic e-commerce frontend

🟡 Level 2 — Intermediate

1. Advanced Routing

  • Dynamic nested routes and route groups
  • Parallel and intercepting routes
  • Modal routing
  • Route-level loading and error boundaries
  • Middleware/proxy concepts and advanced navigation

2. Data Fetching and Caching

  • Server-side and client-side data fetching
  • Database and external API access
  • Parallel requests and request deduplication
  • Streaming, Suspense, and loading UI
  • Data Cache, Full Route Cache, and Client Router Cache
  • Cache invalidation, time-based revalidation, and on-demand revalidation
  • revalidatePath, revalidateTag, cache tags, and stale data

3. ISR and Server Actions

  • Incremental Static Regeneration (ISR)
  • Static generation and generateStaticParams
  • Time-based and on-demand regeneration
  • Server Actions and Server Functions
  • Form actions, mutations, progressive enhancement, and optimistic updates
  • Validation, authentication, database mutations, and error handling

4. Forms and Authentication

  • FormData and server-side forms
  • Client/server validation with Zod
  • Form pending, error, and success states
  • Sessions, cookies, and authentication flows
  • Authorization, protected routes, and middleware/proxy
  • OAuth, JWT, Auth.js, RBAC, and admin authentication

5. Databases and APIs

  • PostgreSQL, MySQL, SQLite, and MongoDB
  • Prisma and Drizzle
  • Connections, models, relations, migrations, queries, and transactions
  • REST APIs, external APIs, API clients, and validation
  • Error responses, rate limiting, API versioning, and webhooks

6. Middleware, Performance, Errors, i18n, and Testing

  • Request interception, redirects, rewrites, headers, and cookies
  • Edge execution considerations
  • Server Component minimization, code splitting, dynamic imports, and lazy loading
  • Image/font optimization, bundle analysis, and Core Web Vitals
  • Expected/unexpected errors, server/client errors, logging, and error boundaries
  • Locale routing, translation files, RTL, Persian/Arabic layouts, and formatting
  • Unit tests with Jest/Vitest and React Testing Library
  • E2E tests with Playwright/Cypress, user flows, authentication, and API tests
  • Server Component testing, mocking, integration tests, and test environments

7. Intermediate Projects

E-Commerce

  • Catalog, search, filtering, cart, checkout, orders, and user dashboard
  • Authentication, admin dashboard, PostgreSQL, and payment integration

SaaS Dashboard

  • Authentication, organizations, roles, permissions, and dashboard
  • Billing, notifications, API, database, and Server Actions

🔴 Level 3 — Advanced / Senior

Architecture and Runtime

  • App Router and server-first architecture
  • Server/client and component boundaries
  • Feature-based architecture and domain-driven frontend design
  • Shared components, design systems, and monorepos
  • RSC architecture, Flight/RSC payloads, serialization, streaming, Suspense, hydration, and mismatch debugging
  • Static/dynamic rendering, streaming SSR, ISR, partial rendering, hybrid applications, and waterfall elimination

Caching and Performance Engineering

  • Data Cache, Full Route Cache, Router Cache, cache tags, and invalidation
  • Cache lifetimes, profiles, consistency, and distributed caching
  • LCP, INP, CLS, TTFB, server response time, and Core Web Vitals
  • Bundle analysis, JavaScript reduction, streaming, CDN, edge caching, and database query optimization

Data, Security, and Enterprise Authentication

  • Connection pooling, transactions, indexes, N+1 prevention, read replicas, and production migrations
  • Authentication, authorization, RBAC, ABAC, secure sessions/cookies, CSRF, XSS, CSP, and CORS
  • SQL injection, SSRF, rate limiting, validation, output encoding, secrets, and dependency security
  • OAuth 2.0, OpenID Connect, PKCE, SSO, SAML, MFA, passkeys, and token rotation
  • Organization permissions and multi-tenancy

APIs and Server Actions

  • REST, GraphQL, tRPC, WebSockets, SSE, webhooks, and API gateways
  • BFF architecture, API aggregation, rate limiting, idempotency, and versioning
  • Authorized mutations, validation, transactions, optimistic updates, invalidation, and progressive enhancement

Delivery and Operations

  • Parallel/intercepting routes, modal routing, route caching, and route-level boundaries
  • Vercel, Docker, Node.js, self-hosting, reverse proxies, Nginx, and production builds
  • CI/CD, preview/staging environments, rollbacks, and environment configuration
  • GitHub Actions, linting, type checking, unit/E2E tests, migrations, releases, and security scanning
  • Structured logging, error monitoring, tracing, metrics, Core Web Vitals, alerting, and production debugging
  • Turborepo/Nx, shared packages/configs, build caching, affected builds, and workspace architecture
  • Multi-language architecture, locale SEO/metadata, RTL/LTR, currency, dates, and number formatting
  • Testing strategy, integration/contract/E2E/visual/accessibility/performance testing, parallelization, and flaky-test management

Advanced Projects

🏆 Production E-Commerce

  • App Router, RSC, Client Components, Server Actions, REST, authentication, PostgreSQL, Prisma/Drizzle
  • Catalog, search, filtering, pagination, cart, accounts, orders, payments, admin/RBAC, and inventory
  • SEO, SSR/ISR, caching, error handling, testing, CI/CD, CDN, and monitoring

🏆 Multi-Tenant SaaS

  • Organizations, teams, users, roles, permissions, billing, plans, and dashboards
  • Audit logs, notifications, APIs, webhooks, multi-tenancy, security, and monitoring

🏆 Enterprise Next.js Monorepo

  • apps/web, apps/admin, apps/docs, and apps/mobile-api
  • Shared UI, TypeScript, database, auth, design system, CI/CD, testing, build caching, and deployment pipelines

🎯 Complete Learning Path

text
React → TypeScript → Fundamentals → App Router → Routing → Layouts
→ Server/Client Components → Data Fetching → Rendering → SEO
→ Route Handlers → Server Actions → Forms → Authentication → Database
→ Caching → ISR → Performance → Testing → Security → Deployment
→ RSC/Streaming/Hydration → Architecture → CI/CD → Observability
→ Monorepos → Enterprise Next.js

⭐ What Separates the Levels?

  • Junior: I can build a website with routing, components, layouts, data fetching, APIs, styling, and SEO.
  • Mid-level: I can ship a complete application with Server/Client Components, Server Actions, auth, a database, caching, rendering strategies, tests, performance work, and deployment.
  • Senior: I can design a production system with deliberate architecture, RSC boundaries, rendering and caching strategies, database design, security, observability, CI/CD, and scalability.

Highest-priority topics: App Router → Server/Client Components → data fetching → Server Actions → authentication → PostgreSQL/ORM → caching → SSR/ISR → performance → testing → deployment.

Start learning
Stage progress0%

Next.js lessons

32 lessons · follow them in order for best results.

React & TypeScript Prerequisites for Modern Next.jsMaster essential React 18/19 and TypeScript foundations required for Next.js App Router: JSX, component composition, hooks, state management, interfaces, generics, and React typings.Beginner 35 min Level 1 — BeginnerNext.js Fundamentals, Architecture & CLI WorkflowsMaster Next.js foundations: React SPA vs Next.js meta-framework, scaffolding projects with create-next-app, project file structure, next.config, environment configurations, dev and production build lifecycles.Beginner 30 min Level 1 — BeginnerThe App Router & Special File ConventionsMaster the Next.js App Router architecture and special file conventions: page.tsx, layout.tsx, loading.tsx, error.tsx, not-found.tsx, global-error.tsx, template.tsx, and default.tsx.Beginner 35 min Level 1 — BeginnerRouting, Dynamic Segments & Navigation APIsMaster Next.js App Router routing mechanics: static routes, nested routes, dynamic parameters ([id]), catch-all ([...slug]), optional catch-all, route groups ((group)), Link component, useRouter, usePathname, and useSearchParams.Beginner 35 min Level 1 — BeginnerLayouts, Templates & Shared UI ArchitectureMaster Next.js App Router layouts: mandatory root layout, nested sub-layouts, state persistence across page transitions, route-specific layouts, and layout.tsx vs template.tsx mechanics.Beginner 30 min Level 1 — BeginnerServer & Client Components: Boundaries & InteroperabilityMaster React Server Components (RSC) vs Client Components: the "use client" directive, boundary separation, passing serializable props, the children composition pattern, and 0KB bundle benefits.Beginner 35 min Level 1 — BeginnerData Fetching in Server Components & Async ArchitectureMaster data fetching in Next.js App Router: async Server Components, native fetch() caching/revalidation, direct database queries, parallel requests (Promise.all), and waterfall prevention.Beginner 35 min Level 1 — BeginnerRendering Paradigms: Static, Dynamic & Hybrid ExecutionMaster rendering strategies in Next.js App Router: Static Rendering (SSG), Dynamic Rendering (SSR), Client-Side Rendering (CSR), hybrid execution, and understanding Dynamic Functions (cookies, headers).Beginner 35 min Level 1 — BeginnerMetadata, SEO, Open Graph & Search IndexingMaster SEO and metadata in Next.js App Router: static metadata, generateMetadata for dynamic routes, Open Graph social sharing cards, automated robots.ts and sitemap.ts generation.Beginner 35 min Level 1 — BeginnerStyling Strategies: Tailwind CSS, CSS Modules & Dark ModeMaster styling architectures in Next.js App Router: Global CSS, CSS Modules, Tailwind CSS, Sass integration, CSS-in-JS limitations in React Server Components, and seamless dark mode theming.Beginner 30 min Level 1 — BeginnerImage & Font Optimization: Core Web Vitals EngineeringMaster asset optimization in Next.js: next/image, automatic WebP/AVIF compression, blur placeholders, LCP priority loading, next/font/google zero-CLS font hosting, and local font integration.Beginner 30 min Level 1 — BeginnerAPI Routes & Route Handlers ArchitectureMaster Next.js App Router Route Handlers (route.ts): standard HTTP methods (GET, POST, PUT, DELETE), NextRequest and NextResponse, reading headers/cookies, and building robust RESTful endpoints.Beginner 35 min Level 1 — BeginnerEnvironment Variables, Secrets & Security ConfigurationMaster environment variables in Next.js: .env.local hierarchy, server-only secret isolation, client-exposed NEXT_PUBLIC_* variables, type-safe schema validation, and preventing client bundle leakage.Beginner 30 min Level 1 — BeginnerBeginner Projects & Hands-On Application LabsBuild 7 practical real-world beginner Next.js projects: modern developer portfolio, dynamic markdown blog, multi-tier documentation site, live news aggregator, product catalog, analytics dashboard, and e-commerce frontend.Beginner 50 min Level 1 — BeginnerAdvanced Routing: Parallel & Intercepting RoutesMaster advanced Next.js App Router routing patterns: Parallel Routes (@slot), default.tsx fallbacks, Intercepting Routes ((.) and (..)), shareable modal routing, and conditional slot rendering.Intermediate 40 min Level 2 — IntermediateData Fetching Architecture: Streaming, Suspense & DeduplicationMaster enterprise data fetching architecture in Next.js: React.cache() per-request deduplication, React Suspense streaming, granular loading skeletons, and eliminating nested component waterfalls.Intermediate 40 min Level 2 — IntermediateNext.js Caching Architecture & Revalidation StrategiesMaster the 4-tier Next.js caching engine: Request Memoization, Data Cache, Full Route Cache, Client Router Cache, time-based revalidation, on-demand revalidatePath, and revalidateTag cache tags.Intermediate 45 min Level 2 — IntermediateIncremental Static Regeneration (ISR) & generateStaticParamsMaster Incremental Static Regeneration (ISR) in Next.js: generateStaticParams for dynamic routes, time-based background regeneration, on-demand cache purges, and the stale-while-revalidate algorithm.Intermediate 35 min Level 2 — IntermediateServer Actions & Mutations ArchitectureMaster Server Actions in Next.js: the "use server" directive, form mutations, progressive enhancement, server-side authorization checks, database transactions, and cache revalidation.Intermediate 40 min Level 2 — IntermediateModern Forms, Validation & React 19 Action HooksMaster modern form handling in Next.js: useActionState, useFormStatus pending states, Zod schema validation, server-side error mapping, and optimistic UI updates with useOptimistic.Intermediate 40 min Level 2 — IntermediateAuthentication, Authorization & Session ManagementMaster authentication architecture in Next.js: secure HTTP-only cookies, JWT vs database sessions, Auth.js (NextAuth v5), middleware route protection, and Role-Based Access Control (RBAC).Intermediate 45 min Level 2 — IntermediateDatabases & ORMs: PostgreSQL, Prisma & DrizzleMaster database architecture in Next.js: PostgreSQL, Prisma ORM, Drizzle ORM, serverless connection pooling, schema migrations, relations, and ACID transactions.Intermediate 45 min Level 2 — IntermediateAPI Architecture: Webhooks, Rate Limiting & REST EndpointsMaster enterprise API architecture in Next.js: cryptographic webhook signature verification (Stripe), Redis-backed rate limiting (@upstash/ratelimit), standardized error envelopes, and API versioning.Intermediate 40 min Level 2 — IntermediateMiddleware, Edge Routing & Request InterceptionMaster Next.js Middleware (middleware.ts): Edge runtime execution, request interception, route protection, redirects vs rewrites, custom response headers, and matcher optimization.Intermediate 35 min Level 2 — IntermediatePerformance Engineering: Dynamic Imports & Bundle OptimizationMaster web performance in Next.js: next/dynamic lazy loading, @next/bundle-analyzer tree-shaking analysis, minimizing Client Component footprints, and Core Web Vitals optimization.Intermediate 40 min Level 2 — IntermediateError Handling, Not-Found Boundaries & LoggingMaster error handling in Next.js App Router: nested error boundaries (error.tsx), global-error.tsx, notFound() triggers, expected vs unexpected errors, and production logging integration.Intermediate 35 min Level 2 — IntermediateInternationalization (i18n), RTL Layouts & LocalizationMaster internationalization in Next.js App Router: [lang] dynamic locale routing, dictionary loading, bidirectional RTL/LTR layouts (Persian/Arabic), and Intl date/currency formatting.Intermediate 35 min Level 2 — IntermediateTesting Strategies: Unit, Server Actions & Playwright E2EMaster comprehensive testing in Next.js: unit testing with Vitest and React Testing Library, mocking Server Components and database calls, Server Action integration tests, and Playwright end-to-end user journeys.Intermediate 40 min Level 2 — IntermediateIntermediate Full-Stack Projects: E-Commerce & SaaS DashboardBuild 2 comprehensive full-stack Next.js intermediate projects: Production E-Commerce Platform with PostgreSQL & Stripe, and Multi-Tenant SaaS Analytics Dashboard with RBAC & Server Actions.Intermediate 60 min Level 2 — IntermediateNext.js Architecture, Domain-Driven Design & MonoreposMaster enterprise Next.js architecture: server-first system design, feature-sliced component boundaries, Domain-Driven Design (DDD) frontend modules, shared design systems, and monorepo workspaces.Advanced 45 min Level 3 — AdvancedReact Server Components Deep Dive & RSC Protocol InternalsMaster the internal engine of React Server Components (RSC): the Flight wire protocol, RSC payload serialization, progressive streaming, hydration algorithms, and resolving hydration mismatches.Advanced 45 min Level 3 — AdvancedAdvanced Rendering Architecture & Partial Prerendering (PPR)Master enterprise rendering architecture in Next.js: Partial Prerendering (PPR), combining static CDN shells with dynamic streaming holes, streaming SSR, and rendering waterfall elimination.Advanced 45 min Level 3 — Advanced