An E-commerce Web App developed using MERN stack where user can buy and checkout product with ease and add their review and rating for the products.
- User Authentication
- Add Product to Cart
- Buy Product
- Payment Checkout
- Add Review
- Add Rating
- Clone the repository
git clone https://github.com/nixrajput/ecommerce-mern.git
- Install required modules
npm install
- Create a new directory
config
inbackend
directory - Create a new file
config.env
inconfig
directory - Add following VARIABLES in
config.env
or in production Environment Variables
PORT = 4000
DB_URI = 'YOUR MONGO-DB URI'
DB_NAME = 'ecommerce'
NODE_ENV = 'dev'
JWT_SECRET = 'YOUR JWT SECRET'
JWT_EXPIRES_IN = 7d
COOKIE_EXPIRES_IN = 5
SMTP_FROM = 'Test <noreply@yourcompany.com>'
SENDGRID_API_KEY = 'YOUR SENDGRID API KEY'
# Cloudinary
CLOUDINARY_CLOUD_NAME = 'YOUR CLOUDINARY CLOUD NAME'
CLOUDINARY_API_KEY = 'YOUR CLOUDINARY API KEY'
CLOUDINARY_API_SECRET = 'YOUR CLOUDINARY API SECRET'
# URL
FRONTEND_URL = 'http://localhost:3000';
# STRIPE CONFIG
STRIPE_API_KEY = 'YOUR STRIPE API KEY'
STRIPE_SECRET_KEY = 'YOUR STRIPE SECRET KEY'
- Run the server
npm run dev
cd frontend
npm start