Web Dev Academy Meta-frameworks · Next.js Tool 19 / 64
Meta-frameworks

Next.js

The React meta-framework. File-based routing, server rendering, API routes and image optimisation — Next.js turns React into a full production app.

Demo 01

File → Route mapper

Interactive simulation

Next.js's signature power: the file system is the router. Drop a file in app/ and it becomes a URL — no route config. Click a file to see the URL it generates and the page it renders.

app/ directory

  • app/page.tsx
  • app/about/page.tsx
  • app/blog/page.tsx
  • app/blog/[slug]/page.tsx
  • app/dashboard/settings/page.tsx
  • app/api/hello/route.ts

generates URL

/
localhost:3000/
Home page

A page.tsx file becomes a routable page automatically.

// app/blog/[slug]/page.tsx  →  /blog/:slug
export default function Post({ params }) {
  return <h1>Post: {params.slug}</h1>
}
Demo 02

SSR vs CSR — first paint timeline

Interactive simulation

A plain React app (CSR) ships an empty page, then JavaScript builds the UI in the browser. Next.js renders HTML on the server (SSR) so the user sees content almost instantly. Press play to race them.

Next.js
SSR
content visible
React SPA
CSR
content visible
SSR: HTML arrives ready — fast first paint, great SEOCSR: blank until JS loads & renders
Demo 03

API routes — backend in the same project

Interactive simulation

A route.ts file becomes a real HTTP endpoint. No separate server — your frontend and backend live together. Click fetch to simulate calling /api/hello.

// response will appear here
// app/api/hello/route.ts
export async function GET() {
  return Response.json({ message: "Hello from the server" })
}
Demo 04

<Image> — automatic optimisation

Interactive simulation

Next's <Image> lazy-loads, resizes and serves modern formats automatically, with a blur placeholder while it loads. Toggle to compare a raw <img> with the optimised version.

Raw <img>

~300 KB · full size · loads eagerly

next/image optimised

blur placeholder → ~40 KB WebP, lazy

i
Demos are interactive simulations built with vanilla JS — Next.js runs via a build step / Node server and can't execute inside a static page. The real Next.js code is shown in the dark code blocks above.

↑ All 64 tools