A full-stack, enterprise-grade e-commerce platform with AI-powered recommendations, chatbot support, fraud detection, sentiment analysis, price prediction, and more.
Built with Django + Oracle SQL + Redis + Groq AI + HTML/CSS/JavaScript
- Features
- Tech Stack
- Screenshots
- Prerequisites — What You Need Before Starting
- Step-by-Step Installation Guide
- Running the Application
- Login Credentials
- All Pages & URLs
- Project Structure
- AI Features Explained
- API Endpoints
- Oracle SQL Setup (Optional)
- Redis Setup (Optional)
- Troubleshooting
- Contributing
- License
| # | Feature | Description |
|---|---|---|
| 1 | 🔐 User Authentication | Login, Sign Up, Logout with secure password hashing |
| 2 | 👤 User Profiles | Profile management, avatar, loyalty points, premium status |
| 3 | 📍 Address Management | Multiple shipping/billing addresses with default selection |
| 4 | 🛍️ Product Catalog | 16+ products across 8 categories with search, filter, sort, pagination |
| 5 | 🛒 Shopping Cart | Add, update, remove items with real-time AJAX updates |
| 6 | 📝 Checkout Flow | Multi-step checkout with saved address selection |
| 7 | 💳 Payment Processing | Simulated payment gateway (Card, UPI, Net Banking, COD) |
| 8 | 📦 Order Management | Order history, status tracking, order details |
| 9 | 📍 Order Tracking | Real-time tracking timeline with progress visualization |
| 10 | 🤖 AI Recommendation Engine | Groq-powered personalized product recommendations |
| 11 | 💬 AI Chatbot Support | 24/7 AI customer support chatbot on every page |
| 12 | 🛡️ Fraud Detection | AI-powered order fraud risk scoring and flagging |
| 13 | 📊 Sentiment Analysis | Automatic review sentiment scoring (positive/negative/neutral) |
| 14 | 🔮 Price Prediction | AI-based price trend analysis and buy/wait recommendations |
| 15 | 🕵️ Fake Review Detection | AI-powered detection of suspicious/fake reviews |
| 16 | 📈 Admin Analytics Dashboard | Revenue charts, top products, fraud alerts, AI insights |
| 17 | 🏭 Warehouse Dashboard | Inventory management, stock alerts, shipment tracking |
| 18 | 🎨 Glassmorphism UI | Premium frosted-glass design with orange & purple theme |
| Layer | Technology | Purpose |
|---|---|---|
| Backend | Python 3.10+ & Django 5.x | Server, business logic, ORM |
| Frontend | HTML5, CSS3, JavaScript (ES6+) | UI with glassmorphism design |
| Database | SQLite (dev) / Oracle SQL (prod) | Data storage |
| AI/ML | Groq API (LLaMA 3.3 70B) | All AI features |
| Cache | Redis (optional) | Session & data caching |
| API | Django REST Framework | RESTful API endpoints |
| Design | Glassmorphism + Inter Font | Premium enterprise UI |
After running the app, visit
http://127.0.0.1:8000/to see:
- Home Page — Hero section, featured products, categories, deals
- Product Listing — Grid layout with filters and sorting
- Product Detail — Reviews, AI price prediction, related products
- Shopping Cart — Item management with order summary
- Checkout — Shipping address form with saved addresses
- Payment — Card/UPI/COD payment options
- Admin Analytics — Revenue charts, fraud alerts, AI insights
- Warehouse — Inventory levels, stock alerts, shipments
⚠️ IMPORTANT: Read this section carefully if you have never used Python or Django before.
Python is the programming language this project is built with. You need version 3.10 or higher.
- Go to the official Python website: https://www.python.org/downloads/
- Click the big yellow "Download Python 3.x.x" button
- Run the downloaded installer (
.exefile) ⚠️ VERY IMPORTANT: On the first screen of the installer, check the box that says:This is at the bottom of the installer window. If you miss this, nothing will work!☑ Add Python to PATH- Click "Install Now"
- Wait for installation to complete, then click "Close"
Open Command Prompt (press Win + R, type cmd, press Enter) and type:
python --versionYou should see something like:
Python 3.10.x
If you see Python was not found or an error, Python was not added to PATH. Reinstall and make sure to check "Add Python to PATH".
# Install Homebrew first (if not installed)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Python
brew install python@3.10sudo apt update
sudo apt install python3 python3-pip python3-venvGit is needed to download (clone) this project.
- Go to: https://git-scm.com/download/win
- Download and run the installer
- Click "Next" through all options (defaults are fine)
- Click "Install"
git --versionYou should see: git version 2.x.x
brew install gitsudo apt install gitTo view or edit the code, install one of these:
- VS Code (Recommended): https://code.visualstudio.com/
- Notepad++: https://notepad-plus-plus.org/
Any modern browser works: Chrome, Firefox, Edge, or Safari.
Follow these steps exactly in order. Copy-paste each command.
- Windows: Press
Win + R, typecmd, press Enter - macOS: Press
Cmd + Space, typeTerminal, press Enter - Linux: Press
Ctrl + Alt + T
Navigate to where you want the project. For example, your Desktop:
# Windows
cd %USERPROFILE%\Desktop
# macOS / Linux
cd ~/Desktopgit clone https://github.com/vasistacv/Ecommerce.gitThis creates a folder called Ecommerce with all the project files.
cd EcommerceA virtual environment keeps this project's packages separate from your system Python.
# Windows
python -m venv .venv
# macOS / Linux
python3 -m venv .venv# Windows (Command Prompt)
.venv\Scripts\activate
# Windows (PowerShell)
.venv\Scripts\Activate.ps1
# macOS / Linux
source .venv/bin/activateAfter activation, you should see (.venv) at the beginning of your command line:
(.venv) C:\Users\YourName\Desktop\Ecommerce>
⚠️ You must activate the virtual environment every time you open a new terminal window to run the project.
pip install -r requirements.txtThis will download and install Django, Groq AI, and all other dependencies. Wait for it to finish (may take 1-2 minutes).
You should see Successfully installed ... at the end.
⚠️ Note: The.envfile in the repository is committed with a placeholder key. Anyone cloning the repo needs to add their own Groq API key. Your real key is safe locally and.envis in.gitignorefor future commits.
To use the AI features (Chatbot, Recommendations, Fraud Detection, etc.), you need a free Groq API key:
- Go to the Groq Console
- Create a free account or log in
- Click on "Create API Key" and copy the generated key
- Open the
.envfile in the project folder - Replace the placeholder value with your actual key:
GROQ_API_KEY=gsk_your_actual_api_key_here
# Create database tables
python manage.py makemigrations accounts products cart orders payments ai_engine warehouse
python manage.py migratepython manage.py seed_dataYou should see:
Seeding database...
[OK] Superuser created (admin/admin123)
[OK] Test users created
[OK] Categories created
[OK] 16 products created
[OK] Reviews created
[OK] Price history created
[OK] Warehouses & inventory created
[OK] Addresses created
Database seeded successfully!
Admin Login: admin / admin123
Test User: user1 / password123
python manage.py runserverYou should see:
Starting development server at http://127.0.0.1:8000/
Open your web browser and go to:
🎉 The SmartShop e-commerce platform is now running on your computer!
Every time you want to run the application after the first setup:
# 1. Open Command Prompt / Terminal
# 2. Go to the project folder
cd path\to\Ecommerce
# 3. Activate the virtual environment
# Windows:
.venv\Scripts\activate
# macOS/Linux:
source .venv/bin/activate
# 4. Start the server
python manage.py runserver
# 5. Open http://127.0.0.1:8000/ in your browserTo stop the server, press Ctrl + C in the terminal.
| Role | Username | Password | Access Level |
|---|---|---|---|
| Admin | admin |
admin123 |
Full access + Analytics + Warehouse + Django Admin |
| Test User 1 | user1 |
password123 |
Normal shopping user |
| Test User 2 | user2 |
password123 |
Normal shopping user |
| Test User 3 | user3 |
password123 |
Normal shopping user |
You can also create your own account via the Sign Up page!
| Page | URL | Access |
|---|---|---|
| Home Page | http://127.0.0.1:8000/ |
Everyone |
| All Products | http://127.0.0.1:8000/products/ |
Everyone |
| Product Detail | http://127.0.0.1:8000/products/<slug>/ |
Everyone |
| Login | http://127.0.0.1:8000/accounts/login/ |
Everyone |
| Register | http://127.0.0.1:8000/accounts/register/ |
Everyone |
| Profile | http://127.0.0.1:8000/accounts/profile/ |
Logged in |
| Shopping Cart | http://127.0.0.1:8000/cart/ |
Logged in |
| Checkout | http://127.0.0.1:8000/orders/checkout/ |
Logged in |
| My Orders | http://127.0.0.1:8000/orders/ |
Logged in |
| Order Tracking | http://127.0.0.1:8000/orders/<id>/track/ |
Logged in |
| Analytics Dashboard | http://127.0.0.1:8000/analytics/dashboard/ |
Admin only |
| Warehouse Dashboard | http://127.0.0.1:8000/warehouse/dashboard/ |
Admin only |
| Django Admin Panel | http://127.0.0.1:8000/admin/ |
Admin only |
| AI Chatbot | 💬 Button (bottom-right corner) | Everyone |
Ecommerce/
│
├── manage.py # Django management script
├── requirements.txt # Python package dependencies
├── setup.bat # Windows auto-setup script
├── .env # Environment variables (API keys, DB config)
├── db.sqlite3 # SQLite database (auto-generated)
│
├── config/ # Django project configuration
│ ├── settings.py # Main settings (DB, cache, apps, AI config)
│ ├── urls.py # Root URL routing
│ ├── wsgi.py # WSGI entry point
│ └── asgi.py # ASGI entry point
│
├── accounts/ # User authentication & profiles
│ ├── models.py # UserProfile, Address, UserActivity models
│ ├── views.py # Login, Register, Profile, Address views
│ ├── forms.py # Registration, Login, Profile forms
│ ├── urls.py # URL routing
│ └── admin.py # Admin panel registration
│
├── products/ # Product catalog
│ ├── models.py # Product, Category, Review, PriceHistory
│ ├── views.py # Product list, detail, search, review
│ ├── urls.py # URL routing
│ ├── admin.py # Admin panel registration
│ └── management/commands/ # seed_data command
│
├── cart/ # Shopping cart
│ ├── models.py # Cart, CartItem models
│ ├── views.py # Add, update, remove, clear cart
│ ├── urls.py # URL routing
│ └── context_processors.py # Cart count in navbar
│
├── orders/ # Order management
│ ├── models.py # Order, OrderItem, OrderTracking
│ ├── views.py # Checkout, order list, detail, tracking
│ ├── urls.py # URL routing
│ └── admin.py # Admin with inline items & tracking
│
├── payments/ # Payment processing
│ ├── models.py # Payment model (Card, UPI, COD, etc.)
│ ├── views.py # Payment processing & success page
│ ├── urls.py # URL routing
│ └── admin.py # Admin panel registration
│
├── ai_engine/ # 🤖 AI/ML features (Groq API)
│ ├── groq_client.py # Groq API client wrapper
│ ├── recommender.py # AI product recommendation engine
│ ├── chatbot.py # AI customer support chatbot
│ ├── fraud_detection.py # AI fraud risk scoring
│ ├── sentiment.py # AI review sentiment analysis
│ ├── price_prediction.py # AI price trend prediction
│ ├── fake_review.py # AI fake review detection
│ ├── views.py # API endpoints for all AI features
│ └── urls.py # URL routing
│
├── analytics/ # Admin analytics dashboard
│ ├── views.py # Dashboard with metrics & charts
│ └── urls.py # URL routing
│
├── warehouse/ # Warehouse management
│ ├── models.py # Warehouse, Inventory, Shipment
│ ├── views.py # Warehouse dashboard
│ ├── urls.py # URL routing
│ └── admin.py # Admin panel registration
│
├── templates/ # HTML templates
│ ├── base.html # Master template (navbar, footer, chatbot)
│ ├── home.html # Homepage
│ ├── accounts/ # Login, register, profile, address forms
│ ├── products/ # Product list & detail pages
│ ├── cart/ # Shopping cart page
│ ├── orders/ # Checkout, order list, detail, tracking
│ ├── payments/ # Payment form & success page
│ ├── analytics/ # Admin analytics dashboard
│ └── warehouse/ # Warehouse management dashboard
│
├── static/ # Static assets
│ ├── css/style.css # Main stylesheet (glassmorphism theme)
│ └── js/
│ ├── main.js # Core JavaScript (cart AJAX, search)
│ ├── chatbot.js # AI chatbot widget
│ └── analytics.js # Dashboard charts (Chart.js)
│
└── sql/ # Database scripts
└── schema.sql # Oracle SQL schema (all tables)
All AI features are powered by the Groq API using the LLaMA 3.3 70B model.
- Analyzes user browsing history, purchases, and cart activity
- Recommends products based on preferences, categories, and price range
- Provides personalized reasons for each recommendation
- Available on every page via the 💬 floating button
- Knows about orders, shipping policies, returns, and products
- Context-aware: sees user's recent orders and loyalty points
- Maintains conversation history for natural dialog
- Analyzes orders for suspicious patterns
- Considers: order value vs history, new accounts, unusual quantities
- Returns risk score (0-1) with approve/review/reject recommendation
- Flags high-risk orders in admin dashboard
- Automatically analyzes review text for sentiment
- Scores from -1 (negative) to +1 (positive)
- Labels: positive / negative / neutral
- Extracts key points from each review
- Analyzes 30-day price history and market factors
- Predicts price trend: up / down / stable
- Provides buy now / wait / neutral recommendation
- Available on each product detail page
- Checks reviews for signs of inauthenticity
- Analyzes: vague language, mismatched rating/content, generic text
- Flags suspicious reviews with confidence score
- Visible in admin dashboard
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/ai/chat/ |
AI Chatbot — send message, get response |
GET |
/api/ai/recommend/ |
Get AI recommendations |
POST |
/api/ai/fraud-check/ |
Check order for fraud |
POST |
/api/ai/sentiment/ |
Analyze review sentiment |
GET |
/api/ai/predict-price/?product=<slug> |
Predict product price |
POST |
/api/ai/fake-review/ |
Detect fake reviews |
curl -X POST http://127.0.0.1:8000/api/ai/chat/ \
-H "Content-Type: application/json" \
-d '{"message": "What are your shipping policies?"}'Note: The project runs on SQLite by default — no Oracle needed for development. Oracle is for production deployment.
If you want to use Oracle SQL:
Download from: https://www.oracle.com/database/technologies/xe-downloads.html
-- Connect as SYSDBA
sqlplus sys/password@localhost:1521/XEPDB1 as sysdba
-- Create user
CREATE USER ecommerce_user IDENTIFIED BY ecommerce_pass;
GRANT CONNECT, RESOURCE, DBA TO ecommerce_user;
ALTER USER ecommerce_user QUOTA UNLIMITED ON USERS;@sql/schema.sqlIn config/settings.py, uncomment the Oracle database config and comment out SQLite:
# Oracle SQL (uncomment this)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.oracle',
'NAME': 'XEPDB1',
'USER': 'ecommerce_user',
'PASSWORD': 'ecommerce_pass',
'HOST': 'localhost',
'PORT': '1521',
}
}pip install oracledbRedis provides faster caching and session management.
- Download Redis for Windows: https://github.com/microsoftarchive/redis/releases
- Install and start Redis service
- Install Python Redis packages:
pip install redis django-redis
brew install redis
brew services start redissudo apt install redis-server
sudo systemctl start redisRedis is automatically detected — if running, the app uses it; if not, it falls back to in-memory cache.
- Python is not in your PATH
- Reinstall Python and check "Add Python to PATH"
- Or use the full path:
C:\Users\YourName\AppData\Local\Programs\Python\Python310\python.exe
- Virtual environment is not activated
- Run:
.venv\Scripts\activate(Windows) orsource .venv/bin/activate(Mac/Linux) - Then:
pip install -r requirements.txt
- Database tables not created
- Run:
python manage.py migrate
- Make sure you're in the project root directory (where
manage.pyis) - Check that the
templates/folder exists
- Another process is using port 8000
- Use a different port:
python manage.py runserver 8080 - Then visit:
http://127.0.0.1:8080/
- Check your Groq API key in
.envfile - Ensure you have internet connection
- The chatbot will show a fallback message if the API is unreachable
- Run:
python manage.py collectstatic - Or ensure
DEBUG = Trueinconfig/settings.py
- This is a Windows console encoding issue
- The application itself works fine in the browser
- Emojis display correctly in web pages
- 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 open source and available under the MIT License.
Vasista CV
- GitHub: @vasistacv
Built with ❤️ using Django + Groq AI
SmartShop — Where AI Meets Shopping