Welcome to the MERN Stack E-Commerce Website project.
This E-Commerce website is built using the MERN (MongoDB, Express.js, React, Node.js) stack. It provides a platform for users to browse products, add them to their cart, and complete the purchase process. The project includes features like user authentication, product management, and a responsive user interface.
- MongoDB: Database for storing product and user information.
- Express.js: Backend framework for handling server-side logic.
- React: Frontend library for building user interfaces.
- Node.js: Runtime environment for executing JavaScript on the server.
front-end
: React frontend application.back-end
: Node.js backend server.
Follow these instructions to get the project up and running on your local machine.
Make sure you have the following installed:
- Node.js: Download Node.js
- MongoDB: Install MongoDB
-
Clone the repository:
git clone https://github.com/username/mern-ecommerce.git
-
Change to the project directory:
cd mern-ecommerce
-
Install dependencies for the client and server:
# Install client dependencies cd client npm install # Install server dependencies cd ../server npm install
-
Set up MongoDB:
- Create a MongoDB database.
- Update the database connection string in
server/config/config.js
with your MongoDB URI.
-
Set up environment variables:
-
Create a
.env
file in theserver
directory. -
Add the following variables:
PORT=5000 NODE_ENV=development MONGODB_URI=your-mongodb-uri JWT_SECRET1=your-secret-key
Replace
your-mongodb-uri
with your MongoDB URI andyour-secret-key
with a secret key for JWT.
-
-
Start the server:
# From the server directory npm start
-
Start the client:
# From the client directory npm start
-
Open your browser and visit
http://localhost:3000
to view the application.
If you would like to contribute to this project, please follow our contribution guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.