Next.js & React - The Complete Guide
Learn NextJS from the ground up and build fullstack ReactJS + NextJS apps with the App Router or Pages Router!
Learn NextJS from the ground up and build fullstack ReactJS + NextJS apps with the App Router or Pages Router!
This course teaches you the latest version of Next.js and covers both the "App Router" and "Pages Router" (and explains what these two approaches are).
Join this bestselling NextJS course and learn how to build highly dynamic, super fast and SEO-ready React apps with React & NextJS!
This course covers both the NextJS "App Router" & the "Pages Router" - two different approaches for building fullstack apps with React! And, of course, you'll learn what these two approaches are, why two different approaches exist and how each approach works!
I created the bestselling Udemy course on React, now I'm super excited to share this NextJS with you - an in-depth course about an amazing React framework that allows you to take the next step as a React developer and build real, production-ready projects with React and Next.js!
Next.js is the production-ready, fullstack-capable framework for ReactJS - the most popular JavaScript library you can learn these days!
Too many buzzwords for your taste?
Fair enough - but indeed, NextJS is a great choice for growing as a React developer and for taking your React apps to the next level!
Because NextJS is growing fast and therefore in high demand. And there are good reasons for that: NextJS allows you to build React apps with built-in server-side rendering and page pre-rendering. Building great user experiences and search engine friendly (SEO!) React apps has never been easier!
In addition, NextJS makes building fullstack React apps (frontend + backend code combined in one project) extremely easy as well! Blend client-side and server-side code and build a NodeJS-based API side-by-side with your frontend React apps. It's a breeze with NextJS!
Want to add authentication? NextJS simplifies that as well and makes user signup, sign in and session management very convenient.
This course will take you from NextJS beginner to advanced level in no time!
We'll start at the very basics, no NextJS knowledge is required at all, and we'll then dive into all the core features that make up NextJS. Both in theory as well as with multiple real projects where all concepts will be applied step-by-step.
For this course, you'll need basic React knowledge, though the course does come with a "React refresher" module in case it's been some time since you last worked with React.
This course also includes a "NextJS Summary" module for the Pages router and a "NextJS Essentials" module for the App router - which allow you to always come back to the course in the future and refresh your knowledge without going through the full course again. Or you just take those summary modules (and skip the rest for now) to learn about all the core features in as little time as possible.
After finishing this course, you'll be well prepared to build your own NextJS projects from the ground up and apply for NextJS positions!
In detail, this course will cover:
What is NextJS? And why would you use it?
Why is just React (in many cases) not enough?
Creating NextJS projects from the ground up & understanding these projects
Working with file-based routing
Adding dynamic routes and catch-all routes
Implementing different forms of page pre-rendering and server-side rendering
Working with data and adding data fetching + pre-fetching to your apps
Handling form submissions with Server Actions
Handling File upload
Pre-generating dynamic and static pages
Adding optimizations like metadata to pages
Optimizing images with the NextJS Image component
Building fullstack apps with API routes or Server Actions
Managing app-wide state with React context (in NextJS apps)
Adding authentication to NextJS apps
Multiple complete apps where we'll apply all these core concepts!
A complete React.js refresher module (so that we're all on the same page)
A NextJS summary module so that you can refresh what you learned or just explore the core features quickly
And much more!
I can't wait to start this journey together with you! :)
FAQ area empty
Welcome To The Course!
80 Xem trướcWhat Is NextJS? Why Would You Use It?
140 Xem trướcKey Features & Benefits Of NextJS
160 Xem trướcCreating a First NextJS App
265 Xem trướcNextJS vs "Just React" - Analyzing The NextJS Project
150 Xem trướcEditing The First App
141Pages Router vs App Router - One Framework, Two Approaches
149 Xem trướcHow To Get The Most Out Of This Course
185 Xem trướcLearning Community & Course Resources
Using the Code Snasphots
Module Introduction
68What Is React & Why Would You Use It?
337React Projects - Requirements
129Creating React Projects
207Our Starting Project
208Understanding How React Works
466Building A First Custom Component
675Outputting Dynamic Values
303Reusing Components
360Passing Data to Components with Props
375CSS Styling & CSS Modules
607Exercise & Another Component
391Preparing the App For State Management
225Adding Event Listeners
472Working with State
600Lifting State Up
548The Special "children" Prop
441State & Conditional Content
539Adding a Shared Header & More State Management
471Adding Form Buttons
214Handling Form Submission
378Updating State Based On Previous State
330Outputting List Data
398Adding a Backend to the React SPA
370Sending a POST HTTP Request
252Handling Side Effects with useEffect()
546Handle Loading State
263Understanding & Adding Routing
235Adding Routes
336Working with Layout Routes
248Refactoring Route Components & More Nesting
335Linking & Navigating
489Data Fetching via loader()s
547Submitting Data with action()s
667Dynamic Routes
521Module Summary
85IMPORTANT -- LEGACY CONTENT BELOW
Module Introduction
87What is ReactJS?
228Why ReactJS & A First Demo
445Building Single-Page Applications (SPAs)
120React Alternatives
186Creating a New React Project
495Setting Up A Code Editor
184React 18
Diving Into The Created Project
391How React Works & Understanding Components
456More Component Work & Styling With CSS Classes
334Building & Re-using Components
439Passing Data With Props & Dynamic Content
317Handling Events
400Adding More Components
340Introducing State
498Working with "Event Props"
427Use The Right React Router Version
Adding Routing
1012Adding Links & Navigation
320Scoping Component Styles With CSS Modules
345Outputting Lists Of Data & Components
349Adding Even More Components
587Creating "Wrapper" Components
519Working With Forms
538Getting User Input & Handling Form Submission
585Preparing The App For Http Requests & Adding a Backend
411Sending a POST Http Request
318Navigating Programmatically
222Getting Started with Fetching Data
565Using the "useEffect" Hook
607Introducing React Context
662Updating State Based On Previous State
354Using Context In Components
730More Context Usage
414Module Summary
60Module Resources
Module Introduction
80Starting Setup
152Understanding File-based Routing & React Server Components
165Adding Another Route via the File System
186Navigating Between Pages - Wrong & Right Solution
252Working with Pages & Layouts
202Reserved File Names, Custom Components & How To Organize A NextJS Project
391Reserved Filenames
Configuring Dynamic Routes & Using Route Parameters
377Onwards to the Main Project: The Foodies App
84Exercise: Your Task
123Exercise: Solution
499Revisiting The Concept Of Layouts
230Adding a Custom Component To A Layout
358Styling NextJS Project: Your Options & Using CSS Modules
360Optimizing Images with the NextJS Image Component
297Using More Custom Components
228Populating The Starting Page Content
258Preparing an Image Slideshow
205React Server Components vs Client Components - When To Use What
495Using Client Components Efficiently
667Outputting Meals Data & Images With Unknown Dimensions
631Setting Up A SQLite Database
191Fetching Data By Leveraging NextJS & Fullstack Capabilities
437Adding A Loading Page
240Using Suspense & Streamed Responses For Granular Loading State Management
354Handling Errors
322Handling "Not Found" States
117Loading & Rendering Meal Details via Dynamic Routes & Route Parameters
663Throwing Not Found Errors For Individual Meals
123Getting Started with the "Share Meal" Form
113Getting Started with a Custom Image Picker Input Component
508Adding an Image Preview to the Picker
359Improving the Image Picker Component
Introducing & Using Server Actions for Handling Form Submissions
542Storing Server Actions in Separate Files
225Creating a Slug & Sanitizing User Input for XSS Protection
200Storing Uploaded Images & Storing Data in the Database
776Managing the Form Submission Status with useFormStatus
330Adding Server-Side Input Validation
354Using useFormState()
Working with Server Action Responses & useFormState
485Building For Production & Understanding NextJS Caching
366Triggering Cache Revalidations
237Don't Store Files Locally On The Filesystem!
133Bonus: Storing Uploaded Images In The Cloud (AWS S3)
Adding Static Metadata
227Adding Dynamic Metadata
140Module Summary
265Module Introduction
97Project Setup, Overview & An Exercise!
257Exercise Solution - Part 1
437Exercise Solution - Part 2
296App Styling & Using Dummy Data
539Handling "Not Found" Errors & Showing "Not Found" Pages
279Setting Up & Using Parallel Routes
400Working with Parallel Routes & Nested Routes
770Configuring Catch-All Routes
361Catch-All Fallback Routes & Dealing With Multiple Path Segments
561Throwing (Route-related) Errors
218Handling Errors With Error Pages
182Server vs Client Components
610Nested Routes Inside Dynamic Routes
296Intercepting Navigation & Using Interception Routes
311Combining Parallel & Intercepting Routes
462Replace page.js with default.js
Navigating Programmatically
162Defining the Base HTML Document
Using & Understanding Route Groups
399Building APIs with Route Handlers
315Using Middleware
340Module Summary
30Module Introduction
56Adding a Backend
166Option 1: Client-side Data Fetching
530Option 2: Server-side Data Fetching
336Why Use A Separate Backend? Fetching Directly From The Source!
374Showing a "Loading" Fallback
290Migrating An Entire Application To A Local Data Source (Database)
799Granular Data Fetching With Suspense
695Module Introduction
71Starting Project & Analyzing Mutation Options
346Setting Up A Form Action
559Creating a Server Action
256Storing Data in Databases
279Providing User Feedback with The useFormStatus Hook
364Using useFormState Hook
Validating User Input With Help Of The useFormState Hook
597Adjusting Server Actions for useFormState
460Storing Server Actions In Separate Files
237"use server" Does Not Guarantee Server-side Execution!
Uploading & Storing Images
493Alternative Ways of Using, Configuring & Triggering Server Actions
660Revalidating Data To Avoid Caching Problems
285Performing Optimistic Updates With NextJS
702Caching Differences: Development vs Production
373Module Introduction
69Making Sense of NextJS' Caching Types
399Project Setup
105Handling Request Memoization
331Understanding The Data Cache & Cache Settings
451Controlling Data Caching
327Making Sense Of The Full Route Cache
282On-Demand Cache Invalidation with revalidatePath & revalidateTag
363Setting Up Request Memoization For Custom Data Sources
435Setting Up Data Caching For Custom Data Sources
224Invalidating Custom Data Source Data
212Module Summary
104Module Introduction
188Using the NextJS Image Component
223Understanding the NextJS Image Component
315Controlling the Image Size
284Working with Priority Images & More Settings
182Loading Unknown Images
252Configuring CSS For Images With The "fill" Prop
183Using An Image Loader & Cloudinary Resizing
951Page Metadata - An Introduction
64Configuring Static Page Metadata
177Configuring Dynamic Page Metadata
303Understanding Layout Metadata
98Module Introduction
64Project Setup
206User Signup: Extracting & Validating User Input
875Storing Users in a Database - The Wrong Way
270Hashing Passwords & Storing User Data The Right Way
127Checking for Email Duplication
301Theory: How Does User Authentication Work?
321Choosing a Third-Party Auth Package (Lucia)
174Creating a New Lucia Auth Instance
271Configuring A Session & A Session Cookie
371Setting Up An Auth Session
223Verifying An Active Auth Session
435Protecting Routes Against Unauthenticated Access
187Switching Auth Modes With Query Parameters (Search Params)
335Adding User Login (via a Server Action)
334Triggering Different Server Actions via Query Parameters
224Adding an Auth-only Layout
221One Root Layout vs Multiple Root Layouts
Adding User Logout
250From App Router To Pages Router
100Using The Code Snapshots
Module Introduction
72Our Starting Setup
79What Is "File-based Routing"? And Why Is It Helpful?
322Adding A First Page
241Adding a Named / Static Route File
94Working with Nested Paths & Routes
213Adding Dynamic Paths & Routes
294Extracting Dynamic Path Segment Data (Dynamic Routes)
294Building Nested Dynamic Routes & Paths
432Adding Catch-All Routes
344Navigating with the "Link" Component
344Navigating To Dynamic Routes
221A Different Way Of Setting Link Hrefs
175Navigating Programmatically
230Adding a Custom 404 Page
95Module Summary
351Module Resources
Module Introduction
124Planning The Project
255Setting Up The Main Pages
455Adding Dummy Data & Static Files
286Adding Regular React Components
434Adding More React Components & Connecting Components
622Styling Components In Next.js Projects
568<Link> & NextJS 13
Adding Buttons & Icons
505Adding the "Event Detail" Page (Dynamic Route)
511Adding a General Layout Wrapper Component
387Working on the "All Events" Page
125Adding a Filter Form for Filtering Events
505Navigating to the "Filtered Events" Page Progammatically
505Extracting Data on the Catch-All Page
534Final Steps
422Module Summary
100Module Resources
Module Introduction
145The Problem With Traditional React Apps (and Data Fetching)
315How NextJS Prepares & Pre-renders Pages
338Introducing Static Generation with "getStaticProps"
244NextJS Pre-renders By Default!
188Adding "getStaticProps" To Pages
399Running Server-side Code & Using the Filesystem
461A Look Behind The Scenes
320Utilizing Incremental Static Generation (ISR)
442ISR: A Look Behind The Scenes
225A Closer Look At "getStaticProps" & Configuration Options
259Working With Dynamic Parameters
586Introducing "getStaticPaths" For Dynamic Pages
223Using "getStaticPaths"
206"getStaticPaths" & Link Prefetching: Behind The Scenes
239Working With Fallback Pages
327Loading Paths Dynamically
242Fallback Pages & "Not Found" Pages
353Introducing "getServerSideProps" for Server-side Rendering (SSR)
253Using "getServerSideProps" for Server-side Rendering
245"getServerSideProps" and its Context
260Dynamic Pages & "getServerSideProps"
244"getServerSideProps": Behind The Scenes
205Introducing Client-Side Data Fetching (And When To Use It)
220Implementing Client-Side Data Fetching
887A Note About useSWR
Using the "useSWR" NextJS Hook
538Combining Pre-Fetching With Client-Side Fetching
535Module Summary
405Module Resources
Module Introduction
64Preparations
301Adding Static Site Generation (SSG) On The Home Page
662Loading Data & Paths For Dynamic Pages
590Optimizing Data Fetching
467Working on the "All Events" Page
167Using Server-side Rendering (SSR)
592Adding Client-Side Data Fetching
655Module Summary
90Module Resources
Module Introduction
79Analyzing the Need for "head" Metadata
109Configuring the "head" Content
221Adding Dynamic "head" Content
317Reusing Logic Inside A Component
262Working with the "_app.js" File (and Why)
183Merging "head" Content
197The "_document.js" File (And What It Does)
331A Closer Look At Our Images
119Optimizing Images with the "Next Image" Component & Feature
517Taking A Look At The "Next Image" Documentation
51Module Summary
76Module Resources
Module Introduction
50What are "API Routes"?
337Writing Our First API Route
504Preparing the Frontend Form
389Parsing The Incoming Request & Executing Server-side Code
616Sending Requests To API Routes
343Using API Routes To Get Data
476Using API Routes For Pre-Rendering Pages
484Creating & Using Dynamic API Routes
821Exploring Different Ways Of Structuring API Route Files
309Module Summary
104Module Resources
Module Introduction
91Starting Setup & A Challenge For You!
315Adding a Newsletter Route
670Adding Comments API Routes
523Connecting the Frontend To the Comments API Routes
659Setting Up A MongoDB Database
342Running MongoDB Queries From Inside API Routes
554Inserting Comments Into The Database
386Getting Data From The Database
271Adding Error Handling
453More Error Handling
647A Final Note On MongoDB Connections
Module Summary
105Improvement: Getting Comments For A Specific Event
Module Resources
Module Introduction
87Our Target State & Starting Project
272Creating a New React Context
337Adding Context State
229Using Context Data In Components
277Example: Triggering & Showing Notifications
395Example: Removing Notifications (Automatically)
391Challenge Solution
442Module Summary
69Module Resources
Module Introduction
179Setting Up The Core Pages
310Getting Started With The Home Page
329Adding The "Hero" Component
527Adding Layout & Navigation
525Time To Add Styling & A Logo
198Starting Work On The "Featured Posts" Part
347Adding A Post Grid & Post Items
580Rendering Dummy Post Data
745Adding the "All Posts" Page
239Working On The "Post Detail" Page
610Rendering Markdown As JSX
150Adding Markdown Files As A Data Source
452Adding Functions To Read & Fetch Data From Markdown Files
820Using Markdown Data For Rendering Posts
499Rendering Dynamic Post Pages & Paths
702Rendering Custom HTML Elements with React Markdown
Rendering Images With The "Next Image" Component (From Markdown)
766Rendering Code Snippets From Markdown
389Preparing The Contact Form
258Adding The Contact API Route
266Sending Data From The Client To The API Route
446Storing Messages With MongoDB In A Database
532Adding UI Feedback With Notifications
905Adding "head" Data
412Adding A "_document.js" File
175Using React Portals
225Module Summary
84Module Resources
Module Introduction
77Building NextJS Apps: Your Options
485Key Deployment Steps
186Checking & Optimizing Our Code
191The NextJS Config File & Working With Environment Variables
865Running a Test Build & Reducing Code Size
441A Full Deployment Example (To Vercel)
1060A Note On Github & Secret Credentials
117Using the "export" Feature
136Module Summary
38Module Resources
Module Introduction
76Our Starting Project
105How Does Authentication Work (In React & NextJS Apps)?
863Must Read: Install the Right next-auth Version
Using The "next-auth" Library
184Adding A User Signup API Route
779Sending Signup Requests From The Frontend
581Improving Signup With Unique Email Addresses
180Adding the "Credentials Auth Provider" & User Login Logic
848Sending a "Signin" Request From The Frontend
412Managing Active Session (On The Frontend)
357Adding User Logout
138Adding Client-Side Page Guards (Route Protection)
470Adding Server-Side Page Guards (And When To Use Which Approach)
461Protecting the "Auth" Page
346Using the "next-auth" Session Provider Component
314Analyzing Further Authentication Requirements
222Protecting API Routes
397Adding the "Change Password" Logic
636Sending a "Change Password" Request From The Frontend
556Module Summary & Final Steps
209Module Resources
Module Introduction
183What is NextJS?
285Key Feature: Server-side (Pre-) Rendering of Pages
398Key Feature: File-based Routing
193Key Feature: Build Fullstack Apps With Ease
110Creating a NextJS Project & IDE Setup
374About the "App Router"
167Analyzing the Created Project
172Adding First Pages To The Project
365Adding Nested Pages / Paths
227Creating Dynamic Pages
216Extracting Dynamic Route Data
247Linking Between Pages
433Onwards To A Bigger Project!
212Preparing Our Project Pages
222Rendering A List Of (Dummy) Meetups
303Adding A Form For Adding Meetups
234The "_app.js" File & Wrapper Components
377Programmatic Navigation
227Adding Custom Components & Styling With CSS Modules
600How NextJS Page Pre-Rendering Actually Works
352Introducing Data Fetching For Page Generation (getStaticProps)
536More Static Site Generation (SSG) With getStaticProps
344Exploring getServerSideProps
387Working With Dynamic Path Params In getStaticProps
314Dynamic Pages & getStaticProps & getStaticPaths
436Introducing API Routes
380Connecting & Querying a MongoDB Database
572Sending HTTP Requests To API Routes
409Getting Data From The Database (For Page Pre-Rendering)
429Getting Meetup Detail Data & Paths
581Adding "head" Metadata To Pages
559Deploying NextJS Projects
746Working With Fallback Pages & Re-Deploying
253Module Summary
131Module Resources
ReactJS knowledge is strongly recommended, but the course also includes a complete React refresher module
NO prior NextJS knowledge is required
Learn how to build fullstack React apps with NextJS 15 & the App Router
Build real projects and apply what you learned with hands-on projects and examples
Learn about different ways of building NextJS app - App Router vs Pages Router
Get started with React Server Components, Client Components, data fetching & more!
Handle data submissions via Server Actions
Learn all key NextJS features like pre-rendering, SSR, data fetching, file-based routing and authentication
Take the full course or the "NextJS Summary" module for a quickstart if you have limited time