In Week 6 you built a client-side portfolio with React Router and Vite and deployed it as a static app on Vercel. This assignment migrates that project to the Next.js App Router, then adds capabilities that a server-aware framework makes possible for the first time.
npx create-next-app@latest portfolio-next --yes
cd portfolio-next
npm run dev
Don't copy files in bulk yet - recreate the structure deliberately.
Map each React Router route to an app/ folder.
Add "use client" to any component that uses useState, useEffect, or event handlers. Move your shared nav/footer into app/layout.tsx.
Link from next/linkuseRouter from next/navigationparams prop on the Server Component (or useParams() in a Client Component)Your app should now render correctly. Test every route in the browser before moving on.
useEffect, useState, and the loading stateasync and await the data directly in the component body"use client" directiveIf you haven’t already, move your projects data to a separat projects.ts data file
/projects/[id]app/projects/[id]/loading.tsx - shown while data is fetchingapp/projects/[id]/not-found.tsx - shown for missing IDs; call notFound() from the page when the fetch returns nothingapp/contact/actions.ts with "use server" at the topFormData, validates that name and message are non-empty, and logs the submissionrevalidatePath('/contact') at the end<form action={sendMessage}> - no useState for field valuesExport a metadata object from /, /projects, and /contact. Use generateMetadata for /projects/[id] so each detail page has a title that includes the project name.
Push your Next.js project to a new GitHub repository and deploy it to Vercel. After deploying, check the build output for the static/dynamic route split.
/ working before touching /projects."use client" error, read the message - it tells you exactly which component needs the directivenpm run build locally before deploying to catch errors that only surface in production modeFollow the Assignment submission guide to learn how to submit the assignment.
Make sure to include the vercel URL in your PR.
The 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.