Free lesson

Scaffold and record the environment

Scaffold and record the environment — Build a Next.js website with an AI assistant. Check release requirements; Create next-lab; Give the assistant the file map. Practical assignment: Lab evidence.

Demo edition. The materials are undergoing editorial review.

Topics covered

  • Check release requirements
  • Create next-lab
  • Give the assistant the file map

Check release requirements

Read the current installation requirements before scaffolding. Record Node, npm and resolved Next.js versions; the course does not promise that latest remains unchanged.

The fictional site lists a clay workshop and demonstrates local form validation without creating a real reservation. Keep that distinction visible in the interface. Ask the assistant for changes to named files and explain whether each file executes on the server or in the browser. A framework can render a polished page while still exposing secrets, losing form errors or linking to missing routes; inspect those behaviors directly.

Create next-lab

Run the official generator. Choose TypeScript, ESLint, App Router, no Tailwind and no src directory for these paths. Keep generated layout and global stylesheet.

The generator’s answers determine the paths used throughout the course. If you choose a src directory, all shown app paths move under src; if you choose Pages Router, the examples are incompatible. Inspect the generated tree immediately, before asking an assistant to fix errors caused by a different setup.

Apply snippets in the named App Router paths and retain generated configuration unless the lesson explicitly changes it. Run the development server while editing, then inspect terminal and browser errors separately. Imports are relative to the shown file tree. Keep a small commit before each feature so an assistant mistake can be removed without reconstructing the entire project. Do not put private credentials into client-visible environment variables.

node --version
npm --version
npx create-next-app@latest next-lab
cd next-lab
npm ls next react react-dom
npm run dev -- --hostname 127.0.0.1

Give the assistant the file map

Ask for a route map and execution boundaries before editing. Permit only the named app files; prohibit dependency changes, deployment and billing actions in this exercise.

Verify direct navigation, refresh and form failure states, not only clicks during one development session. Development hot reload can hide assumptions that fail in a production build. Preserve error messages as visible text and never replace an error with a success banner. This lab does not persist submissions; a real data mutation additionally needs authentication, authorization, durable storage and an explicit privacy policy. Record which parts are implemented.

Practical assignment

Lab evidence

Continue to learning

Course outline

  1. Scaffold and record the environment
  2. Create routes and real navigation
  3. Keep interactivity at a client boundary
  4. Validate a demo form on the server
  5. Review accessibility and production errors
  6. Build and choose a compatible deployment