Frontend

Next.js Roadmap: Step-by-Step Guide for 2026

This Next.js roadmap takes you from React basics to building fast, SEO-friendly full stack apps with the App Router, server components, data fetching, authentication and deployment.

Steps6Time3 to 5 monthsLevelBeginner to job-ready

What is a Next.js Developer?

Next.js is a React framework for building websites and web apps. A Next.js developer uses it to create pages that load fast, rank well on search engines and can include back-end logic in the same project.

Next.js is used by startups and large companies for marketing sites, e-commerce and SaaS products, which makes it one of the most requested React skills in job listings.

How to use this Next.js roadmap

Follow this Next.js roadmap in order. Learn React first, then the App Router and server components, then data, auth and deployment.

Build one real project, such as a blog with a dashboard, and grow it at each step.

1Step 1: React foundations

Next.js is React, so learn React well first.

What is it?

Components are functions that return JSX.

What to learn

JSXComponentsProps and stateHooksTypeScript with React

If you are new to React, finish the core of our React roadmap first.

Learn each topic here

Tap a topic to open a full explanation with examples, no need to go anywhere else.
JSX

JSX lets you write HTML-like markup inside JavaScript. It is converted to normal JavaScript calls. Use className instead of class, and curly braces {} to insert JavaScript values.

jsx

const name = "Sara";
const el = <h1 className="title">Hello, {name}!</h1>;
Components

Components are functions that return JSX. Each one handles a piece of the UI, and you combine them like building blocks. Component names start with a capital letter.

jsx

function Header() {
  return <header><h1>My Shop</h1></header>;
}
function App() {
  return <><Header /><main>...</main></>;
}
Props and state

Props are inputs passed from a parent component (read-only). State is data a component owns and can change; when state changes, React re-renders the UI automatically.

jsx

import { useState } from "react";

function Counter() {
  const [count, setCount] = useState(0);
  return <button onClick={() => setCount(count + 1)}>Clicked {count} times</button>;
}
Hooks

Hooks are functions that add features to components. useState stores state, useEffect runs code after render (like fetching data), and useRef, useMemo and custom hooks solve other common needs.

jsx

useEffect(() => {
  fetch("/api/products")
    .then(r => r.json())
    .then(setProducts);
}, []); // [] = run once after first render
TypeScript with React

TypeScript adds types to your components, catching mistakes like missing props before you run the app. Use .tsx files.

tsx

type User = { id: number; name: string };
function UserCard({ user }: { user: User }) {
  return <p>{user.name}</p>;
}

Example

jsx

export default function Hello({ name }) {
  return <h1>Hello, {name}</h1>;
}

Next.js pages are just React components like this.

Practice project: Build a small React app with components, state and a form.

Helpful resource: react.dev Learn

2Step 2: App Router basics

Learn how Next.js organises pages and layouts.

What is it?

A folder with a page.tsx file becomes a route.

What to learn

File-based routingLayouts and pagesDynamic routesLink and navigationMetadata API

Use the App Router (the app folder). The older pages folder is still supported but new projects use app.

Learn each topic here

Tap a topic to open a full explanation with examples, no need to go anywhere else.
File-based routing

In the Next.js App Router, folders inside app become URL segments and a page.tsx file makes the route public. So app/about/page.tsx becomes /about.

Why it matters: you create pages just by adding folders and files, with no router setup.

Layouts and pages

A layout.tsx wraps all pages inside its folder and stays mounted while users navigate, which is perfect for headers, sidebars and footers. A page.tsx is the unique content of a route.

Why it matters: shared layouts make apps faster and keep design consistent.

Dynamic routes

Dynamic routes include variables in the URL, such as a product ID. Read them with useParams.

jsx

<Route path="/products/:id" element={<Product />} />
function Product() {
  const { id } = useParams();
}
Link and navigation

The <Link> component navigates between pages without a full reload and prefetches linked pages in the background. For navigation in code, use the useRouter hook in client components.

Why it matters: fast navigation makes Next.js sites feel instant.

Metadata API

Export a metadata object or a generateMetadata function from a page or layout to set the title, description, Open Graph image and more.

Why it matters: correct metadata is essential for SEO and social sharing.

Example

tsx

// app/blog/[slug]/page.tsx
export default async function Post({ params }) {
  const { slug } = await params;
  return <h1>Post: {slug}</h1>;
}

Visiting /blog/hello shows “Post: hello”.

Practice project: Create a site with home, about, blog list and blog post pages.

Helpful resource: Next.js documentation

3Step 3: Server and client components

Understand where your code runs.

What is it?

