| Duration | ~45 min in the lesson + ~30 min homework |
| Prerequisites | Checkpoint lesson-3.7; the business's legal name and contact details for the legal pages. |
| Checkpoint | lesson-3.8 |
What you will have
The site has a thank-you page that the form leads to, privacy and terms pages linked from the footer, a custom "page not found" page, its own favicon, a title and description on every page, and a link-preview image that appears when the address is shared.
Video
The video for this lesson is not recorded yet.
Prompts used in this lesson
Part 2 — The thank-you page
Purpose: add the thank-you page and send successful form submissions to it. Context: LeadForm currently replaces itself with a success message. Copy for the page is in docs/content.md (add it to the content folder). Route: /thank-you. Done when: - app/thank-you/page.tsx shows a confirmation heading (h1), what happens next, the phone number from content/site.ts for urgent requests, and a link home; - after a successful submission LeadForm navigates to /thank-you; the sending and error states are unchanged; - the page's metadata asks search engines not to index it, and nothing on the site links to it. Constraints: existing components and theme tokens; text from the content folder. Read the redirecting and metadata guides in node_modules/next/dist/docs first. Before reporting: build and lint; in the browser submit valid data and confirm the address becomes /thank-you; submit with error@example.com and confirm the form shows its error state; show me the robots meta tag from the page's HTML.
Part 3 — Privacy policy and terms
Purpose: add first drafts of the privacy policy and terms pages. Context: the site collects name, email, phone and message through the lead form (see components/LeadForm.tsx and docs/architecture.md). Today the only third party processing data is the hosting provider, Vercel; database, email, analytics and advertising services come later and are NOT in use yet. Business details: [legal name, address, contact email, phone, country]. Done when: - app/privacy/page.tsx and app/terms/page.tsx exist, each with an h1, a "last updated" date and plain-language sections under h2 headings; - privacy covers: who we are and contact; what data we collect; why; who receives it; how long we keep it; people's rights and how to use them; - terms cover: what the site offers; that a quote request is not a contract; acceptable use; liability; governing law; contact; - both are linked from the footer, and the form's privacy link works; - docs/legal-review.md lists every statement you assumed or were unsure of, as a checklist for me and a legal reviewer. Constraints: describe only what the site does today; no cookies, analytics or advertising tools that are not installed. Do not invent retention periods, registration numbers or legal claims; where a fact is missing write [TO CONFIRM: …] and add it to the checklist. Before reporting: build and lint, open both pages, and list every [TO CONFIRM] you left.
Part 4 — A custom "not found" page
Purpose: replace the default "not found" page with our own. Context: Next.js App Router; read the not-found file convention in node_modules/next/dist/docs. Done when: any address that matches no page shows a friendly h1, one sentence, a primary button to / and a link to /#quote, in our design, inside the normal header and footer; the response status is still 404. Constraints: existing components and tokens; text in the content folder; not the experimental global not-found feature. Before reporting: build, start the production server, request a made-up address, and report the HTTP status code and a screenshot.
Part 5 — Favicon, titles, descriptions, preview image
Purpose: give the site its identity in browser tabs, search results and shared links. Context: the live address is https://[your-domain]. Business name and offer are in docs/brief.md; page copy in docs/content.md. The scaffold's favicon and default metadata are still in place. Read the metadata, app-icons and opengraph-image pages in node_modules/next/dist/docs first. Done when: - content/site.ts has siteUrl set to the live address and the root layout uses it as the metadata base; - every page has a unique title, "Page name | Business name" (the home page uses the main offer plus the business name), and a unique description of one or two honest sentences, kept in the content folder; show them to me for approval; - the favicon and icon files in app/ are our own mark, made from the logo or, without one, the business initial on the brand colour; - a 1200×630 link-preview image with the business name and offer in our design sits in app/ under the Next.js file convention, with alternative text; Open Graph title and description are set; Constraints: no claims that are not in docs/content.md. Before reporting: build; start the production server; for /, /privacy, /terms and /thank-you give me a table of title, description, robots value and preview-image address taken from the rendered HTML, not from the source code.
Do along
Work on your own project and pause the video where told.
- Start from
lesson-3.7. Write the thank-you copy indocs/content.md. - Pause after Part 2. Run the thank-you prompt and test the success and failure paths yourself.
- Pause after Part 3. Run the legal pages prompt with your legal name, address, contact email, phone and country.
- Read both pages in full. Work through
docs/legal-review.md: fill in facts and delete what is not true for you. - Pause after Part 4. Run the "not found" prompt and visit a made-up address.
- Pause after Part 5. Run the identity prompt with your live domain. Approve or rewrite every title and description.
- After Part 6, push. On the live domain, check the tab icon in a private window and paste the address into a chat with yourself.
- Save the checkpoint with the commands under "Recap and next".
Check your work
- Submit the form with valid data. Expected: the browser goes to
/thank-youand shows the confirmation. - Look at the footer on any page. Expected: working links to
/privacyand/terms; no link anywhere to/thank-you. - Open
https://your-domain/no-such-page. Expected: your own "not found" page with header, footer and a button home. - Read the browser tab on each page. Expected: a different, meaningful title on each, and your own icon.
- Paste the live address into a messaging app. Expected: a card with your image, title and description.
- Search the legal pages for "TO CONFIRM". Expected: none left.
npm run buildandnpm run lint. Expected: both pass.
Common problems
- A wrong address shows the default text → the file is misplaced or misnamed → "The custom 404 must be app/not-found.tsx; verify with a request to a made-up address."
- Link preview has no image → the image address is not absolute, or
siteUrlis wrong or still localhost → ask Claude to show theog:imagevalue from the live page's HTML and fix the metadata base. - Preview or favicon is still the old one → cached by the app or browser → test in another app, a private window, or with
?v=2added to the address.
Homework
About 30 minutes, after the lesson. No later lesson depends on it.
- Arrange the legal review. Decide which qualified person will review the privacy and terms pages before you advertise. Send them the two live addresses and the checklist. Write their name and a target date at the top of
docs/legal-review.md. This task needs a name and a date, not a payment. Deliverable: that line. Commit without a tag. Done when: the file names a reviewer and a date. - Titles next to real results. Search for your service plus your city and read the titles and descriptions of the first three results. Reread your home page's title and description beside them. If a rewrite is clearer and still honest, have Claude change it in the content folder. Deliverable: the three titles and your final title and description in your notes. Commit without a tag. Done when: yours says what you offer and where, with no claim missing from
docs/content.md. - A second app. Send your live address to one person in a different messaging app from the one used in the lesson. Ask what they expect to find behind the card. Deliverable: their answer in your notes. Done when: the card showed image, title and description there, or you have worked through "Common problems" for what was missing.
Save your work
git add -A
git commit -m "Lesson 3.8: thank-you, privacy, terms, 404, metadata and preview image"
git tag lesson-3.8
git push
git push --tags