What is Next.js?
Next.js Basics
Preview
Why Next.js
Plain React runs entirely in the browser, which hurts SEO and first load. Next.js adds server rendering and a huge toolbox, with zero extra config.
What you get
- File-based routing — folders become URLs
- Server components — data fetched on the server
- Built-in image and font optimisation
- API routes for your own endpoints
- One-command deployment to Vercel
Create a project
npx create-next-app@latest my-app\ncd my-app\nnpm run devThe app folder
app/\n├─ layout.js # shared shell\n├─ page.js # home page /\n├─ about/page.js # /about\n└─ globals.cssFile → URL mapping
| File | URL |
|---|---|
| app/page.js | / |
| app/about/page.js | /about |
| app/courses/page.js | /courses |
| app/courses/[id]/page.js | /courses/42 |
Tip: In the App Router,page.jsis the page content andlayout.jsis the shared shell around it.
This is a free preview lesson
Enroll in the Next.js Development to unlock every lesson, lesson PDF guides, quizzes and your certificate - and start creating your own pieces today.