EasyShop is a user-friendly e-commerce platform designed for simplicity and convenience. It allows users to browse and purchase products while offering an admin panel for managing products and orders. This README provides comprehensive instructions to set up, configure, and run the project locally.
- User-Friendly Interface: Seamless browsing and purchasing experience.
- Cart Management: Add and manage products in the shopping cart.
- Secure Checkout: Complete orders securely.
- Admin Panel: Manage products, orders, and user information efficiently.
- Dummy Data Initialization: Pre-load test data for quick setup and testing.
Before proceeding, ensure you have the following installed on your machine:
- Node.js (v16 or higher)
- npm (Node Package Manager)
- MongoDB (local instance or cloud URI)
Follow these steps to set up the project locally:
-
Clone the repository:
git clone https://github.com/yourusername/easyshop.git cd easyshop
-
Install dependencies:
npm install
-
Create a
.env
file in the root directory and add the following environment variables:PORT=3000 MONGODB_URI=mongodb://localhost:27017/easyshop SECRET_KEY=your_secret_key
Replace
your_secret_key
with a secure key for JWT authentication. -
Set up admin credentials by running:
node admin.js
Follow the prompts to create an admin user.
-
Initialize the database with dummy data for testing by running:
node init-folder.js
Start the server using one of the following commands:
-
With Node.js:
node app.js
-
With Nodemon (for development):
nodemon app.js
The server will run on the port specified in the .env
file (default: 3000
). Open your browser and navigate to:
- Frontend:
http://localhost:3000
We welcome contributions! To contribute:
-
Fork the repository.
-
Create a new branch:
git checkout -b feature/your-feature-name
-
Make your changes.
-
Commit your changes:
git commit -m "Add your message here"
-
Push to the branch:
git push origin feature/your-feature-name
-
Open a pull request with a detailed description of your changes.
This project is licensed under the MIT License. See the LICENSE file for more details.
- If you encounter any issues, ensure MongoDB is running, and the
.env
file is properly configured. - Use
nodemon
for easier development by automatically restarting the server on code changes.