Next.js is a React framework built by Vercel. It extends React with server-side rendering, built-in routing, and optimisations for images, fonts, and deployment. Where a plain React app runs entirely in the browser, Next.js can render pages on the server and send real HTML to the browser - so users see content immediately, without waiting for JavaScript to load.
In Week 6 you built a client-side portfolio with React Router and Vite. This week you migrate that app to Next.js. You'll replace React Router's config-based routing with Next.js's file system routing, convert useEffect data fetching into async Server Components, and handle form submissions with Server Functions instead of separate API calls. You'll also use special files - loading.tsx, not-found.tsx that Next.js picks up automatically to handle loading and error states.
The biggest change is understanding what runs where. In a React Router app, everything runs in the browser. In Next.js, components run on the server by default - they can fetch data directly, access environment variables, and send rendered HTML to the browser. Only the parts that need interactivity run in the browser, and those are explicitly marked with "use client". Once that model is clear, the rest of Next.js follows naturally.
page.tsx to make a segment publicly accessible, layout.tsx to wrap child routes, and [param] folders for dynamic segments"use client" only when a component uses state or browser APIs, and know what each type can and can't doawait data directly in an async component body without useEffect or manual loading state"use server", read form data from FormData, and call revalidatePath to refresh stale cached dataloading.tsx for Suspense fallbacks, error.tsx for error boundaries, and not-found.tsx with notFound() for 404sThe HackYourFuture curriculum is licensed under CC BY-NC-SA 4.0 *https://hackyourfuture.net/*

Built with ❤️ by the HackYourFuture community · Thank you, contributors
Found a mistake or have a suggestion? Let us know in the feedback form.