Skip to content

aishadeshmukh/E-commerce-website-using-NodeJs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

E-commerce-website-using-NodeJs

Download the repository

git clone

Running the application using postman

Install postman desktop application to tests the steps of sign up/sign in and sign out of users and admin. The authentication provided to admin can also be tested here.

Sign up

  • Execute a post query with URL - http://localhost:8000/api/signup
  • Insert header Content-Type with value application/json
  • In the body field, select raw radio button and insert below sample code to sign up a user

{ "name": "John", "lastname": "Doe", "email": "john@exp.com", "password": "12345" }

Sign in

  • Execute a post query with URL - http://localhost:8000/api/signin
  • Insert header Content-Type with value application/json
  • In the body field, select raw radio button and insert below sample code to sign up a user

{ "email":"john@exp.com", "password": "12345" }

Creating Categories of the product

  • The categories can be created by the admin alone.
  • The admin will first need to login through above sign in instructions.
  • After signning in the token and id of the admin will appear in the result section.
  • Execute a post query with URL - http://localhost:8000/api/category/create/userId Here userId is the id of the admin which appears when signed in.
  • Insert header Content-Type with value application/json.
  • In the header, one more field needs to be added as Authorization. The value for it will be Bearer token (Here token is the same token generated after admin sign in).
  • In the body section, in raw field, insert below code with the category name you want to insert.

{ "name": "Delete this" }

Creating product

  • The categories can be created by the admin alone.
  • The admin will first need to login through above sign in instructions.
  • After signning in the token and id of the admin will appear in the result section.
  • Execute a post query with URL - http://localhost:8000/api/product/create/userId Here userId is the id of the admin which appears when signed in.
  • In the header, one more field needs to be added as Authorization. The value for it will be Bearer token (Here token is the same token generated after admin sign in).
  • In the body section, select form-data radio button to insert the attributes of the product in the form of key value pair
KEY VALUE
name Abstract Tshirt
description New Summer collection with abstract print
price 500
stock 40
category categoryId
photo image.jpg
  • The categoryId above should be taken from the id when the category was created.
  • In the photo key section, make sure to select file in the drop down. The value section gives you a button to select the image from your device. Make sure you are have updated setting of postman to allow it to select files outside the working directory.

Deletion and Updation of category/product

Creating orders

Viewing all orders of a particular user

The admin can view all order of a user, check the status of the order and update it.

Viewing all products and categories

Robo3T for Database

  • The database is created in MongoDB.

  • Establish a new connection in Robo3T.

  • Create a database on your mongoDB terminal using below -

    use tshirt

  • After each CRUD operation, you can find you saved database for the particular entity in Robo3T under the Collections folder of tshirt database.

  • Each attribute is visible which can further edited or deleted as required.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published