This repository contains the code for a MERN based e-commerce webapp:
- Install Mongodb & Robo3T
- Install React
To get deeper insight of the Backend of our Project Ecommerce have a look at the following steps:
- Download the code folder from GitHub
- Create a .env file inside the backend folder having two variables - DATABASE & SECRET. Additionally, you can add "PORT" as well if you want to connect DB at some other port.
- Open cmd and go to the backend folder directory and run the "npm install" command
- Go to PowerShell and run command "mongod"
- Then "npm run". Below will appear on command prompt:
We'll see that the backend server is running at localhost:8000.
- Write the route: http://localhost:8000/api/ route (Here, the route has to be taken from routes folder.)
- Firstly, go to Robo3T and connect to localhost:27017
- Now, open the command prompt for the frontend folder and run "npm install"
- Now, run "npm start"
- This will automatically start the deployment server Below screen will show up automatically:
- Click on the little arrow button in right corner
- Now, if not already registered then click on sign up and enter dummy details.
- Now, open Robo3T, on the left bar click on books and then on users as shown below:
- Edit and change the highlighted row's value i.e. "role" : 1. Since "1" is for admin.
- Now, go to deployment and sign in and below screen will show up. Here you can add things to the cart, create categories, delete them etc.