A RESTful Task Management API built using Node.js, Express.js, MongoDB, and JWT Authentication.
This API allows users to register, login, and manage their tasks securely with pagination and priority-based sorting.
- ✅ User Registration & Login
- ✅ Password Hashing using bcrypt
- ✅ JWT Authentication
- ✅ Protected Task Routes
- ✅ Create, Read, Update, Delete Tasks
- ✅ Pagination Support
- ✅ Priority-based Sorting
- ✅ MongoDB with Mongoose
- ✅ Environment Configuration using dotenv
- Node.js
- Express.js
- MongoDB
- Mongoose
- JWT (jsonwebtoken)
- bcrypt
- dotenv
- nodemon
1️⃣ Clone Repository
git clone <your-repository-link>
cd taskmanagerapi
2️⃣ Install Dependencies
npm install3️⃣ Create .env File
PORT=5005
URL=your_mongodb_connection_string
JWT_SECRET=your_super_secret_key| Method | Endpoint | Description |
|---|---|---|
| POST | /users/register | Register a new user |
| POST | /users/login | Login user |
| GET | /users | Get all users |
| GET | /users/:id | Get user by ID |
| PUT | /users/:id | Update user |
| DELETE | /users/:id | Delete user |
| Method | Endpoint | Description |
|---|---|---|
| POST | /tasks | Create task |
| GET | /tasks | Get all tasks of logged-in user |
| GET | /tasks/:id | Get task by ID |
| PUT | /tasks/:id | Update task |
| DELETE | /tasks/:id | Delete task |