Skip to content

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

Contributors