📓 📝 📧 📚
Task Manager API deployed on Heroku.
For API Access follow Documentation and Switch on to Postman via https://task-manager-notsonoobie.herokuapp.com
COMPLETE 🔥
- Nodejs
- Npm
- Git
- MongoDB
- MongoDB Compass (Recommended for PROD) or Robo3T (Recommended for DEV)
- Postman
$ node -v
$ npm -v
$ git --version
Express🔗mongodb🔗mongoose🔗multer🔗jsonwebtoken🔗bcryptjs🔗sharp🔗validator🔗@sendgrid/mail🔗
- Create
configDirectory insidetask-manager - Create
dev.envFile inside../task-manager/config/ - Create
test.envFile inside../task-manager/config - Define
PORT(For Running Applications) ,SEND_GRID_API_KEY(API Key for Sending Authenticated Emails) ,MONGO_DB_URL(For Connection to MongoDB Database) ,JWT_SECRET_KEY(For Verification of JWT Token)
To get details about how to declare Environment Variables visit env-cmd Documentation. I have not provided my own .env configuration file for security concerns, so refer to the documentation.
-
Install Clients :
$ git clone https://github.com/notsonoobie/task-manager-api.git $ cd task-manager-api/ $ npm install -
Scripts :
-
Start Client (Prod Mode) :
node src/app.js -
Start Client (Dev Mode) :
env-cmd ./config/dev.env nodemon src/index.js -
Test (Jest Integration) :
env-cmd ./config/test.env jest --watch --runInBand
-
-
Start Client :
-
Start Client (Prod Mode) :
$ npm run start -
Start Client (Dev Mode) :
$ npm run dev
-
-
Testing Client with JEST :
$ npm test
This is a Node.js based Task Manager API supports JWT Authentication and Login System with Email Support. This app uses JWT Tokens for Authentication of User for Modifying Profile (User) / Task Data. The data is stored in MongoDB Database. User Can upload Profile Avatar using multer module support to the API which is then modified by sharp module and then stored in Database as Buffer. The task data can be viewed using endpoint which also offers Filtering , Sorting , & Pagination of the Task Data. For every access/modification request User has to get Authenticated with Valid JWT verified Token. The project is also tested with JEST Framework for Automated Testing of API Endpoints. The entire architecture is based on REST-API which supports :
- POST REQ - CREATING USER
{{url}}/users - POST REQ - LOGGING-IN USER
{{url}}/users/login - POST REQ - CREATING TASK
{{url}}/task - POST REQ - LOGGING-OUT USER
{{url}}/users/logout - POST REQ - LOGGING-OUT USER (ALL SESSIONS)
{{url}}/users/logoutAll - POST REQ - UPLOADING AVATAR(PROFILE)
{{url}}/users/me/avatar - GET REQ - READING PROFILE
{{url}}/users/me - GET REQ - READING A TASK
{{url}}/task/:taskid - GET REQ - READING TASKS :
- For Reading All Task :
{{url}}/tasks - For Reading Filtered Task based on Status :
{{url}}/tasks?status=true|false - For Reading Limited Task :
{{url}}/tasks?limit=:NumberToLimit - For Reading Task after Skipping few Task :
{{url}}/tasks?skip=:NumberToSkip - For Reading Sorted in Asc Order based on Property :
{{url}}/tasks?sortBy=:prop::asc - For Reading Sorted in Desc Order based on Property :
{{url}}/tasks?sortBy=:prop::desc
- For Reading All Task :
- GET REQ - VIEWING AVATAR
{{url}}/users/:userid/avatar - PATCH REQ - UPDATING USER
{{url}}/users/me - PATCH REQ - UPDATING TASK
{{url}}/task/:taskid - DELETE REQ - DELETING USER
{{url}}/user/me - DELETE REQ - DELETING AVATAR
{{url}}/users/me/avatar - DELETE REQ - DELETING TASK
{{url}}/task/:taskid
The Post App need to be configured and Scipted for Automation of the workflow for Authentication (Although it is not necessary).
- Load the Collection from :
../task-manager/Postman Collection/Task App.postman_collection.jsoninto Postman APP. - Load Environment Variables for Dev into Postman APP :
../task-manager/Postman Collection/Task Manager API (dev).postman_environment.json - Load Environment Variables for Prod into Postman APP :
../task-manager/Postman Collection/Task Manager API (Prod).postman_environment.json
You are good to go... 😬
You can use the code under MIT License but mention of Author ( Rahul Gupta @notsonoobie ) is appreciable.
☎️ +91-89288-85199
🌐 http://showcasingmyself.netlify.com
© Rahul Gupta (notsonoobie) -- Thank You! 🤓
