<LEARN/>
← /paths/backend

<project · intermediate>

Notes REST API

Create, read, update and delete notes over HTTP, stored in a SQL database.

Build notes rest api one manageable milestone at a time. Keep your decisions, tests and finished work together so your portfolio shows what you learned, not only the final result.

Build it step by step

  1. Plan the API

    Use Node.js with Express and SQLite for a local, free setup. Define GET, POST, PATCH and DELETE /notes endpoints with a consistent JSON error format.

  2. Create the database

    Write a migration for a notes table with id, title, body and timestamps. Use parameterised SQL and keep database access in a small repository module.

  3. Implement CRUD

    Validate request bodies and return appropriate 201, 200, 204 and 404 statuses. Allow partial updates while rejecting unknown fields and empty titles.

  4. Bound your inputs

    Set body-size limits and add pagination to list requests. Handle database failures without returning stack traces or internal file paths.

  5. Test the contract

    Run integration tests against a separate temporary database. Create a note, retrieve it, update it, delete it and confirm the final fetch returns 404.

  6. Share your finished work

    Commit your source and a README explaining setup, decisions, tests and limitations. Remove secrets and personal data, credit dependencies and assets, then add the public repository or portfolio link and an optional working demo to LEARN Showcase. Hosting is optional; a clear repository or design case study is enough.

// done when

  • All four CRUD operations work
  • SQL queries are parameterised
  • Invalid bodies return a client error
  • Deleted notes return 404
  • README includes setup, credits and limitations; shared links are safe and accessible

// stretch goals

  • Add search
  • Document endpoints with OpenAPI

Finished? Show it off

Add your project to the LEARN showcase so other learners and employers can see it.

Sign in to add your finished project to the showcase.