AI-Assisted Coding · Module 3Lesson 1

Study explanation · Lesson 01 · 11 min

From backend API to product UI

Module 3 makes the API visible. Correctness now includes what the browser shows, what DevTools records and what the frontend holds in state, while the backend rules from Module 2 stay in charge.

Listen to this lesson

Hear the lesson read aloud, with each sentence highlighted as you go.

Narrated by an AI voice.

The API becomes something you can see

Module 2 gave you a Task Tracker API with task fields, CRUD routes, status-transition rules and tests. Module 3 uses the same repository and turns it into something a user can see and move around: a Kanban board with ToDo, InProgress and Done columns, cards sorted by priority, drag-and-drop status changes that persist through the API, and a create/edit modal with validation on both the client and the server. Along the way you practise the AI-assisted workflow inside VS Code: ask for small changes, inspect suggestions or diffs, run the browser or the tests, and refine from evidence.

Key ideaCorrectness now includes browser behavior, DevTools evidence, frontend state, and the backend rules from Module 2.

Six outputs you finish with

The notes list what you should have at the end, and why each one matters. Notice that only two of the six are features. The rest are evidence that you stayed in control of the assistant.

Module outputs · Lecture notes p. 3
OutputWhat it should containWhy it matters
Verified VS Code + Copilot setupVS Code opened on the Task Tracker repo, Copilot enabled, and at least one route summary checked against app/main.py.Confirms the assistant is reading the real project, not answering from generic FastAPI patterns.
Kanban boardfrontend/index.html with ToDo, InProgress, and Done columns; priority sorting; fetch/render logic; loading, empty, ready, and error states; drag-and-drop status updates.Turns the Module 2 backend into a visible product surface students can interact with in the browser.
Create/edit modalNew Task and Edit flows with title trimming, POST/PATCH logic, server 422 messages, and dismissal behavior.Connects frontend form behavior to backend validation and business rules.
Behavior contract + refactorAn 8-item behavior checklist, a pre-refactor commit, selected refactors, and the contract still passing afterward.Prevents AI cleanup from silently changing behavior.
Expanded backend testsFocused edge-case pytest tests for PATCH behavior, with at least one demonstrated through deliberate source breakage.Shows that generated tests actually catch the bugs they claim to catch.
Debugging log and reflectionWhat failed, what evidence was used, what the AI suggested, and why the fix was accepted or rejected.Builds the habit of evidence-based AI-assisted debugging.

A frontend adds new ways to be wrong

An endpoint can return exactly the right JSON while the screen built on it still misleads the user. The notes give four examples of mistakes that only appear once there is a UI.

  • A card appears in the wrong column.
  • A failed PATCH leaves the UI showing a change the server never saved.
  • A form closes after a server error, so the user thinks the save worked.
  • An AI refactor makes the code cleaner while breaking drag-and-drop.

Key ideaYou catch these with the same loop used throughout the course: ask, inspect, run, test, refine.

What changes from Module 2 to Module 3

The repository is the same. What changes is the surface you work on, the evidence you check, and the question you ask of that evidence.

The question you ask of your evidence · Lecture notes p. 4

Module 2 · the API

  • curl, Swagger, pytest
  • Does the endpoint return the right response?

Module 3 · the product

  • Browser, DevTools, Network tab, console, pytest
  • Does the UI show the right state while respecting the API?
Module 2 and Module 3 compared · Lecture notes p. 4
Module 2Module 3
Backend API: data model, CRUD routes, status rules, and pytest coverage.Frontend product surface: Kanban board, cards, drag-and-drop, modal form, and browser behavior.
Verification used curl, Swagger, and pytest.Verification uses the browser, DevTools, network requests, console output, and pytest.
The key question was: does the endpoint return the right response?The key question is: does the UI show the right state while respecting the API?
AI helped create backend code in controlled steps.AI helps inside the coding flow: inline suggestions, chat, selected edits, and diff review.

The backend is still the source of truth

A frontend can make invalid actions harder to try, but it cannot make them invalid. The Module 2 backend still decides which statuses exist, which transitions are allowed and which inputs fail validation. The board’s job is to show those decisions honestly: send the request, read the answer, and display what the server said.

Key ideaThe backend still owns validation and business rules. A nice-looking board is not correct if it allows invalid status values, ignores 422 responses, or hides backend errors.

Read with careModule 3 does not restate Module 2’s transition rules. In the Module 2 notes, ToDo to InProgress, InProgress to Done and Done to InProgress are allowed; ToDo to Done, Done to ToDo and same-status moves are rejected. Module 3’s examples treat InProgress back to ToDo as invalid too. Check your own business_rules file rather than assuming.

Ask, inspect, run, test, refine

Every hands-on part of the module repeats one loop. Ask for one small change. Inspect what the assistant proposes before you keep it. Run it in the browser and watch DevTools. Test it against pytest and your own checklist. Refine from what you saw. The rest of the module applies that loop to setup, the board, the modal, a refactor, and testing and debugging.

  1. Ask for one small, anchored change.
  2. Inspect the suggestion or diff before keeping it.
  3. Run the browser and read DevTools.
  4. Test with pytest and the behavior checklist.
  5. Refine from the evidence.

Key takeaways

  • Module 3 keeps the Module 2 repository and adds a browser product on top of it.
  • Four of the six outputs are evidence: a verified setup, a contract, proven tests and a debugging log.
  • A frontend can be wrong in ways an endpoint test never sees.
  • The backend owns validation and business rules; the UI shows its decisions honestly.

Built from the Module 3 lecture notes, prompt library and additional readings; the module videos and slides were not supplied.

Your study checkpoint

Ready to continue?

Mark the lesson complete once you have read it and tried its idea on something real.

Next · Lesson 2