███╗ ███╗ █████╗ ██████╗ ██╗ ██╗███████╗████████╗███╗ ██╗███████╗██╗ ██╗██╗ ██╗███████╗
████╗ ████║██╔══██╗██╔══██╗██║ ██╔╝██╔════╝╚══██╔══╝████╗ ██║██╔════╝╚██╗██╔╝██║ ██║██╔════╝
██╔████╔██║███████║██████╔╝█████╔╝ █████╗ ██║ ██╔██╗ ██║█████╗ ╚███╔╝ ██║ ██║███████╗
██║╚██╔╝██║██╔══██║██╔══██╗██╔═██╗ ██╔══╝ ██║ ██║╚██╗██║██╔══╝ ██╔██╗ ██║ ██║╚════██║
██║ ╚═╝ ██║██║ ██║██║ ██║██║ ██╗███████╗ ██║ ██║ ╚████║███████╗██╔╝ ██╗╚██████╔╝███████║
╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝
🌟 Features • 🏗️ Architecture • 🛠️ Tech Stack • 📦 Installation • ⚙️ Configuration • 🚀 Usage • 🔒 Security • 📈 Performance • 🗺️ Roadmap
MarketNexus is a comprehensive, full-stack e-commerce platform engineered with Django and styled with Tailwind CSS. It integrates every critical component of modern online retail — from a smart product catalog with live metrics and advanced filtering, to multi-method payment processing, AI-powered customer support, professional invoice generation, and a session-backed wishlist system — all inside one clean, scalable codebase.
| 🕐 Availability | 🌍 Global Reach | 📊 Catalog Insights | 🔒 Security | 💬 AI Support | 🧾 Invoicing |
|---|---|---|---|---|---|
| 24/7, sub-2s response | Cross-browser & device | Real-time metrics & filters | CSRF · XSS · SQLi | Gemini-powered assistant | Auto-generated, PDF-ready |
✅ Secure registration with email validation
✅ Login with PBKDF2 password hashing
✅ Profile & customer information management
✅ Session-based authentication & expiry
✅ Secure cookie-backed session management
The catalog is the centrepiece of MarketNexus — built with an advanced filtering engine, live review metrics, and session-backed UX enhancements.
✅ 50+ products with real-time stock display
✅ Search by product name (persists in session history)
✅ Filter by: category · supplier · price range · in-stock only
✅ Sort by: price ↑↓ · name A–Z · stock level · rating
✅ Live average rating + review count on every product card
✅ Catalog insight cards:
→ Total results count
→ Stock health indicator
→ Average price across current results
→ Top categories in current view
✅ Session-based saved products (wishlist-style — no schema changes needed)
✅ Recent search history persisted per session
✅ Add / remove products with one click
✅ Quantity management with live total recalculation
✅ Persistent cart storage across sessions
✅ Update cart items in-place
✅ Full cart summary with itemised breakdown
✅ Credit Card → Full card detail form with validation
✅ UPI → QR-code based fast payments with real-time confirmation
✅ Bank Transfer → Reference number issued, order confirmation provided
✅ Server-side form validation on all payment methods
✅ Secure transaction handling throughout
✅ Direct purchase (Buy Now) flow
✅ Full cart checkout flow
✅ Automatic stock deduction on order placement
✅ Order status tracking with live updates
✅ Estimated delivery date shown per order
✅ Complete order history accessible per user
✅ Auto-generated immediately after every successful payment
✅ Full customer details displayed
✅ Itemised product breakdown with quantities and prices
✅ Payment method details included
✅ Professional formatting with MarketNexus branding
✅ Invoice history accessible at any time
✅ Download as PDF
✅ 5-star rating system per product
✅ Text-based review submission
✅ Review history per customer
✅ Average rating and review count surfaced live on product cards
✅ Gemini AI-powered assistant (google-generativeai)
✅ Real-time message interface with typing indicators
✅ Quick-action shortcut buttons for common queries
✅ Full chat history within session
✅ Graceful auto-response fallback when API is unavailable
✅ Mobile optimised → 375px+
✅ Tablet support → 768px+
✅ Desktop layout → 1920px
✅ Cross-browser: Chrome · Firefox · Safari · Edge (all v90+)
✅ Rebranded MarketNexus storefront experience across all templates
✅ Material Design Icons + Google Fonts throughout
✅ CSRF protection on every form via Django middleware
✅ PBKDF2 password hashing with salt (Django built-in)
✅ SQL injection prevention via Django ORM (no raw SQL)
✅ XSS prevention via Django template auto-escaping
✅ Secure, HTTP-only session cookies
✅ Server-side input validation on all user-facing forms
✅ HTTPS-ready with SSL redirect configuration
┌──────────────────────────────────────────────────────────────────────┐
│ PRESENTATION LAYER │
│ HTML5 · Tailwind CSS · JavaScript ES6+ │
│ │
│ Catalog UX · Cart UI · Auth Forms · Payment Forms │
│ Invoice View · Review Page · AI Chat Interface │
└──────────────────────────────┬───────────────────────────────────────┘
│ HTTP / WSGI
▼
┌──────────────────────────────────────────────────────────────────────┐
│ APPLICATION LAYER │
│ Django 5.2.7 · Python 3.9+ │
│ │
│ Authentication · Product Catalog · Cart Management │
│ Order Processing · Payment Handling · Invoice Generation │
│ Review System · Gemini Chat API · Session Management │
└──────────────────────────────┬───────────────────────────────────────┘
│ Django ORM
▼
┌──────────────────────────────────────────────────────────────────────┐
│ DATA LAYER │
│ SQLite (development) · PostgreSQL 12+ (production) │
│ │
│ Users · Products · Orders · Payments · Carts · Reviews │
└──────────────────────────────────────────────────────────────────────┘
╔══════════════════════════════════════════════════════════════════════════════╗
║ SHOPPING FLOW ║
║ ║
║ Register / Login ──▶ Browse Catalog ──▶ Filter & Sort ──▶ Save / Cart║
║ ║
║ Cart Review ──▶ Checkout ──▶ Select Payment ──▶ Confirm Order ║
║ ║
║ Auto Invoice ──▶ View / Download Invoice ──▶ Track Order Status ║
╚══════════════════════════════════════════════════════════════════════════════╝
╔══════════════════════════════════════════════════════════════════════════╗
║ SUPPORT FLOW ║
║ ║
║ Open Chat ──▶ Type or Quick-Action ──▶ Gemini Responds ║
║ ║
║ Continue Conversation ──▶ View Session History ║
╚══════════════════════════════════════════════════════════════════════════╝
Ecommerce/
│
├── manage.py # Django entry point
├── db.sqlite3 # Local development database
├── requirements.txt # Python dependencies
├── README.md
│
├── ecommerce/ # Project configuration
│ ├── settings.py # Django settings
│ ├── urls.py # Root URL routing
│ ├── wsgi.py # Production WSGI entry
│ └── asgi.py # ASGI configuration
│
├── store/ # Core application
│ ├── models.py # Domain models (products, orders, payments, carts, reviews)
│ ├── views.py # Auth · Catalog · Cart · Orders · Payments · Chat APIs
│ ├── urls.py # App URL routing
│ ├── forms.py # Django form definitions
│ ├── admin.py # Admin panel configuration
│ └── migrations/ # Database migration history
│
├── templates/
│ ├── list_products.html # ★ Upgraded catalog — filters, sorting, insights, wishlist
│ ├── product_detail.html # Product detail view
│ ├── view_cart.html # Cart summary & management
│ ├── checkout.html # Checkout flow
│ ├── payment_form.html # Payment method forms
│ ├── order_confirmation.html # Post-purchase confirmation
│ ├── user_orders.html # Order history
│ ├── user_payments.html # Payment history
│ ├── invoice.html # Invoice display + PDF
│ ├── review_page.html # Review submission
│ ├── chat.html # AI support chat
│ ├── login.html # Authentication
│ └── signup.html # Registration
│
└── static/
├── css/ # Custom stylesheets
├── js/ # Client-side scripts
└── images/ # Static image assets
| Layer | Technology | Version |
|---|---|---|
| Language | Python | 3.9+ |
| Web Framework | Django | 5.2.7 |
| ORM | Django ORM | built-in |
| Frontend Styling | Tailwind CSS | 3.x |
| Frontend Scripting | JavaScript | ES6+ |
| Icons | Material Design Icons | latest |
| Typography | Google Fonts | latest |
| AI Chat | Google Gemini API (google-generativeai) |
latest |
| Database — Dev | SQLite | built-in |
| Database — Prod | PostgreSQL | 12+ |
| Auth System | Django Built-in Auth | built-in |
| Version Control | Git | latest |
Ensure the following are installed before proceeding:
- ✅ Python 3.9 or higher
- ✅ pip (Python package manager)
- ✅ Git
git clone https://github.com/Akshay9024/Ecommerce.git
cd EcommerceWindows
python -m venv venv
venv\Scripts\activatemacOS / Linux
python3 -m venv venv
source venv/bin/activatepip install django google-generativeai# Apply all migrations
python manage.py migrate
# (Optional) Create a Django admin superuser
python manage.py createsuperuserpython manage.py runserver🟢 Application is live at http://127.0.0.1:8000/
# ── Database ──────────────────────────────────────────────────────────────────
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
# For production, switch to PostgreSQL:
# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.postgresql',
# 'NAME': 'marketnexus',
# 'USER': 'your_db_user',
# 'PASSWORD': 'your_db_password',
# 'HOST': 'localhost',
# 'PORT': '5432',
# }
# }
# ── Static Files ───────────────────────────────────────────────────────────────
STATIC_URL = '/static/'
STATICFILES_DIRS = [BASE_DIR / 'static']
# ── Installed Apps ─────────────────────────────────────────────────────────────
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'store',
]
# ── Security (enable all in production) ────────────────────────────────────────
CSRF_COOKIE_SECURE = True
SESSION_COOKIE_SECURE = True
SECURE_SSL_REDIRECT = TrueFind the placeholder in store/views.py:
YOUR_NEW_SAFE_API_KEY = "keep your api key here"Replace with your Gemini API key. For any environment beyond local development, use environment variables:
import os
YOUR_NEW_SAFE_API_KEY = os.environ.get("GEMINI_API_KEY")
⚠️ Never commit API keys or secrets to version control.
| URL | Description |
|---|---|
http://localhost:8000/ |
Home / Storefront |
http://localhost:8000/products/ |
Product catalog with filters & sorting |
http://localhost:8000/login/ |
User login |
http://localhost:8000/signup/ |
User registration |
http://localhost:8000/cart/ |
Shopping cart |
http://localhost:8000/orders/ |
Order history |
http://localhost:8000/chat/ |
AI support chat |
http://localhost:8000/admin/ |
Django admin panel |
🔍 Search → Filter by product name (persists in session history)
🏷️ Category → Narrow results to a product category
🏭 Supplier → View products from a specific supplier
💰 Price Range → Set minimum and maximum price bounds
📦 In Stock Only → Toggle to hide out-of-stock items instantly
↕️ Sort Order → Price ↑ · Price ↓ · Name A–Z · Stock Level · Rating
❤️ Save Product → Add to session wishlist without any schema dependency
🕓 Search History → Recently searched terms surfaced for quick reuse
| Method | Flow |
|---|---|
| 💳 Credit Card | Fill card details → Submit → Instant confirmation → Invoice generated |
| 📱 UPI | Scan QR code → Approve in UPI app → Real-time confirmation → Invoice generated |
| 🏦 Bank Transfer | Receive reference number → Transfer → Confirmation provided → Invoice generated |
| Threat Vector | Protection Mechanism |
|---|---|
| Cross-Site Request Forgery (CSRF) | Django CSRF middleware — token on every form |
| SQL Injection | Django ORM parameterised queries — zero raw SQL |
| Cross-Site Scripting (XSS) | Django template auto-escaping on all outputs |
| Weak Passwords | PBKDF2 hashing with cryptographic salt |
| Session Hijacking | HTTP-only, Secure flag session cookies |
| Man-in-the-Middle | HTTPS + SECURE_SSL_REDIRECT = True (production) |
| Malformed Input | Server-side validation on all user-facing forms |
| Page | Load Time | DB Query Time |
|---|---|---|
| Login | ~400ms | <50ms |
| Product Catalog | ~800ms | <100ms |
| Cart | ~300ms | <100ms |
| Payment | ~500ms | <100ms |
| Orders | ~600ms | <150ms |
| Invoice | ~450ms | <100ms |
✅ 50+ concurrent users supported
✅ 99% system availability target
✅ Sub-2 second response time on all pages
✅ Full cross-browser compatibility verified
| Component | Minimum | Recommended |
|---|---|---|
| CPU | Intel i3 / AMD Ryzen 3 | Intel i5 / AMD Ryzen 5+ |
| RAM | 4 GB | 8 GB |
| Storage | 500 MB free | 1 GB+ free |
| Display | 1280×720 | 1920×1080 |
- ✅ Windows 10 / 11
- ✅ macOS 10.13 or higher
- ✅ Ubuntu 18.04 or higher
- ✅ Any Linux distribution with Python 3.9+
| Browser | Minimum Version | Support Level |
|---|---|---|
| Google Chrome | 90+ | ✅ Full |
| Mozilla Firefox | 88+ | ✅ Full |
| Apple Safari | 14+ | ✅ Full |
| Microsoft Edge | 90+ | ✅ Full |
✅ User Authentication → 100%
✅ Product Catalog → 100%
✅ Shopping Cart → 100%
✅ Payment Processing → 100%
✅ Order Management → 100%
✅ Invoice Generation → 100%
✅ Review & Rating System → 100%
✅ AI Chat Interface → 100%
✅ Mobile 375px+
✅ Tablet 768px+
✅ Desktop 1920px
- Django Software Foundation — Django Web Framework Documentation
- Tailwind Labs — Tailwind CSS: Utility-First CSS Framework
- Google — Gemini API Documentation
- Mozilla Developer Network — Web Development References
- Python Software Foundation — Python Official Documentation
- W3C — Web Standards and Specifications
- PostgreSQL Global Development Group — PostgreSQL Documentation
Contributions, issues, and feature requests are welcome.
# 1. Fork the repository
# 2. Create your feature branch
git checkout -b feature/your-feature-name
# 3. Commit your changes
git commit -m "feat: add your feature description"
# 4. Push to your branch
git push origin feature/your-feature-name
# 5. Open a Pull Request on GitHubFor bug reports, feature requests, or questions — open an issue on GitHub.
GitHub: github.com/Akshay9024
╔══════════════════════════════════════════╗
║ Built with Python by Akshay ║
╚══════════════════════════════════════════╝
⭐ If MarketNexus helped you, give it a star — it means a lot! ⭐
Happy Shopping! 🛒