Daily theme and context
By Day 9 the Tracker works, but everything sits on one page and only runs on your own computer. Today it becomes a proper multi-page application, with its own address for each screen, and it goes live on the internet on Vercel. That closes the Tracker: it has done its job of teaching the frontend on a problem everyone shares. If you want to keep building it, you can choose it as your P1.
Today you also finish the P1 scope document: the plan for the product you'll build from Week 3 to Week 6. Then the week ends with the Week 2 no-AI drill, your self-rating, and Release Gate 2.
This is Week 2 of the Pilot Cohort's six-week Learn phase ("Frontend"), Day 10 of 30 learning days, and the last day of the week. Day 10 starts at the Friday (27 Nov) 9 pm class; Quest 2 and Release Gate 2 are due by Sunday 29 Nov, 11:59 pm WAT. It has four blocks, about 6 hours, done whenever suits you except the stand-up: Learn (2 hours, covered in full below), Build (2 hours, section 10: going live, then the P1 scope document), Flex (1 hour: on the last day of each week this is the no-AI drill and your 2-minute self-rating, section 11), and the live stand-up at 9 pm WAT (1 hour).
Learning objectives
By the end of today, the learner should be able to:
- Create pages in the Next.js App Router with folders and
page.tsxfiles, and explain how a folder becomes an address. - Share navigation and structure across pages with layouts, and move between pages with
Link. - Explain the difference between server and client components at an introductory level, and when
"use client"is needed. - Deploy a Next.js app to Vercel from GitHub, and explain what happens on each new push.
- Write a complete P1 scope document that passes the scope gate.
- Explain the Tracker's frontend out loud for Release Gate 2.
Prerequisite knowledge
Day 9's Tracker with dashboard, directory, attendance and registration working on state; Day 9's P1 scope draft (parts 1 to 3).
TechDojo core lesson
Folders become addresses
In the Next.js App Router, the folder structure inside app is the list of pages:
app/page.tsx → /
app/learners/page.tsx → /learners
app/attendance/page.tsx → /attendance
app/learners/[id]/page.tsx → /learners/1, /learners/2, …
A folder makes a part of the address; a page.tsx inside it makes that address a real page. Square brackets ([id]) make a dynamic part: one file handles every learner's profile, and reads which learner from the address:
// app/learners/[id]/page.tsx
import { learners } from "@/lib/learners";
export default async function LearnerProfile({ params }: { params: Promise<{ id: string }> }) {
const { id } = await params;
const learner = learners.find((l) => l.id === Number(id));
if (!learner) {
return <p>Learner not found.</p>;
}
return <h1>{learner.name}</h1>;
}
// app/learners/[id]/loading.tsx
export default function Loading() {
return <p>Loading learner…</p>;
}
Don't skip loading.tsx. The version of Next.js you installed builds as much of each page as it can in advance, but a profile depends on the address, which is only known when someone visits. loading.tsx tells Next.js what to show in the meantime (Day 7's loading state again). Without it, the page still works with npm run dev, but the console shows a "runtime data during prerendering" error and npm run build fails, so Vercel can't deploy your app.
Three more things trip people up here. params arrives as a promise, so the page is async and uses await (Day 7). The id from the address is always text, so convert it with Number(...) before comparing (Day 6's ===). And find gives undefined for an id that doesn't exist, so check before you use it. AI assistants often write older Next.js code: without await, or without loading.tsx. Your project's AGENTS.md file warns them that this version has changed, but check anyway; anything they get wrong is a finding for your AI-use journal.
Layouts
app/layout.tsx (from Day 8) wraps every page, so the navigation and footer appear everywhere without being repeated. You can also add a layout.tsx inside a folder to wrap only the pages in that folder. A layout stays on screen when you move between its pages; only the page part changes.
Moving between pages: Link
Use the Link component instead of a plain <a> tag for pages inside your app:
import Link from "next/link";
<Link href="/attendance">Attendance</Link>
Link moves to the new page without reloading the whole site, so navigation feels instant.
Server and client components, the short version
By default, every component in the App Router is a server component: it is turned into HTML before it reaches the browser. That makes pages fast and keeps secrets (like a database password in Week 3) off the user's device. But server components can't hold state or respond to clicks. A component that uses useState or onClick must be a client component, which is why Day 9's interactive parts start with "use client";.
A practical rule for now: keep pages as server components where you can, and put "use client" only on the interactive pieces (the attendance list, the form). Week 3 builds on this when real data arrives.
Shared state across pages
On Day 9, all four sections shared one learner list in state. Once they're separate pages, each page would start with its own copy, and changes on one page wouldn't show on another. That is expected at this stage, and it's exactly the problem a database solves in Week 3. For today, split Day 9's TrackerBoard up: each interactive page (attendance, registration) gets its own small client component holding its own copy of the sample data, and the dashboard and learners pages just read the sample data. Don't spend time building a workaround.
Going live with Vercel
Vercel is the hosting service made by the creators of Next.js. You connect it to your GitHub repository once; after that, every push to main deploys automatically, and every pull request gets its own preview link that a reviewer can open. You get a free address like tracker-yourname.vercel.app. The free Hobby plan is for personal, non-commercial projects; keep that in mind for your running-cost note. Before deploying, run npm run build on your own machine: if it fails locally, it will fail on Vercel too, and the error message is easier to read on your machine.
- 1
npm run buildOn your machine first: errors are easier to read here - 2Push to GitHubBranch, pull request, merge
- 3Preview linkEvery pull request gets its own
- 4Live siteEvery merge into
maindeploys
Video resource
It's a playlist. Start with the introduction, then watch the episodes on routing, nested and dynamic routes, and layouts, as far as the block allows. Each episode is short; stop at 15 minutes. The playlist was made for Next.js 15, and the routing it teaches works the same way in the version you installed.
Guided viewing questions:
- How does Next.js decide which file to show for an address like
/learners/3? - What stays on screen when you move between two pages that share a layout?
- What would you need to add to show a learner's profile at
/learners/[id]?
Reading resource
Read the opening sections.
Next.js, "Server and Client Components"nextjs.orgRead the opening sections, up to when to use each.
Guided reading questions:
- What is the difference between a page and a layout, according to the docs?
- List two things a server component is good for and two things only a client component can do.
- Why should
"use client"go on the smallest interactive component rather than on a whole page?
Interactive exercise
- 15 min In the Tracker, create routes:
/(dashboard),/learners,/attendanceand/register. AddLinks for all four to the navigation in the layout. - 15 min Add a dynamic route,
/learners/[id], with itsloading.tsx, that shows one learner's profile from the sample data, and a clear "Learner not found" message for an id that doesn't exist. - 10 min Run
npm run build. Fix anything it reports, and note each error in your engineering journal.
AI-assisted learning prompt
A useful prompt before you deploy:
Here is the folder structure of my Next.js app and the code of one page: [paste both]. Don't rewrite anything. Tell me which components need "use client" and which don't, and explain why for each. Then point out anything that will break when I deploy.
Log it in the AI-use journal: what it said, what you checked yourself, and what you changed.
Knowledge check
- Which file serves the address
/attendance? Which serves/learners/7, and how does the page know it's learner 7? - Why use
Linkinstead of<a>for pages inside your app? - Give one reason to keep a component on the server and one reason it must be a client component.
- What happens on Vercel when you push to
main? And when you open a pull request? - After today, a learner marked present on
/attendancedoesn't show as present on/learners. Why, and what fixes it in Week 3?
Build block: going live, then the P1 scope document
Second hour: the P1 scope document.
Finish all eight parts. They're the same tools you used on the Tracker in Week 1, now used on your own problem. It should fit on two or three pages. An hour is enough to get every part written; use the weekend to make it good, since it's due with Quest 2 on Sunday.
- Problem statement and evidence (Day 1): who has the problem, what happens today, and what it costs them, with no app, feature or technology named. Add your discovery notes with at least one direct quote, and your answers to the four problem questions, each with evidence from what you found (not from the app you plan to build):
- Do the people involved keep track of many things over time?
- Are there different kinds of people involved, who shouldn't all see or change the same things?
- Does at least one of them meet the problem away from a desk?
- Is part of the problem about judgement or communication, not just counting?
- Assumption register (Day 1): at least five things you believe about the problem or its users but haven't confirmed, each with a confidence level and how you would check it.
- Users and the main workflow (Day 2): who will use the product, and the one main thing they do with it, step by step.
- User stories with acceptance criteria (Day 2): a story for each thing the product must do, each with criteria specific enough to test.
- MoSCoW prioritisation and backlog (Day 2): every story tagged Must, Should, Could or Won't have, in the order you'd build them. Your Must haves are what you'll build in Weeks 3 to 6, so keep them small. Give a reason for each Won't have: that list is how you stop the project growing.
- Milestone plan (Day 2) for Weeks 3 to 6, with an hour estimate for each milestone.
- Running-cost note: the services it will use (for example Vercel, and the Week 3 database) and what each costs per month at small scale. Name free tiers honestly, including their limits. Start from vercel.com and supabase.com (Supabase is the Week 3 database).
- One-paragraph pitch in plain language, for someone who has never heard of it. It becomes your Pitch Day opener in Week 4.
Flex hour (last day of the week): no-AI drill and self-rating
On the last day of every week the Flex hour is fixed:
- No-AI drill (about 50 minutes): the Week 2 drill is below. Do it with all AI tools switched off. Your score is tracked over the weeks as your independence measure. It isn't graded pass or fail; it shows how your independence grows.
- Self-rating (2 minutes): rate your confidence on the same six skills as your baseline, using the form TechDojo sends.
- Journals: do your three journals after the drill.
Week 2 no-AI drill (about 50 minutes, 10 points)
An AI assistant was asked: "Write a React component in TypeScript for Next.js: a form that registers a learner (name and phone), shows our own message when the name is missing, welcomes the new learner, and shows how many learners are registered." This is what it wrote:
"use client";
import { useState, FormEvent } from "react";
type Learner = { id: number; name: string; phone: string; present: boolean };
export default function RegisterLearner() {
const [learners, setLearners] = useState<Learner[]>([]);
const [name, setName] = useState("");
const [phone, setPhone] = useState("");
const [nameError, setNameError] = useState("");
const [lastAdded, setLastAdded] = useState("");
function handleSubmit(e: FormEvent<HTMLFormElement>) {
if (name.trim() === "") {
setNameError("Enter the learner's full name.");
return;
}
setLearners([...learners, { id: String(Date.now()), name: name.trim(), phone, present: false }]);
setLastAdded(name.trim());
setName("");
setPhone("");
}
return (
<main>
<h1>Register a learner</h1>
<form onSubmit={handleSubmit}>
<label htmlFor="name">Full name</label>
<input id="name" required value={name} onChange={(e) => setName(e.target.value)} />
<p>{nameError}</p>
<label htmlFor="phone">Phone</label>
<input id="phone" value={phone} />
<button type="submit">Register</button>
</form>
{lastAdded !== "" && <p dangerouslySetInnerHTML={{ __html: `Welcome, ${lastAdded}!` }} />}
<p>{learners.length} learner(s) registered</p>
</main>
);
}
Part A. Read before you run (10 minutes, 2 points). Without running it, write down what you expect to happen: when the page loads, when you try to type a phone number, when you click "Register" with the name empty, and when you register "Ada". Then put it in a page of its own in your Tracker app (for example app/drill/page.tsx, deleted afterwards) and note where your prediction was right or wrong.
Part B. Review and fix (20 minutes, 3 points). The component has six problems, all from things you learned on Days 6 to 9. Use the Day 9 review checklist, the editor's red underlines and the browser console. For each problem: what is wrong, how you found it, and your fix. Half a point each. Not every line is wrong: if you change something that was already right, say why.
Part C. Git (10 minutes, 2 points). Answer in your own words:
- You fixed the bugs, opened a pull request, and the fix isn't in it. List two likely causes, and the Git commands that would show you which one it is.
- Why does Vercel give every pull request its own preview link? How would a reviewer use it?
Part D. Explain (10 minutes, 3 points). A business owner asks: "Why can't the app just remember who's present in a normal variable? Why do you need this 'state' thing?" Answer in five to eight plain sentences.
Hand in in section D of your Frontend Pack: your answers and your fixed component.
Release Gate 2: end-of-week checkpoint
Release Gate 2 is a spoken checkpoint on everything built across Week 2. Be ready to explain, out loud and without notes, while showing your live Tracker:
- How data becomes screens: arrays and objects,
map, components and props. (Days 6 and 8.) - What state is, where it lives in your app, and why there. (Day 9.)
- How your form validates input, and what the user sees when data is loading, empty, successful or failed. (Days 7 and 9; your Day 7 page on GitHub Pages counts for the four states.)
- Why TypeScript, shown on one of your typed components. (Day 8.)
- How a Next.js route, layout and
Linkwork in your app, and which components are client components and why. (Day 10.) - One piece of AI-written code you changed or rejected, and why. (Days 8 and 9, from your AI-use journal.)
- How your time estimates compared with the time things actually took over the Tracker's two weeks, and the biggest gap. (Your milestone plan and engineering journal.)
The P1 scope gate is reviewed separately, from your scope document.
▲ 70 meets the standard
- Working demonstration30
- Technical understanding and defence25
- Independent problem-solving20
- Code, documentation and evidence15
- Reflection and improvement10
Deliverables and submission criteria
Finish section D (State, routes and going live) and your P1 scope document, then submit both (the whole Frontend Pack, sections A to E, with the repository and live links) by Sunday 29 Nov, 11:59 pm WAT. Section D and the scope document should show:
0 of 7 ticked Ticks are saved on this device only.
Daily journal reflection
Add today's entry to your three running journals (they're section E of your Frontend Pack):
- Engineering journal: What going live involved, and anything that broke between your machine and Vercel. Estimate vs actual: for today, and a short look back at the whole Tracker: your total estimate against your total actual time, and the biggest gap.
- AI-use journal: The deployment-check prompt, what it flagged, and what you verified yourself.
- Curriculum journal: Looking back at Week 2, which day was the hardest and why? Did the four problem questions help you choose a P1 problem, or get in the way?