Week 3 — Next.js Getting Started
Build App Router foundations while keeping Nest as the owner of the product API — then ship a Next blog/dashboard mini-project.
- 1. Install and run Next.jsOpen
Start by running the web application that already exists in this workspace instead of creating a second app.
- 2. Understand project structureOpen
A predictable tree lets you trace an Course screen from its URL to its route component and supporting code.
- 3. Use layouts and pagesOpen
Choose the file that owns UI so navigation, providers, and page-specific data do not become tangled.
- 4. Link and navigateOpen
Navigation should preserve the app experience while retaining normal browser behavior for external destinations.
- 5. Choose Server and Client ComponentsOpen
The boundary controls bundle size, available APIs, and whether code can safely access server-only values.
- 6. Fetch data in Next.jsOpen
Fetching strategy follows rendering and ownership requirements, not a desire to replace the product API.
- 7. Mutate data safelyOpen
Interactive product writes use Nest endpoints and TanStack Query mutations in this monorepo.
- 8. Understand cachingOpen
Next server caches and TanStack Query’s browser cache solve different problems and must not be confused.
- 9. Revalidate stale dataOpen
The correct revalidation mechanism depends on which cache contains the stale representation.
- 10. Handle loading and errorsOpen
Route boundaries complement, rather than replace, request states inside interactive client components.
- 11. Style Next.js applicationsOpen
Style ownership should be as deliberate as component ownership so visual changes remain predictable and accessible.
- 12. Optimize imagesOpen
Image optimization improves loading experience, but it does not make untrusted remote hosts or misleading alt text safe.
- 13. Optimize fontsOpen
Typography affects readability and performance because late font swaps can move content after users begin reading.
- 14. Add metadata and Open Graph imagesOpen
Good metadata represents the current route accurately rather than repeating generic application copy.
- 15. Use Route Handlers without replacing NestOpen
Keeping ownership clear prevents ticket rules, authentication, and validation from drifting across two servers.
- 16. Use Next proxying carefullyOpen
Proxying can simplify a browser path, but it must preserve cookie, CORS, and error behavior intentionally.
- 17. Deploy Next.jsOpen
The deployed web app must communicate safely with the separately deployed Nest API without exposing secrets.
- 18. Upgrade Next.jsOpen
Next upgrades can affect rendering, routing, caching, and dependencies, so they need a focused and evidence-based change.
End-of-week mini-project · practice only
Next blog / dashboard shell
Host a small blog or dashboard in the Next App Router with layouts, Link, Server/Client boundaries, and Nest-backed data via Query.
Definition. A Next blog/dashboard mini-project applies App Router layouts, pages, Link navigation, Server vs Client Components, and Provider placement while Nest remains the product API owner.
In simpler words. Build routes and a layout in Next. Interactive lists/forms stay in Client Components. Data still comes from Nest through Query.
Deliverables
- App Router routes: e.g. /blog, /blog/[slug] or /dashboard + one detail route
- Shared layout with next/link nav; metadata on pages
- Server Component page shell composing a Client Component board/list
- QueryClientProvider (+ RTK Provider if you carry drafts) only on the client subtree
- Loading / error UI; no product CRUD in Next Route Handlers
Acceptance checklist
- [ ] use client only on interactive leaves + providers module
- [ ] Redux/Query Provider is not on a Server Component file
- [ ] Internal nav uses next/link
- [ ] At least one dynamic segment or filtered list view
- [ ] Nest remains API owner (no duplicate CRUD in Route Handlers)
- [ ] Metadata set on the main pageTips
- Reuse Week 2 Query patterns inside Client Components — do not invent a second data layer.
- Official Learn Next.js path under /resources complements this brief.
- Keep secrets and JWT handling on Nest; the browser only sends cookies.