https://github.com/gh-aam/task-management-api-3
A simple task management (RESTful) API built with Express.js and MongoDB.
https://github.com/gh-aam/task-management-api-3
dotenv express express-js express-middleware expressjs javascript mongodb mongodb-database mongoosejs node
Last synced: 3 months ago
JSON representation
A simple task management (RESTful) API built with Express.js and MongoDB.
- Host: GitHub
- URL: https://github.com/gh-aam/task-management-api-3
- Owner: gh-aam
- License: mit
- Created: 2025-05-31T13:27:44.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-31T17:24:22.000Z (about 1 year ago)
- Last Synced: 2025-06-19T19:52:14.941Z (about 1 year ago)
- Topics: dotenv, express, express-js, express-middleware, expressjs, javascript, mongodb, mongodb-database, mongoosejs, node
- Language: JavaScript
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
```bash
git clone https://github.com/gh-aam/task-management-api-3.git
```
Go to project directory:
```bash
cd task-management-api-3
```
Install dependencies:
```bash
npm install
```
Create a `.env` file in the root:
```bash
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:
```bash
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