Challenge 02

Deliver a new feature (the cart)

Work locally with your chosen API track.

Goal#

Deliver a new feature for the Octocat Supply application by completing the incomplete shopping cart functionality, using GitHub Copilot to move fast while keeping the code consistent with the existing app.

The shopping cart is incomplete and lacks payment integration, which is blocking the launch. The focus of this challenge is using Copilot well — giving it the right context and iterating — not just writing code.

Actions#

  • Understand the current state — Review the existing cart-related code in the frontend and API. Use Copilot to explain what exists and what's missing.
  • Design the feature — Decide the cart behaviours to implement: add item, update quantity, remove item, view cart total.
  • Implement the API — Add or complete the cart endpoints following the repository's patterns (repository pattern, DTOs/types, error handling, consistent HTTP status codes).
  • Implement the UI — Wire up the frontend cart view to the API using the React + Vite + Tailwind stack.
  • Validate — Manually exercise the cart flow end to end in the running app.

Success criteria#

Optional stretch — structured prompting & context retrieval#

  • Build a reusable prompt template with clear sections: objective, constraints, files in scope, desired output format.
  • Set a context-retrieval order: directly edited files first → adjacent tests → architecture docs only if still needed. Stop once it's enough.
  • Run the cart prompt structured, then run the same request with a loose, unstructured prompt and keep the better result — the comparison is the learning.

Learning resources#

A prompt to start with

Adapt this to your chosen API track and actual environment. It starts a conversation; it does not complete the challenge for you.

Inspect the current cart in the frontend and my chosen API track. Propose a scoped plan for add, update quantity, remove, and accurate totals with API persistence. Follow the existing types and repository patterns. Wait for my review before implementing.

Ready for the next step?

Demonstrate each success criterion above and check it off. Completion is your assessment, not an automated test of your code.

Check all 4 success criteria before marking complete.

View this page's MarkdownLearning content is pinned to the credited upstream import.

Search the workshop

Solutions are not included.

    Search runs in your browser against the guide. It does not query GitHub or an AI service.

    Reset your workshop progress?

    This removes saved success criteria, completion marks, and the resume location in this browser. It does not change your repository or Azure resources.