Welcome to the MERN E-Commerce Project repository! This project is built using the MERN (MongoDB, Express.js, React, Node.js) stack along with various other technologies. This README will provide you with all the necessary information to understand, set up, and contribute to the project.
- Project Overview
- Features
- Technologies Used
- Getting Started
- Backend Configuration
- Usage
- Contributing
This E-Commerce project aims to create a fully functional (not too much focused on UI) online shopping platform. Users can browse through various products, add them to their cart, make purchases, and manage their orders. Admin users have access to a dashboard where they can manage products, inventory, orders, and customer information.
- Frontend: React (with Redux for state management)
- Backend: Node.js (Express.js)
- Database: MongoDB
- Payment Integration: Razorpay
- Material UI
- JavaScript, HTML, CSS
- Libraries: axios, bcrypt, express-validator, jsonwebtoken, mongoose, vite
- Clone the repository:
git clone https://github.com/Ajay-Maury/MERN-E-Commerce-Project.git
- Navigate to the project directory:
cd MERN-E-Commerce-Project
- Install backend and frontend dependencies:
npm install
cd Ecommerce-Frontend
npm install
-
Rename
.env.example
to.env
in thebackend
directory. -
Open the
.env
file in thebackend
directory. -
Configure your MongoDB connection URL and JWT secret key:
# MongoDB Connection URI MongoDB_URI=your_mongodb_uri # JWT Secret Key JWT_SECRET_KEY=your_jwt_secret_key
-
Add your Razorpay API Key and Secret:
# Razorpay API Key and Secret Razorpay_Key_Id=your_razorpay_key_id Razorpay_Key_Secret=your_razorpay_key_secret
Your .env
file should now look something like this:
MongoDB_URI=mongodb://localhost:27017/your_database_name
JWT_SECRET_KEY=yoursecretkey12345
Razorpay_Key_Id=your_razorpay_key_id
Razorpay_Key_Secret=your_razorpay_key_secret
Ensure that you replace your_mongodb_uri
, your_jwt_secret_key
, your_razorpay_key_id
, and your_razorpay_key_secret
with your actual values.
This configuration allows the backend to establish a connection to your MongoDB database, manage user authentication using JWT, and integrate with Razorpay for payment processing.
For reference, you can use the provided env.example
file as a template when creating your .env
file. Make sure not to share your actual sensitive keys and secrets in public repositories.
- Start the backend server:
npm run start
- Start the frontend development server:
cd Ecommerce-Frontend
npm run dev
Access the application at http://localhost:3000.
We welcome contributions to this project! To contribute, follow these steps:
- Fork the repository.
- Create a new branch for your feature/bugfix.
- Make your changes and commit them with descriptive messages.
- Push your changes to your fork.
- Submit a pull request to the original repository.
Please ensure your code follows the project's coding standards and includes appropriate tests.