Skip to content
Layers Deep
All projects

A small tested API

Build a notes API with validation, persistence, and an automated test suite.

Brief ready; automated checks coming soonIntermediateAbout 4 hoursCoding foundations

What you'll build

  • Endpoints: create, list (paginated), read, and delete notes
  • Reject invalid input with 400 and a helpful error message
  • Return 404 for missing notes, never a server error
  • Persist notes so they survive a server restart

Milestones

Work through these in order. Each one ends with a check you can verify yourself.

  1. 1Milestone 1: Routes respondAll four routes return JSON with correct status codes.Done when: Manual requests return expected status codes.
  2. 2Milestone 2: ValidationEmpty or oversized titles are rejected.Done when: Invalid requests return 400 with a reason.
  3. 3Milestone 3: TestsA test suite covers success and error paths.Done when: At least 8 tests pass, including two error cases.
  4. 4Milestone 4: PersistenceNotes survive a restart.Done when: Created notes are listed after restarting the server.

Test criteria

What a finished project must demonstrate.

  • POST /notes with a valid body returns 201 and the created note
  • POST /notes with an empty title returns 400
  • GET /notes?limit=2 returns at most two notes and a cursor
  • GET /notes/unknown-id returns 404

An automated runner for these criteria is planned. Until it ships, check each one yourself; nothing here is graded for you yet.

Rubric

Rate your work against each criterion. Exemplary isn't required; be honest about where you are.

Correctness
EmergingHappy paths work
ProficientHappy and error paths work
ExemplaryAll paths work, including pagination edges
Tests
EmergingA few tests
ProficientTests cover each route
ExemplaryTests cover errors and edge cases, and fail for the right reason
API design
EmergingInconsistent responses
ProficientConsistent JSON and status codes
ExemplaryConsistent, documented, and paginated

Reflection

A few minutes of reflection makes the lessons stick.