Menu

What is Next.js?

Lesson 1: What is Next.js?

Next.js is an open-source React framework for building full-stack web applications. It is created and maintained by Vercel, but it runs on any Node.js server or hosting platform.

It combines four things:

  1. Routing – folders and files become URLs
  2. Rendering – pages can render on the server, at build time, or in the browser
  3. Data handling – fetch and change data on the server, close to your database
  4. Tooling – a bundler (Turbopack), TypeScript support, image and font optimisation

The aim is not to replace React. You still write React components. Next.js decides where and when those components run.

How it differs from related tools:

Tool

What it is

Routing

Server rendering

Typical use

ReactUI libraryAdd your ownAdd your ownInterfaces inside a larger setup
Vite + ReactBuild tool + libraryAdd React RouterNo (client only by default)Single-page apps, dashboards behind login
Next.jsFull-stack React frameworkBuilt in (file-based)Built inWebsites, e-commerce, SaaS, content sites
Remix / React Router 7Full-stack React frameworkBuilt inBuilt inForm-heavy, web-standards apps
AstroContent-first frameworkBuilt inBuilt inBlogs and docs with little interactivity

These tools overlap, and teams often choose based on hosting, existing skills, and the type of site.

Why is it used?

Teams use Next.js to:

  • Improve load speed – send ready-made HTML so users see content quickly
  • Improve SEO – search engines receive full HTML instead of an empty page
  • Build full-stack apps – UI, APIs, and database access live in one project
  • Ship less JavaScript – Server Components never send their code to the browser
  • Scale content – generate thousands of product or blog pages efficiently

Examples:

  • An e-commerce site renders product pages ahead of time so they load instantly.
  • A learning platform shows a personalised dashboard after login.
  • A news site updates articles every few minutes without rebuilding the whole site.

Example

In plain React with a client-only setup, the server sends an almost empty HTML file:

<body>
<div id="root"></div>
<script src="/bundle.js"></script>
</body>

The browser must download and run bundle.js before any content appears. In Next.js, the same page arrives with its content already in the HTML:

<body>
<h1>Introduction to SQL</h1>
<p>12 lessons · Beginner</p>
<script src="/_next/static/chunks/..."></script>
</body>

The user sees the course title immediately. JavaScript then loads and makes the page interactive. This step is called hydration.

How it works

  1. A user requests a URL, such as /courses/sql.
  2. Next.js matches the URL to a file in the app folder.
  3. It renders the React components for that route on the server (or uses a version rendered earlier).
  4. It sends HTML to the browser, plus the JavaScript needed for interactive parts.
  5. Later navigations happen on the client, so moving between pages feels instant.

Common mistakes

Mistake

Why it hurts

Fix

Treating Next.js as a different languageYou look for "Next.js syntax" instead of using React skillsRemember: it is React plus conventions
Following tutorials for old versionspages/ folder, getServerSideProps, and sync params no longer match current docsCheck the version; this tutorial uses Next.js 16 and the App Router
Choosing Next.js for every projectAdds a server you may not needA small internal tool behind login may only need Vite + React

Key takeaways

  • Next.js is React plus routing, rendering, data handling, and tooling.
  • Its main benefits are fast first loads, SEO, and full-stack development in one project.
  • Always ask: "Does this project need server rendering, SEO, or a backend?"

Try it: Open two websites you use often. View the page source (Ctrl + U). Check whether the main content appears in the HTML or only an empty div.


Nextjs Tutorial

J

Jebasta





Get in Touch For Details