An end-to-end e-commerce application built with the MERN stack (MongoDB, Express.js, React, Node.js). This project includes key e-commerce functionalities such as product search, cart management, order placement, delivery tracking, and payment integration using Stripe.
- Features
- Tech Stack
- Installation
- Environment Variables
- Usage
- API Documentation
- Future Enhancements
- License
- User Authentication: Secure login and registration with password hashing (using bcrypt) and JWT-based authentication.
- Product Catalog: Browse products with search and filter options.
- Cart Management: Add, update, or remove products from the cart.
- Order Management: Place orders, view order details, and manage order status.
- Payment Integration: Process payments securely using the Stripe API.
- Delivery Tracking: Track the order's delivery status from dispatch to delivery.
- Admin Dashboard: Manage products, orders, users, and inventory (Admin role only).
- Responsive Design: Fully responsive front end with a seamless experience across devices.
- Frontend
-
- React with Redux: State management and UI rendering
-
- React Router: Routing and navigation
-
- Tailwind CSS: Styling and responsive design
- Backend
-
- Node.js with Express.js: REST API development
-
- MongoDB with Mongoose: Database management
-
- JWT: Authentication
-
- Stripe API: Payment processing
Clone the repository:
git clone https://github.com/your-username/mern-ecommerce-app.git
cd mern-ecommerce-appInstall dependencies for both frontend and backend:
- Install backend dependencies
cd backend
npm install- Install frontend dependencies
cd ../frontend
npm installSet up environment variables (see Environment Variables section below).
Run the application:
- Start the backend server:
cd backend
npm start- Start the frontend:
cd ../frontend
npm startCreate a .env file in the backend directory with the following:
Copy code
# Server Port
PORT=5000
# Database URI
MONGO_URI=mongodb://localhost:27017/ecommerce
# JWT Secret
JWT_SECRET=your_jwt_secret
# Stripe API Keys
STRIPE_SECRET_KEY=your_stripe_secret_key
STRIPE_PUBLIC_KEY=your_stripe_public_key
# Frontend URL
CLIENT_URL=http://localhost:3000
- User Registration & Logins Register as a new user or log in with existing credentials. Access features like cart management and order history once logged in.
- Product Catalog Browse, search, and filter products by category, price, etc. View product details on individual product pages.
- Cart Management Add products to the cart. Modify product quantity or remove items from the cart.
- Checkout & Payment Proceed to checkout with items in the cart. Complete payments securely via Stripe.
- Order Tracking View the order summary and track the delivery status. Receive email notifications for order status updates.
- Admin Dashboard Only available for users with admin access. Manage products, orders, and users. Update order statuses for delivery tracking.
- User Routes: Register, login, profile management.
- Product Routes: Fetch all products, product details, search, and filter.
- Cart Routes: Add, update, and delete items in the cart.
- Order Routes: Place orders, view orders, and update delivery status.
- Payment Routes: Stripe payment integration. (Refer to backend/routes for detailed route information.)
- Wishlist: Add functionality to save products for later.
- Product Recommendations: Integrate a recommendation engine based on user behavior.
- Push Notifications: Enable real-time notifications for order updates.
- Product Reviews: Allow users to leave reviews and ratings on products.
This project is licensed under the MIT License. See the LICENSE file for details.