A simple Task Manager application that allows users to create, read, update, and delete tasks, with user authentication and task filtering based on completion status.
- User authentication (sign up, log in)
- CRUD operations for tasks
- Filter tasks by completion status
- User-specific tasks, ensuring only authenticated users can manage their own tasks
- Backend: Node.js, Express
- Database: MongoDB (with Mongoose for object modeling)
- Authentication: JSON Web Token (JWT) for secure routes
- Libraries:
Mongoose
for object modelingbcryptjs
for password hashingdotenv
for environment variablescors
for cross-origin resource sharingvalidator
for input sanitizationexpress-validator
for request validation
├── controllers
│ ├── taskController.js
│ ├── userController.js
├── models
│ ├── User.js
│ ├── Task.js
├── routes
│ ├── user_routes.js
│ ├── task_routes.js
├── middlewares
│ ├── asynchWrapper.js
│ ├── authUser.js
│ ├── validationScheme.js
├── utils
│ ├── appError.js
│ ├── generateJWT.js
│ ├── httpStatusText.js
├── .env
├── index.js
└── package.json
- nodemon: Automatically restarts the server during development on file changes.
-
Clone the repository:
git clone https://github.com/doaamagdy2024/Task_Manager.git cd task-manager-api
-
Install all the dependencies:
npm run install-all
-
Modify the file named ".env" inside the backend folder. And substitute your credentials there.
-
start the application:
npm run run:dev
- POST /api/users/register - POST /api/users/login - GET /api/tasks - GET /api/tasks/:id - POST /api/tasks - PATCH /api/tasks?_id=taskId - DELETE /api/tasks?_id=taskId