Ecommerce Back End Express Server Rest API

1
Posted at August 9, 2020 3219 Views . 1 Saved .

Hi Everyone,

I have started creating an ecommerce MERN Stack Project on youtube, you can find link of youtube playlist below

https://www.youtube.com/playlist?list=PLB_Wd4-5SGAYsxD4JGaVdXll3PnoyI-AM

Here I am sharing my day to day video code for the people who is looking for Source code

Lets start with backend Rest Api Code

I hope you are familiar with npm init command

lets continue with server code

src/index.server.js

src/models/user.js

src/routes/auth.js

src/routes/admin/auth.js

src/controller/auth.js

src/controller/admin/auth.js

Time to time i will update this page and plz do like this page and subscribe our youtube channel

India
Coding is an art and I love art
5 Comments
Nabin Joshi
I have a question in admin and user api what if the same person is admin and user if the person is registered as the user it cannot override to be an admin because email is same and we are using synchronous hasing and comparing in user model if we are using synchronous bcrypt in server does it gets any problem and also in mongodb the data comes from the server. any suggestion
Rizwan Khan
Hi Nabin, As per the idea of this system you need to have two different email address one for user and one for admin and your second question about using sync function on server so it depends on the processing power of the server and yes it will block other services if processing power is slow, so my advice is to use async function and i will also update this code
Nabin Joshi
thank you
tuanvu ngo
so it is impossible to have a person who is both admin and user, right ?
Rizwan Khan
Yes for this application
Shiva Siva
iam a btech learning student can anyone please tell me
Rizwan Khan
I think i have given all possible answers to your queries
Shiva Siva
thank you sir ( or) bro
Shiva Siva
and how they will get the same updated price in their website within no time
Rizwan Khan
if you refresh page you will get new data from apis
Shiva Siva
bro iam having one doubt how affiliate websites get the price update from various websites like (eg:amazon,flipkart,etc)
Rizwan Khan
I am not sure about how affiliate websites work but for sure they have some public apis for product and their price so whoever will use those apis they can get updated prices
Shiva Siva
whats this code bro
Rizwan Khan
Hi Shiva, This is source code of current web development project series. Its an Ecommerce Project