🌍 NextJS · subject

NextJS Next.js Basics Syllabus

The Next.js Basics syllabus for NextJS in full: 3 chapters and 11 topics, every one listed below, plus 51 Next.js Basics flashcards with answers.

3Chapters
11Topics
51Flashcards

Next.js Basics syllabus: all 3 chapters

Expand any chapter to see its topics and sub-topics.

  1. Introduction

    3 topics
    • What is Next.js?
    • History and Evolution
    • Core Features
  2. Setup and Installation

    4 topics
    • System Requirements
    • Installing Node.js and npm
    • Creating a New Next.js Project
    • Project Structure Overview
  3. Core Concepts

    4 topics
    • Pages and Routing
    • Static and Dynamic Routing
    • Link Component
    • API Routes

NextJS Next.js Basics flashcards — 51 questions with answers

  1. What is Next.js?

    Next.js is an open-source React framework, built and maintained by Vercel, that adds production features on top of React such as server-side rendering (SSR), static site generation (SSG), file-based routing, API routes, and built-in optimizations for building full-stack web applications.

  2. Who created and maintains Next.js?

    Next.js was created by the company Vercel (formerly ZEIT) and is maintained by Vercel together with the open-source community.

  3. Next.js is a framework built on top of which JavaScript library?

    React. Next.js is a React framework that extends React with rendering, routing, and tooling features.

  4. What core problem was Next.js designed to solve that plain React (a client-side SPA) struggles with?

    Plain client-side React renders in the browser, causing poor SEO and slow initial load. Next.js solves this by enabling server-side rendering and static generation so pages arrive pre-rendered as HTML, improving SEO and time-to-first-content.

  5. In what year was Next.js first released?

    Next.js was first released in 2016 (version 1.0, in October 2016).

  6. Which Next.js version introduced the App Router as the recommended routing paradigm?

    Next.js 13 (released in 2022) introduced the App Router (the app/ directory) built on React Server Components; it became stable in Next.js 13.4.

  7. What are the two routing systems available in modern Next.js, and which directories do they use?

    The Pages Router (uses the pages/ directory, the original system) and the App Router (uses the app/ directory, introduced in Next.js 13 and built on React Server Components).

  8. Name at least four core features of Next.js.

    File-based routing, server-side rendering (SSR), static site generation (SSG), incremental static regeneration (ISR), API routes, automatic code splitting, built-in image/font optimization, and fast refresh.

  9. What is 'file-based routing' in Next.js?

    A routing system where the file and folder structure inside the routing directory (pages/ or app/) automatically defines the application's URL routes, so no manual route configuration is needed.

  10. What are the four main rendering strategies Next.js supports?

    Client-Side Rendering (CSR), Server-Side Rendering (SSR), Static Site Generation (SSG), and Incremental Static Regeneration (ISR).

  11. What is the difference between SSR and SSG in Next.js?

    SSR (Server-Side Rendering) generates the HTML on the server on every request at runtime, while SSG (Static Site Generation) generates the HTML once at build time and serves the same pre-built page for all requests.

  12. What is Incremental Static Regeneration (ISR) in Next.js?

    ISR lets you update static pages after build time by regenerating individual pages in the background on a defined revalidation interval, combining the speed of static generation with the freshness of dynamic data.

  13. What is 'automatic code splitting' in Next.js and why does it matter?

    Next.js automatically splits code so each page only loads the JavaScript it needs, rather than one large bundle. This reduces initial load time and improves performance.

  14. What is Fast Refresh in Next.js?

    Fast Refresh is a development feature that instantly reflects edits to React components in the browser while preserving component state, giving near-instant feedback without a full page reload.

  15. What is the minimum Node.js requirement for recent versions of Next.js (Next.js 14+)?

    Next.js 14 requires Node.js 18.17 or later. (Next.js 13 required Node.js 16.14+.)

  16. Which operating systems can you run Next.js development on?

    Next.js is cross-platform and runs on Windows, macOS, and Linux, since it runs on the Node.js runtime.

  17. What is Node.js?

    Node.js is a JavaScript runtime built on Chrome's V8 engine that lets JavaScript run outside the browser (e.g., on a server). Next.js requires Node.js to build and run applications.

  18. What is npm?

    npm (Node Package Manager) is the default package manager bundled with Node.js, used to install, manage, and share JavaScript packages and dependencies.

  19. When you install Node.js, what package manager is installed alongside it automatically?

    npm (Node Package Manager) is bundled with and installed automatically alongside Node.js.

  20. Which command checks the installed Node.js version, and which checks the npm version?

    $node -v$ (or node --version) checks the Node.js version, and $npm -v$ (or npm --version) checks the npm version.

