Skip to content

gh-aam/task-management-api-3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

task-management-api-3

A simple and modular RESTful API for managing tasks, built with Express.js and MongoDB.

Features

  • Create, read, update, and delete tasks (CRUD)
  • Pagination support for task listing
  • Search tasks by title (case-insensitive)
  • Data validation and offensive language filtering
  • Modular route and error handler structure
  • Environment-based configuration
  • Graceful shutdown with MongoDB disconnection

Technologies Used

  • Node.js
  • Express.js
  • MongoDB + Mongoose
  • dotenv

Installation & Usage

Clone the repository:

git clone https://github.com/gh-aam/task-management-api-3.git

Go to project directory:

cd task-management-api-3

Install dependencies:

npm install

Create a .env file in the root:

MONGODB_URI=mongodb://localhost:27017/your_mongodb_database_name
MONGODB_USER=your_mongodb_user_name
MONGODB_PASS=your_mongodb_password
EXPRESS_PORT=3000
OFFENSIVE_WORDS=offword1,offword2,offword3

Start the server:

npm start

API Endpoints

Base URL

http://localhost:3000

Routes

GET /: Welcome message
POST /tasks: Create a new task
GET /tasks: Get all tasks with pagination
GET /tasks/search: Search tasks by title (case-insensitive)
GET /tasks/:id: Get a specific task by ID
PUT /tasks/:id: Update an existing task by ID
DELETE /tasks/:id: Delete a task by ID

Query Parameters

page: Page number (default: 1)
limit: Items per page (default: 10)
title: Search query for task title

About

A simple task management (RESTful) API built with Express.js and MongoDB.

Topics

Resources

License

Stars

Watchers

Forks

Contributors