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:
- Routing – folders and files become URLs
- Rendering – pages can render on the server, at build time, or in the browser
- Data handling – fetch and change data on the server, close to your database
- 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 |
| React | UI library | Add your own | Add your own | Interfaces inside a larger setup |
| Vite + React | Build tool + library | Add React Router | No (client only by default) | Single-page apps, dashboards behind login |
| Next.js | Full-stack React framework | Built in (file-based) | Built in | Websites, e-commerce, SaaS, content sites |
| Remix / React Router 7 | Full-stack React framework | Built in | Built in | Form-heavy, web-standards apps |
| Astro | Content-first framework | Built in | Built in | Blogs 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
- A user requests a URL, such as /courses/sql.
- Next.js matches the URL to a file in the app folder.
- It renders the React components for that route on the server (or uses a version rendered earlier).
- It sends HTML to the browser, plus the JavaScript needed for interactive parts.
- 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 language | You look for "Next.js syntax" instead of using React skills | Remember: it is React plus conventions |
| Following tutorials for old versions | pages/ folder, getServerSideProps, and sync params no longer match current docs | Check the version; this tutorial uses Next.js 16 and the App Router |
| Choosing Next.js for every project | Adds a server you may not need | A 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
Jebasta