Show the other 31 Next.js Basics flashcards
  1. Name three popular package managers you can use with a Next.js project besides npm.

    Yarn, pnpm, and Bun are common alternatives to npm for managing Next.js dependencies.

  2. What is the recommended command to create a new Next.js project?

    npx create-next-app@latest — this scaffolds a new Next.js application with an interactive setup for TypeScript, ESLint, Tailwind, the App Router, and more.

  3. What does the '@latest' mean in the command 'npx create-next-app@latest'?

    It tells npx to fetch and use the latest published version of the create-next-app package, ensuring the newest scaffolding template is used.

  4. What does 'npx' do that 'npm install' does not?

    npx executes a package's binary directly (downloading it temporarily if needed) without permanently installing it as a project dependency, which is ideal for one-off scaffolding tools like create-next-app.

  5. After creating a Next.js project, which command starts the development server?

    npm run dev — it starts the local development server, typically at http://localhost:3000.

  6. On which port does the Next.js development server run by default?

    Port 3000 (accessible at http://localhost:3000).

  7. What are the standard npm scripts in a Next.js project for development, building, and production start?

    npm run dev (start dev server), npm run build (create optimized production build), and npm run start (serve the production build).

  8. In a Next.js project, what is the purpose of the package.json file?

    package.json lists the project's metadata, dependencies, and npm scripts (like dev, build, start), and defines how the project is configured and run.

  9. What is the purpose of the next.config.js file?

    next.config.js is the configuration file for customizing Next.js behavior, such as environment variables, redirects, rewrites, image domains, and experimental features.

  10. In the App Router, what is the role of the app/ directory?

    The app/ directory holds the application's routes, layouts, and pages using React Server Components; each folder maps to a route segment and defines the routing structure.

  11. In the Pages Router, what is the special role of the pages/ directory?

    Each file in pages/ automatically becomes a route based on its filename, and files inside pages/api/ become API endpoints.

  12. What is the purpose of the public/ folder in a Next.js project?

    The public/ folder serves static assets (images, fonts, robots.txt, etc.) directly from the root URL; a file at public/logo.png is accessible at /logo.png.

  13. In the App Router, what does a page.js (or page.tsx) file define?

    page.js defines the unique UI for a route segment and makes that route publicly accessible; a route is only reachable if it has a page file.

  14. In the App Router, what does a layout.js file do?

    layout.js defines shared UI (like headers or navigation) that wraps a segment and its children; layouts persist across navigation and preserve state, and a root layout is required.

  15. In the Pages Router, how does the file pages/about.js map to a URL?

    It maps to the route /about — the filename (minus extension) becomes the URL path.

  16. In the Pages Router, what URL does the file pages/index.js correspond to?

    The index file maps to the root of its directory, so pages/index.js corresponds to / (the home page).

  17. What is the difference between static routing and dynamic routing in Next.js?

    Static routing maps fixed file paths to fixed URLs (e.g., pages/about.js → /about), while dynamic routing uses bracketed parameters (e.g., [id]) to match variable URL segments at runtime.

  18. How do you define a dynamic route in the Pages Router for a URL like /posts/123?

    Create a file with square brackets around the parameter name, e.g., pages/posts/[id].js; the value 123 is then available as the id route parameter.

  19. In the App Router, how do you create a dynamic route segment?

    Wrap the folder name in square brackets, e.g., app/posts/[id]/page.js. The dynamic value is passed to the page via the params object (params.id).

  20. What is a catch-all route in Next.js and how is it written?

    A catch-all route matches multiple path segments using three dots inside brackets, e.g., [...slug].js, which matches /a, /a/b, /a/b/c and provides the segments as an array.

  21. What is the difference between a catch-all route [...slug] and an optional catch-all route [[...slug]]?

    [...slug] requires at least one segment to match, while the optional catch-all [[...slug]] (double brackets) also matches the parent route with zero segments.

  22. In the Pages Router, how do you access dynamic route parameters inside a component?

    Use the useRouter hook from next/router and read router.query — e.g., const { id } = useRouter().query.

  23. What is the Link component in Next.js and where is it imported from?

    Link is Next.js's component for client-side navigation between routes, imported from 'next/link'. It enables SPA-like transitions without a full page reload.

  24. Why should you use the Next.js Link component instead of a plain <a> tag for internal navigation?

    Link performs client-side navigation and automatically prefetches linked pages, giving faster transitions without a full page reload, whereas a plain <a> tag triggers a full browser reload.

  25. What is the basic syntax for linking to an /about page with the Next.js Link component?

    <Link href="/about">About</Link> — the href prop specifies the destination route.

  26. What does prefetching mean in the context of the Next.js Link component?

    Prefetching means Next.js automatically loads the JavaScript/data for a linked route in the background (e.g., when the Link enters the viewport), so navigation feels instant when clicked.

  27. What are API Routes in Next.js?

    API Routes let you build backend API endpoints within the same Next.js project. In the Pages Router they live in pages/api/, and each file becomes an HTTP endpoint handled by serverless-style functions.

  28. In the Pages Router, what URL does the file pages/api/users.js map to?

    It maps to the endpoint /api/users.

  29. In the Pages Router, what is the standard function signature of an API route handler?

    export default function handler(req, res) { ... } — where req is the incoming request object and res is the response object used to send back data.

  30. In the App Router, how do you define an API endpoint (Route Handler)?

    Create a route.js (or route.ts) file inside the app directory and export functions named after HTTP methods, e.g., export async function GET(request) { ... } or POST, PUT, DELETE.

  31. Why are Next.js API Routes useful for full-stack development?

    They let you write backend logic (database access, authentication, third-party API calls) in the same codebase as your frontend, avoiding a separate server and keeping secrets out of the client bundle.

NextJS Next.js Basics FAQ

What is in the NextJS Next.js Basics syllabus?

NextJS Next.js Basics is split into 3 chapters: Introduction, Setup and Installation and Core Concepts. Together they contain 11 topics.

How many chapters are in NextJS Next.js Basics?

3 chapters, containing 11 topics. The largest chapter is Setup and Installation, with 4 topics.

Are there flashcards for NextJS Next.js Basics?

Yes — a 51-card Next.js Basics deck, printed in full in the flashcards section of this page and available in the Examius app with spaced repetition. The free plan covers one exam of your choice, including its flashcards; Examius Pro, a one-time purchase, unlocks every other exam and deck.