kinsteve / Cloth-Management-API

This is a Cloth-Management API that provides user to manage there clothes with Security of JWT.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cloth-Management-API

This is a Cloth-Management API that provides user to manage there clothes with Security of JWT.

Some of its features include:

  1. Users can create their account. Once signed in, you can login and logout from your account when your work is accomplished.
  2. Users can create their own cloths collection by creating a cloth and adding its description and price . This will link their cloth to their respective account.
  3. Thus user can keep track of all cloths he/she owns.
  4. To provide security to user , their passwords have been hashed and salted. Further authentication is provided by JWT.
  5. Users can also update their account details and also change the description related to clothes.

Approach

Step 1: Created mongoose model Schema for User and for Cloth. Did data validation and sanitization on differernt attributes in the Schema object.
Step 2: Connected the MongoDB database to the API. Step 3: Created resource creation endpoints by making post routes for user and cloth.
Step 4: Created resource reading endpoints by making get routes for user and cloth.
Step 5: Created resource updating endpoints by making patch routes for user and cloth
Step 6: Created Resource Deleting Endpoints by making delete routes for user and cloth. And then separated user and cloth routes into two different files.
Step 7: Done hashing and salting on the password required by the user before storing it to the database.
Step 8: Created login Routes for the user and authenticated them by generating tokens using JWT.
Step 9: Whenever a user create a cloth item then the cloth is linked to the owner using its user id.
Step 10: Each cloth thus created also has an authentication token to ensure that only the user can access the clothes under his account.
Step 11 : Created a log out route.
Step 12: Created a delete route in case user wants to delete there account. This will wipe all their data from the database including all the cloths data he/she feeded in the System.

.

About

This is a Cloth-Management API that provides user to manage there clothes with Security of JWT.


Languages

Language:JavaScript 100.0%