A client component is marked with “use client” so it can use state and events.

What to learn

Server componentsClient componentsStatic and server renderingStreaming and SuspenseImage optimisation

Keep components on the server by default and add “use client” only when you need interactivity.

Learn each topic here

Tap a topic to open a full explanation with examples, no need to go anywhere else.
Server components

In Next.js, server components run on the server and send ready HTML, so they can fetch data directly and ship less JavaScript to the browser. Add "use client" only for interactive parts.

jsx

// app/products/page.jsx (server component)
export default async function Page() {
  const products = await getProducts();
  return <ProductList products={products} />;
}
Client components

Client components start with the "use client" directive. They run in the browser and can use state, effects, event handlers and browser APIs like localStorage.

Why it matters: use them only where interactivity is needed to keep pages light.

Static and server rendering

Static rendering builds pages once at build time (fast, good for blogs). Server rendering builds pages on each request (fresh data). Next.js lets you choose per page.

Streaming and Suspense

Streaming sends parts of a page as soon as they are ready. Wrap slow parts in <Suspense fallback={...}> or add a loading.tsx file to show a loading state.

Why it matters: users see content quickly even when some data is slow.

Image optimisation

Image optimisation means serving the right size and format for each device. In Shopify, use the image_url filter with a width and the image_tag filter, which adds responsive sizes and lazy loading.

Why it matters: images are usually the biggest reason stores load slowly.

Example

tsx

"use client";
import { useState } from "react";
export default function Like() {
  const [n, setN] = useState(0);
  return <button onClick={() => setN(n + 1)}>Like {n}</button>;
}

Only this small component ships JavaScript to the browser.

Practice project: Split a page into server components for data and a small client component for a like button.

Helpful resource: Server and client components

4Step 4: Data fetching and mutations

Load and change data the Next.js way.

What is it?

Server components can fetch data directly with await.

What to learn

Fetching in server componentsCaching and revalidationServer ActionsRoute handlersPrisma or another ORM

Server Actions let forms change data on the server without writing a separate API.

Learn each topic here

Tap a topic to open a full explanation with examples, no need to go anywhere else.
Fetching in server components

Server components can be async and fetch data directly with await, including database queries. The data never reaches the browser unless you render it.

Why it matters: it is simpler and more secure than fetching in the browser.

Caching and revalidation

Next.js can cache fetched data and pages. You can refresh data on a timer with revalidate or on demand with revalidatePath and revalidateTag after a change.

Why it matters: good caching makes sites fast while keeping data fresh.

Server Actions

Server Actions are async functions marked with "use server" that run on the server and can be called from forms or client components.

tsx

async function createPost(formData: FormData) {
  "use server";
  await db.post.create({ data: { title: formData.get("title") as string } });
}
// <form action={createPost}><input name="title" /></form>

Why it matters: they remove the need for separate API endpoints for most forms.

Route handlers

Route handlers are API endpoints in the app folder, defined in a route.ts file that exports functions like GET and POST.

Why it matters: they are useful for webhooks, mobile apps and third-party integrations.

Prisma or another ORM

An ORM lets you work with the database using code instead of raw SQL, with type safety and migrations.

javascript

const users = await prisma.user.findMany({ where: { active: true } });

Example

tsx

export default async function Posts() {
  const posts = await fetch("https://api.example.com/posts").then(r => r.json());
  return <ul>{posts.map(p => <li key={p.id}>{p.title}</li>)}</ul>;
}

The data is loaded on the server and the user receives ready HTML.

Practice project: Connect a database and add a form that creates posts with a Server Action.

Helpful resource: Next.js data fetching

5Step 5: Authentication and middleware

Protect pages and handle users.

What is it?

Middleware runs before a request reaches a page, which is useful for redirects.

What to learn

Auth.js (NextAuth)Sessions or JWTMiddlewareProtected routesEnvironment variables

Never put secrets in client components. Keep keys in environment variables used only on the server.

Learn each topic here

Tap a topic to open a full explanation with examples, no need to go anywhere else.
Auth.js (NextAuth)

Auth.js (formerly NextAuth) adds sign-in with providers like Google and GitHub, email links or credentials. It manages sessions and works with server components and middleware.

Why it matters: authentication is needed in almost every real app and is risky to build from scratch.

Sessions or JWT

After login, the server must remember the user. Sessions store a session ID in a secure cookie; JWTs are signed tokens the client sends with each request. Store tokens in httpOnly cookies, not localStorage.

Middleware

Middleware functions run between the request and your route handler, for logging, authentication or parsing JSON.

javascript

