In order to spin up the project, in the root create .env with these two variables, with your own values.
DB_TOKEN JWT_SECRET JWT_SPAN
After that run this command
npm install && npm start
- Import connect.js
- Invoke in start()
- Setup .env in root
- Add DB_TOKEN
- auth.js
- task.js
- Builded Custom Error Handling Classes
- Handled by error-handler Middleware
- NotFound Middlware handle Inappropriate route call
*Validator Function for User Registeration Validation
- Validate -name, userName, email, password - with Mongoose
- Hash Password (with bcrypt)
- Save User
- Generate Token
- Send Response with token
- Validate - email or userName, Password - in controller
- If email or password is missing, throw BadRequestError
- Find User
- Compare Passwords
- If no user or password does not match, throw UnauthenticatedError
- If correct, generate Token
- Send Response with Token
- Generate Schema {Todo, description, createAt, createdBy}
- use CreatedBy as Foregin Key
- Pass Jwt-Validate Middleware on Each route of Task Api call
- For filter Search "todo" query
- For sort use on desending order pass sort=-createdAT ascending is default
- For Pagination pass Page&Limit req.query
- This API Fetch single Task with Paramid as ObjectId of Task
- Perform CRUD operation respective to their api call
- Scheduling and Notification Of Todo throught Mail
- helmet
- cors
- xss-clean
- express-rate-limit