Skip to content

Lab 04: Build A Feature Slice

Build one complete path from user action to durable state.

Ticket creation:

form -> client validation -> API request -> server validation -> database write
-> success response -> UI feedback

Use starter-projects/support-desk-mini as the baseline unless your instructor assigns another app.

  1. Create a small app or use an existing starter.
  2. Add a ticket creation form.
  3. Validate title and description on the client.
  4. Create a backend route.
  5. Validate the request on the server.
  6. Save the ticket.
  7. Show success and error states.
  8. Add tests for:
    • valid ticket
    • missing title
    • server error
    • duplicate submission

Starter project extension options:

  • Add ticket priority.
  • Add status transition validation.
  • Add GET /audit-events tests.
  • Add a simple HTML form that calls the API.
  • What belongs in frontend validation?
  • What must always be checked on the server?
  • What does the UI show while waiting?
  • What happens if the network fails?
  • What does the database store?

Create feature-slice.md with:

  • Diagram.
  • Acceptance criteria.
  • Files changed.
  • Test results.
  • Known limitations.

A user can create a ticket, bad input is rejected, and tests prove the important paths.