function requireLogin(req, res, next) {
  if (!req.user) return res.status(401).json({ error: "Login required" });
  next();
}
Protected routes

Protected routes check the user session before showing private content. In Next.js you can check in middleware, in a layout or in the page itself and redirect to login when needed.

Why it matters: private data must never be visible to visitors who are not signed in.

Environment variables

Pass settings like passwords and URLs to containers with -e or an env file, instead of hard-coding them.

bash

docker run -e POSTGRES_PASSWORD=secret postgres:16

Example

typescript

// middleware.ts
import { NextResponse } from "next/server";
export function middleware(req) {
  if (!req.cookies.get("session")) {
    return NextResponse.redirect(new URL("/login", req.url));
  }
}
export const config = { matcher: ["/dashboard/:path*"] };

Visitors without a session are sent to the login page.

Practice project: Add sign-in with Google and protect a dashboard page.

Helpful resource: Auth.js docs

6Step 6: SEO, performance and deployment

Ship a fast, search-friendly app.

What is it?

The Metadata API sets page titles and descriptions.

What to learn

Core Web VitalsSitemaps and robotsTestingVercel deploymentSelf-hosting Next.js

Next.js gives good SEO by default, but you still need titles, descriptions, sitemaps and fast images.

Learn each topic here

Tap a topic to open a full explanation with examples, no need to go anywhere else.
Core Web Vitals

Core Web Vitals are Google’s main measures of user experience: LCP (how fast the main content loads, aim under 2.5s), INP (how quickly the page responds to clicks, aim under 200ms) and CLS (how much the layout jumps, aim under 0.1). They affect SEO and user happiness.

Sitemaps and robots

Next.js can generate sitemap.xml and robots.txt from app/sitemap.ts and app/robots.ts. A sitemap lists your URLs so search engines can find them.

Why it matters: it helps new pages get indexed faster.

Testing

A good test setup uses unit tests (Vitest or Jest) for functions and components and end-to-end tests (Playwright or Cypress) for real user flows in the browser.

Why it matters: tests catch bugs before users do and make refactoring safe.

Vercel deployment

Vercel, the company behind Next.js, deploys projects directly from GitHub. Every push creates a preview URL and merges to main go live automatically.

Why it matters: it is the quickest way to put a Next.js app online.

Self-hosting Next.js

Next.js can run on your own server with next build and next start, inside Docker, or as a static export for sites without server features.

Why it matters: some companies need full control over hosting and costs.

Example

tsx

export const metadata = {
  title: "My Blog",
  description: "Articles about web development"
};

Search engines see the correct title and description for the page.

Practice project: Add metadata, a sitemap and deploy your project with a custom domain.

Helpful resource: Next.js Learn course

Next.js roadmap project ideas

Projects turn what you learn into real skills. Build at least one project from each level below, and put every finished project on GitHub with a clear README.

Beginner

Personal blog

Markdown posts with dynamic routes.

Beginner

Landing page

Fast marketing page with metadata.

Intermediate

Notes app

Database, Server Actions and auth.

Intermediate

E-commerce catalogue

Products, search and image optimisation.

Advanced

SaaS dashboard

Auth, payments and charts.

Advanced

Multi-language site

Internationalised routes and SEO.

Tips to finish this next.js roadmap

  • Learn by building. Spend at least two thirds of your study time writing code and making projects, not watching videos.
  • Be consistent. One focused hour every day beats a long session once a week. Small daily progress adds up quickly.
  • Share your work. Post your projects on GitHub and LinkedIn. It builds your confidence and helps recruiters find you.
  • Ask for feedback. Join a community, ask questions and review other people’s code. Explaining things to others is one of the fastest ways to learn.
  • Do not chase every new tool. The fundamentals in this next.js roadmap change slowly. Master them first, then explore new libraries.

Career paths and next steps

After this Next.js roadmap, you can work as a React or Next.js developer, or a full stack JavaScript developer. Many developers build SaaS products or freelance on high-performance marketing sites.

Continue with the Node.js roadmap and the full stack developer roadmap.

Related roadmaps

Next.js Roadmap FAQs

Do I need React before Next.js?

Yes. Next.js is built on React, so understanding components, props, state and hooks first makes Next.js much easier.

Is Next.js frontend or backend?

Both. It renders pages and can also run server code with Server Actions and route handlers.

Is Next.js good for SEO?

Yes. Server rendering, metadata and fast loading make Next.js a strong choice for search-friendly sites.

Do I have to deploy Next.js on Vercel?

No. Vercel is convenient, but Next.js can also run on Node servers, Docker and other platforms.