A modern, feature-rich e-commerce platform for clothing retail with intelligent product recommendations powered by machine learning algorithms.
This comprehensive e-commerce solution combines the power of the MERN stack with Python-based AI recommendations to deliver a personalized shopping experience. The platform features a customer-facing storefront, administrative dashboard, and sophisticated recommendation engine that learns from user behavior to suggest relevant products.
- Intelligent Product Recommendations: AI-powered suggestions based on user behavior and preferences
- Advanced Search & Filtering: Smart product discovery with multiple filter options
- Shopping Cart & Wishlist: Seamless shopping experience with save-for-later functionality
- User Reviews & Ratings: Community-driven product feedback system
- Order Tracking: Real-time order status updates and history
- Responsive Design: Optimized for desktop, tablet, and mobile devices
- Secure User Authentication: JWT-based authentication system
- Profile Management: Comprehensive user profile with order history
- Password Security: Bcrypt encryption for secure password storage
- Midtrans Payment Integration: Secure payment processing
- Order Management: Complete order lifecycle management
- Real-time Updates: Live order status tracking
- Admin Dashboard: Comprehensive analytics and management interface
- Product Management: Full CRUD operations for product catalog
- Order Management: Order processing and fulfillment tracking
- User Management: Customer account oversight
- Real-time Analytics: Dashboard with sales metrics and insights
- Recommendation Engine: Python-based ML algorithms for product suggestions
- TF-IDF Analysis: Content-based filtering for product recommendations
- Behavior Analytics: User interaction tracking for improved suggestions
- React 18 - Modern UI framework with hooks
- Vite - Fast build tool and development server
- React Router DOM - Client-side routing
- Tailwind CSS - Utility-first CSS framework
- Swiper.js - Touch slider for product galleries
- React Toastify - Notification system
- Node.js - JavaScript runtime environment
- Express.js - Web application framework
- MongoDB - NoSQL database
- JWT - Authentication tokens
- Bcrypt - Password hashing
- Multer - File upload handling
- Cloudinary - Image storage and optimization
- Midtrans - Payment gateway integration
- Python 3.8+ - Programming language
- Flask - Micro web framework
- Pandas - Data manipulation and analysis
- NumPy - Numerical computing
- Scikit-learn - Machine learning library
- TF-IDF - Text analysis for recommendations
- ESLint - Code linting
- Prettier - Code formatting
- Nodemon - Development server auto-reload
- CORS - Cross-origin resource sharing
- Node.js (v16 or higher)
- Python (v3.8 or higher)
- MongoDB (v4.4 or higher)
- npm or pnpm package manager
-
Clone the Repository
git clone https://github.com/joyva20/ecommerce-ai.git cd FullStack-Ecommerce-Clothing -
Setup Python Environment & AI Service
cd recommendation-service python -m venv venv # On Windows venv\Scripts\activate # On macOS/Linux source venv/bin/activate pip install -r requirements.txt cd ..
-
Install Node.js Dependencies
# Backend dependencies cd backend npm install cd .. # Frontend dependencies cd frontend npm install cd .. # Admin panel dependencies cd admin npm install cd ..
-
Environment Configuration
Create
.envfile in thebackenddirectory:MONGODB_URI=mongodb://localhost:27017/ecommerce-ai JWT_SECRET=your-super-secret-jwt-key CLOUDINARY_CLOUD_NAME=your-cloudinary-name CLOUDINARY_API_KEY=your-cloudinary-api-key CLOUDINARY_API_SECRET=your-cloudinary-api-secret MIDTRANS_SERVER_KEY=your-midtrans-server-key MIDTRANS_CLIENT_KEY=your-midtrans-client-key ADMIN_EMAIL=admin@example.com ADMIN_PASSWORD=your-admin-password
Create
.envfile in therecommendation-servicedirectory:FLASK_ENV=development BACKEND_URL=http://localhost:4000
-
Database Setup
# Make sure MongoDB is running # The application will create necessary collections automatically
-
Start All Services (Recommended for development)
# Use the provided batch script (Windows) start-all.bat # Or start services individually:
-
Start Services Individually
# Terminal 1: Backend Server cd backend npm run server # Terminal 2: Frontend Development Server cd frontend npm run dev # Terminal 3: Admin Panel cd admin npm run dev # Terminal 4: AI Recommendation Service cd recommendation-service python app.py
# Build frontend and admin
cd frontend && npm run build && cd ..
cd admin && npm run build && cd ..
# Start backend in production
cd backend && npm start- Frontend (Customer): http://localhost:5173
- Admin Dashboard: http://localhost:5174
- Backend API: http://localhost:4000
- AI Recommendation Service: http://localhost:5000
FullStack-Ecommerce-Clothing/
βββ π backend/ # Express.js API server
β βββ π config/ # Database and service configurations
β βββ π controllers/ # API route handlers
β βββ π middleware/ # Authentication and validation
β βββ π models/ # MongoDB data models
β βββ π routes/ # API route definitions
β βββ server.js # Main server file
βββ π frontend/ # React customer interface
β βββ π src/
β β βββ π components/ # Reusable React components
β β βββ π pages/ # Page components
β β βββ π assets/ # Static assets
β βββ package.json
βββ π admin/ # React admin dashboard
β βββ π src/
β β βββ π components/ # Admin UI components
β β βββ π pages/ # Admin pages
β βββ package.json
βββ π recommendation-service/ # Python ML service
β βββ π models/ # ML models and algorithms
β βββ π data/ # Training data and datasets
β βββ app.py # Flask application
β βββ requirements.txt
βββ π recycle-bin/ # Archived documentation
βββ π md/ # Moved markdown files
POST /api/user/register- User registrationPOST /api/user/login- User loginPOST /api/admin/login- Admin login
GET /api/product/list- Get all productsPOST /api/product/add- Add new product (Admin)PUT /api/product/update/:id- Update product (Admin)DELETE /api/product/remove/:id- Remove product (Admin)
POST /api/order/place- Place new orderGET /api/order/list- Get user ordersGET /api/order/status/:id- Get order status
GET /api/recommendations/user/:userId- Get personalized recommendationsPOST /api/recommendations/train- Retrain ML models
The recommendation engine uses multiple algorithms:
- Content-Based Filtering: TF-IDF analysis of product descriptions
- Collaborative Filtering: User behavior pattern analysis
- Hybrid Approach: Combination of both methods for optimal results
cd recommendation-service
python train_model.py# Backend tests
cd backend
npm test
# Frontend tests
cd frontend
npm test
# ML service tests
cd recommendation-service
python -m pytest tests/- Customer Journey: Browse products β Add to cart β Checkout β Track order
- Admin Management: Product management β Order processing β Analytics
- AI Recommendations: Personalized suggestions based on user behavior
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the ISC License - see the LICENSE file for details.
Joyva20 - GitHub Profile
- React community for excellent documentation
- Scikit-learn for ML algorithms
- MongoDB for flexible database solutions
- Midtrans for payment gateway integration
β If you found this project helpful, please give it a star!