๐ฏ By the end of this lesson you canโฆ
- Explain what Next.js adds on top of React
- Create a new Next.js project
- Recognise the project structure
| Need | React alone | Next.js |
|---|---|---|
| Multiple pages / URLs | add a router library | built in (folders) |
| Fast first load + SEO | HTML arrives empty | pages rendered on the server |
| Data from a database | build a separate API | server components & server actions |
| Images, fonts | do it yourself | optimised components |
| Deployment | configure it yourself | one click on Vercel |
โจ๏ธ Terminal
terminal
1npx create-next-app@latest my-notes2cd my-notes3npm run dev
๐ Text
project-structure.txt
1my-notes/2โโ app/3โ โโ layout.jsx โ wraps every page (html, body, nav)4โ โโ page.jsx โ the home page โ /5โ โโ about/6โ โโ page.jsx โ the about page โ /about7โโ public/ โ images and files served as-is8โโ package.json9โโ next.config.js
๐ก Concept check
In the App Router, which file makes the page at
/contact?๐ Key takeaways
- Next.js = React + routing + server rendering + data fetching + APIs + optimisations.
- Create a project with
npx create-next-app@latest. - The
app/folder is your website: folders are URLs.
Finished reading & practising?
Saved in this browser. Create a free account to keep it forever.