Skip to content
Getting StartedChapter 1 / 34Beginner4 min read

Introduction

What is Next.js? A beginner's start with Next.js 16, why this framework was built on top of React, and how the App Router works.

On this page

1. What is Next.js?

React is only a UI library. It teaches you how to build components, but leaves routing, SEO, the server, bundling and deployment for you to decide. Next.js makes those decisions for you up front, so you can focus on building the app.

In this course we cover Next.js 16 and the App Router (the app/ folder). The old pages/ router still works, but new projects are built with the App Router.

Next.js = React + full-stack features
React components
File-based routing
Server Components
Data fetching and caching
Turbopack build
Production-ready web app

2. Why does it matter?

With plain React (like a Vite setup), the page is built in the browser after the JavaScript loads. That delays the first paint, weakens SEO, and means you need a separate library for routing.

Plain React (client-side)Next.js App Router
A separate library for routingFolders are the routes
Empty HTML, content after JS loadsHTML is built on the server and sent
Extra work for SEOBuilt-in Metadata API
A separate backend for APIsRoute Handlers and Server Actions
You configure the bundlerTurbopack by default, zero config
Data fetching in useEffectA direct await in a Server Component

Put simply, Next.js lets you write both frontend and backend in one project.

3. Where is it used?

AreaWhat you build with Next.js
Marketing sitesFast, SEO-friendly landing pages and blogs
E-commerceProduct pages, cart, checkout, search
SaaS dashboardsPanels behind auth, settings, reports
Docs and contentMDX docs, knowledge bases (like this ZnPedia)
Full-stack appsA database, forms and APIs in a single codebase

4. How does it work?

The mental model of Next.js is: every request matches a route, the route's components render on the server, and only the necessary JavaScript goes to the browser.

From request to screen
The browser sends a /blog request
Next.js finds app/blog/page.tsx
Server Components render on the server
HTML + RSC payload go to the browser
Client Components hydrate
The page is interactive

In Next.js 16 the bundler is Turbopack by default, proxy.ts is used to intercept requests, and caching is opt-in through Cache Components ("use cache").

5. Code example

A tiny Next.js page. The file's name and location create the route.

tsx
export default async function HomePage() {
  const res = await fetch("https://api.github.com/repos/vercel/next.js");
  const repo = await res.json();

  return (
    <main>
      <h1>Welcome to Next.js</h1>
      <p>Stars on the Next.js repo: {repo.stargazers_count}</p>
    </main>
  );
}

Put this file in app/page.tsx and this page shows up on the / route.

How does the code work?

PartMeaning
app/page.tsxThis file's location creates the / route
export defaultEvery page has one default exported component
async functionA Server Component can be async
await fetch(...)The data is fetched on the server, not in the browser
<main> JSXTurned into HTML on the server and sent to the browser

Interview tip

If you are asked, "What is the difference between React and Next.js?", say: React is a UI library, while Next.js is a full-stack framework built on React that provides routing, server rendering, caching and build tooling.

6. Common mistakes

Mistake: Thinking Next.js replaces React

Why? Next.js uses React inside, and the components, hooks and JSX are the same.

Better: Learn React basics first, then see Next.js as a framework layer on top of React.

Mistake: Adding use client to every component

Why? This throws away the benefit of server rendering and makes the JavaScript bundle bigger.

Better: Keep Server Components as the default, and make only the interactive parts Client Components.

Mistake: Following old Pages Router tutorials

Why? getServerSideProps and getStaticProps do not work in the App Router.

Better: Follow docs and tutorials for Next.js 16 and the app folder.

7. What to learn before and after

Suggested order
JavaScript
React basics
Next.js setup
Routing and layouts
Server and Client Components
Data fetching and caching

Final quick revision

PointDetail
What Next.js isA full-stack framework built on React
RouterApp Router, the app/ folder
Default componentServer Component
BundlerTurbopack (the Next.js 16 default)
CachingOpt-in, with "use cache"
Request interceptionproxy.ts