Overview
The MERN-Ecommerce is a full-stack e-commerce website that allows users to perform CRUD operations on products, categories, orders, and users. It also includes authentication and authorization features, image uploading, payment options with Stripe, and more. The technology stack used includes React, Redux Toolkit, Reactstrap, Styled Components, Formik, Yup, Node, Express, MongoDB, Mongoose, JsonWebToken, Express Validator, and more.
Features
- Good folder structure
- Reusable components
- State management with Redux Toolkit
- Form validation with Formik and Yup
- Admin dashboard to handle various resources such as products, orders, and users
- Server validation with express-validator
- Image uploading with Multer and Sharp
- Payment options with Stripe or cash on delivery
- JWT authentication and authorization
Installation
To install and run this project, follow these steps:
Clone the repository:
git clone [repository_url]Navigate to the project directory:
cd MERN-EcommerceInstall the dependencies:
npm installCreate a
.envfile in the root directory and add the following environment variables:PORT: Specify the desired port numberNODE_ENV: Set todevelopmentorproductiondepending on the environmentBASE_URL: Specify the base URL for the APIAPI_URL: Specify the URL for the APIFILES_UPLOADS_PATH: Specify the path for uploaded filesCLIENT_URL: Specify the URL for the clientMONGO_URI: Specify the MongoDB URIDB_NAME: Specify the name of the MongoDB databaseJWT_SECRET: Specify the secret key for JWT authenticationJWT_EXPIRE_IN: Specify the expiration time for JWT tokensJWT_COOKIE_EXPIRE_IN: Specify the expiration time for JWT cookiesSTRIPE_SECRET_KEY: Specify the secret key for Stripe paymentsSTRIPE_WEBHOOK_SECRET: Specify the webhook secret for Stripe
Run the project:
npm start
Summary
The MERN-Ecommerce is a comprehensive e-commerce website that offers a range of features such as CRUD operations, authentication and authorization, image uploading, and payment options. It utilizes popular libraries and frameworks such as React, Redux Toolkit, Node, Express, and MongoDB. With its well-organized folder structure and reusable components, it provides a convenient solution for building e-commerce applications.