Skip to content

Repository files navigation

🏗️ Project: Simple Task Manager API

🗒️ Description

A beginner-friendly backend project built with Node.js and Express, using an in-memory database (array of objects).
The goal is to practice RESTful API design, CRUD operations, error handling, and basic problem-solving.

📌 Requirements

Core Features

  1. Add a task

    • Endpoint: POST /tasks
    • Input (JSON):
      { "title": "Buy milk" }
    • Output (JSON):
      { "id": 1, "title": "Buy milk", "completed": false }
  2. Get all tasks

    • Endpoint: GET /tasks
    • Output: Array of tasks.
  3. Get one task by ID

    • Endpoint: GET /tasks/:id
    • Behavior: Return a single task if found.
    • Error: Return 404 if the task does not exist.
  4. Update a task

    • Endpoint: PUT /tasks/:id
    • Input (JSON):
      { "title": "Buy almond milk", "completed": true }
    • Behavior: Update only provided fields.
    • Error: Return 404 if the task does not exist.
  5. Delete a task

    • Endpoint: DELETE /tasks/:id
    • Behavior: Remove the task.
    • Error: Return 404 if the task does not exist.

🔏 Rules

  • Store tasks in an array (no external DB).
  • Each task should have:
    {
      "id": number,
      "title": string,
      "completed": boolean
    }
    

🚀 Extra Challenges

  1. Search/filter tasks

    • Example: GET /tasks?completed=true → returns only completed tasks.
  2. Validation

    • Don’t allow empty titles in tasks.
    • Return a 400 Bad Request error if input is invalid.
  3. Reset route

    • Endpoint: DELETE /reset
    • Clears all tasks and resets ID counter.
    • Useful for testing and starting fresh.

About

A beginner RESTfull API with in-memory DB, My 1st backend project on my own

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages