E-Cart is an online shopping platform that allows users to browse and purchase products, manage their shopping cart, and track orders. The system is built with modern web technologies and is designed to provide a seamless and intuitive shopping experience.
![Screenshot 2023-08-26 023306](https://private-user-images.githubusercontent.com/99734334/263392748-d9fc2148-5f85-4dde-8c50-002f454d1bb7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwNTk1NDIsIm5iZiI6MTczOTA1OTI0MiwicGF0aCI6Ii85OTczNDMzNC8yNjMzOTI3NDgtZDlmYzIxNDgtNWY4NS00ZGRlLThjNTAtMDAyZjQ1NGQxYmI3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA5VDAwMDA0MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTc2NDgxNGE5MjNjYmE0ZGM2ZTg5NWRhY2U4ZWM1ZGU0MGI5MTZlMjJkZDk4YTk5NGM0NjQ1ZjRhMTJkNTdiY2EmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0._u8hwDNo4BkrLWX_jLpfRDaHUBYJYLi_PUx-m7ODjFE)
- User Registration and Login: Secure authentication system for users to create accounts and log in.
- Product Catalog: A wide range of products with detailed descriptions, images, and prices.
- Shopping Cart: Add products to the shopping cart, modify quantities, or remove items.
- Order Management: Place orders, view order history, and track order status.
- Admin Dashboard: Admin can add, edit, or delete products, and manage user orders.
- Frontend: React, HTML5, CSS3, JavaScript
- Backend: Node.js, Express.js
- Database: MongoDB
- Authentication: JWT (JSON Web Tokens)
- Styling: Bootstrap, Custom CSS
- Others: Axios for API requests, Nodemailer for email notifications
- Node.js (v14 or higher)
- npm
- MongoDB (locally or a cloud service like MongoDB Atlas)
-
Clone the repository
git clone https://github.com/harsh-9389/E-Cart.git cd E-Cart
-
Install Dependencies
-
For the frontend:
cd client npm install
-
For the backend:
npm install
-
-
Configure Environment Variables
-
Create a
.env
file in both the server and client directories with necessary configurations:- Backend (
server/.env
):MONGO_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret_key EMAIL_HOST=your_email_host EMAIL_PORT=your_email_port EMAIL_USERNAME=your_email_username EMAIL_PASSWORD=your_email_password
- Backend (
-
Frontend (
client/.env
):REACT_APP_API_URL=http://localhost:5000/api
-
-
Run the Application
-
Start the backend server:
npm start
-
Start the frontend application:
cd client npm start
-
-
Open your browser and go to
http://localhost:3000
to view the application.
- User Interface: Users can browse the products, add items to their cart, place orders, and track their order status.
- Admin Dashboard: Admins can log in to manage products and user orders.
The backend exposes several API endpoints for user management, product catalog, and order handling.
- POST
/api/users/register
: Register a new user. - POST
/api/users/login
: Login for an existing user. - GET
/api/users/profile
: Get the current user's profile (requires authentication).
- GET
/api/products
: Get a list of all products. - GET
/api/products/:id
: Get a single product by ID. - POST
/api/products
: Add a new product (admin only). - PUT
/api/products/:id
: Edit a product (admin only). - DELETE
/api/products/:id
: Delete a product (admin only).
- POST
/api/orders
: Place a new order. - GET
/api/orders/:id
: Get the details of a specific order. - GET
/api/orders/user/:userId
: Get all orders for a user (requires authentication).
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature
). - Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature/your-feature
). - Create a new Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.