A RESTful API for task management with user authentication built with Node.js, Express, and MongoDB.
- User authentication (register, login, logout)
- JWT token-based security
- CRUD operations for tasks
- Task filtering, sorting, and pagination
- Task statistics
- Password hashing
- Input validation
POST /api/auth/register
- Register new userPOST /api/auth/login
- Login userGET /api/auth/me
- Get current user profilePOST /api/auth/logout
- Logout user
GET /api/tasks
- Get all user's tasksPOST /api/tasks
- Create new taskGET /api/tasks/:id
- Get single taskPUT /api/tasks/:id
- Update taskDELETE /api/tasks/:id
- Delete taskGET /api/tasks/stats/overview
- Get task statistics
- Clone the repository
- Install dependencies:
npm install
- Create
.env
file with: NODE_ENV=development PORT=3000 MONGODB_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret - Run the server:
npm run dev
- Node.js
- Express.js
- MongoDB with Mongoose
- JWT for authentication
- Bcrypt for password hashing
- Joi for validation