eCommerce platform built with the MERN stack & Redux.
This is a full stack E-Commerce Application built using MongoDB, Express.JS, React.JS, Node.JS
We use ECMAScript Modules in the backend in this project. Be sure to have at least Node v14.6+ or you will need to add the "--experimental-modules" flag.
Also, when importing a file (not a package), be sure to add .js at the end or you will get a "module not found" error
You can also install and setup Babel if you would like
Create a .env file in then root and add the following
NODE_ENV = Development
PORT = 5000
MONGO_URI = Your Mongo DB URI [Mongo DB connection string]
JWT_SECRET = Any Secret Key
PAYPAL_CLIENT_ID = Your Paypal Client Id [PayPal Payment Gateway]
RAZORPAY_KEY_SECRET=Your RazorPay key secret [RazorPay Payment Gateway]
RAZOR_PAY_KEY_ID=Your razor pay key id [RazorPay Payment Gateway]
SENDGRID_API_KEY= Your Sendgrid API Key [Email- Integration]
Note: For basic functionality without payment gateway, authentication & Email Integration, only MONGO_URI, NODE_ENV & PORT env is required
Add your sendgrid api key to the .env
file
Add your from email Id
and Sendgrid Template ID
in the ./backend/controllers/ordercontroller.js file
[Note: In order to obtain a Template ID
, you must login to your sendgrid account and navigate to the 'Dynamic Template' section and create your own design template following which a template ID will be available]
npm install
cd frontend
npm install
# Run frontend (:3000) & backend (:5000)
npm run dev
# Run backend only
npm run server
# Create frontend prod build
cd frontend
npm run build
There is a Heroku postbuild script, so if you push to Heroku, no need to build manually for deployment to Heroku
You can use the following commands to seed the database with some sample users and products as well as destroy all data
# Import data
npm run data:import
# Destroy data
npm run data:destroy
Sample User Logins
[email protected] (Admin)
123456
[email protected] (Customer)
123456
[email protected] (Customer)
123456