Skip to content

A simple in-memory RESTful Task Manager API built with Node.js and Express. Supports full CRUD operations with validation and UUID-based IDs. Perfect for beginners learning REST APIs.

Notifications You must be signed in to change notification settings

salmanazamdev/task-manager-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Task Manager API

This is a simple RESTful Task Manager API built using Node.js and Express.
It stores data in memory (no database), uses UUIDs for unique task IDs, and supports full CRUD operations.


πŸ“¦ Features

  • βœ… Create a task (POST /tasks)
  • βœ… Get all tasks (GET /tasks)
  • βœ… Get a single task by ID (GET /tasks/:id)
  • βœ… Update a task (PUT /tasks/:id)
  • βœ… Delete a task (DELETE /tasks/:id)
  • βœ… Validation for title and status
  • βœ… Middleware to log all incoming requests
  • βœ… Bonus: Filter tasks by status (?status=pending)
  • βœ… Bonus: Sort tasks by creation time (?sortBy=createdAt:desc)

πŸ“ Task Structure

Each task looks like this:

{
  "id": "uuid",
  "title": "Learn Node.js",
  "description": "Optional text",
  "status": "pending",        // or "completed"
  "createdAt": "2025-07-15T12:00:00Z"
}

πŸš€ How to Run

  1. Clone the repo:
git clone https://github.com/salmanazamdev/task-manager-api.git
cd task-manager-api
  1. Install dependencies:
npm install
  1. Start the server:
node index.js

Your API will be running at:

http://localhost:3000

πŸ§ͺ Example: Create a Task

POST /tasks Body (raw JSON):

{
  "title": "Do assignments",
  "description": "Complete backend API",
  "status": "pending"
}

πŸ“Œ Notes

  • All data is stored in memory (resets on server restart)
  • This project is meant for learning REST APIs using Express
  • Perfect for practice or beginner backend portfolio projects

πŸ‘¨β€πŸ’» Author

Made with ❀️ by Salman

Feel free to fork, use, and improve!

About

A simple in-memory RESTful Task Manager API built with Node.js and Express. Supports full CRUD operations with validation and UUID-based IDs. Perfect for beginners learning REST APIs.

Topics

Resources

Stars

Watchers

Forks