Skip to content

E-Commerce API in this api you can do CRUD operations on products and its variants and you can search the product for more details see README file.

Notifications You must be signed in to change notification settings

mohitranjan256/E-Commerce-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

E-Commerce API

It is an API which is made for the Backend Internship.

Tech Stack

Server: NodeJS, ExpressJS

DataBase: MongoDB

Run Locally

Clone the project

  git clone https://github.com/mohitranjan256/E-Commerce-API.git

Go to the project directory

  cd E-Commerce-API

Install dependencies

  npm install

Start the server

  npm start

API Reference

It is running on the localhost machine on PORT = 5000.

Link

  http://localhost:5000

CRUD Operations for Product

Get all products

  GET /products

Get product

  GET /products/:id
Parameter Type Description
id string Required. id of product to fetch

Add product

  POST /products

http___localhost_5000_products - My Workspace 31-01-2024 06_35_23

Parameter Type Description
name string Required. name of the product
description string Required. description of product
price number Required. price of product

UPDATE product

  PUT /products/:id
Parameter Type Description
id string Required. id of product to update
name string name of the product to update
description string description of product to update
price number price of product to update

DELETE product

  DELETE /products/:id
Parameter Type Description
id string Required. id of product to delete

CRUD Operations for Product Variants

Get all variants of product

  GET /products/:prid/var

Get a variant of a product

  GET /products/:prid/var/:varid
Parameter Type Description
prid string Required. id of product to fetch
varid string Required. id of variant to fetch

Add variant of a product

  POST /products/:prid/var

http___localhost_5000_products_65b9a0e5d5c4b6246c5ffb90_var - My Workspace 31-01-2024 07_33_00

Parameter Type Description
prid string Required. id of product
name string name of the variant
sku string description of variant
additionalcost string price of variant
stockcount number price of variant

UPDATE a variant of a product

  PUT /products/:prid/var/:varid
Parameter Type Description
prid string Required. id of product to update
varid string Required. id of variant to update
name string name of the variant
sku string description of variant
additionalcost string price of variant
stockcount number price of variant

DELETE a variant of a product

  DELETE /products/:prid/var/:varid
Parameter Type Description
prid string Required. id of product to delete
varid string Required. id of variant to delete

Search product

   GET /search?q=name
Parameter Type Description
name string Required.name is required name either can be Product name , product description or product variant name

About

E-Commerce API in this api you can do CRUD operations on products and its variants and you can search the product for more details see README file.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published