Next.js App Router: SSR, Routing and Data

Harry · 28 Sep 2026 · 1 views
Log in to track your progress and mark lessons complete.

Why Next.js After React

SEO, first-load speed, API routes and image optimisation out of the box. Most React jobs are actually Next.js jobs now.

Setup and Structure

npx create-next-app@latest shop --typescript --tailwind --app
app/
  page.js            # route /
  books/page.js      # route /books
  books/[id]/page.js # route /books/42
  layout.js          # shared shell

Server vs Client Components

// app/books/page.js - server component (default):
export default async function Books() {
  const res = await fetch("https://api.../books", { next: { revalidate: 60 } })
  const books = await res.json()
  return books.map(b => <BookCard key={b.id} {...b} />)
}
// interactive bits get "use client" at the top

Rendering Modes in One Minute

  • SSG - pre-built HTML, fastest, blogs/docs.
  • SSR - fresh HTML per request, dashboards.
  • ISR - static plus revalidate timer, best of both.

Next.js SSG versus SSR versus ISR

Key Points

  • App Router: folders are routes, files are UI.
  • Fetch on the server, interact on the client.
  • Start with SSG/ISR; reach for SSR only with reason.
Share this post:

Comments (0)

Please login or register to comment.

Create a free account to keep reading

You've enjoyed a free tutorial! Register (it's free) to unlock every tutorial, track your progress and save code.

or sign in with your account

Already have an account? Log in