Skip to content

mansi066/ShopX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ShopX - E-Commerce Platform

ShopX is a full-featured e-commerce web application built with Django. It provides a complete shopping experience with user authentication, product catalog, shopping cart, and order management.

Features

  • User Management

    • User registration and authentication
    • User login/logout with session management
    • Password change functionality
    • User profile management
  • Product Management

    • Browse product catalog
    • View detailed product information
    • Mobile-friendly product browsing
    • Product image gallery
  • Shopping Cart

    • Add/remove products from cart
    • View cart contents
    • Empty cart functionality
    • Real-time cart updates
  • Checkout & Orders

    • Secure checkout process
    • Address management and validation
    • Buy now functionality
    • Order history and tracking
    • Order management dashboard
  • Payment Integration

    • Support for multiple payment methods
  • Responsive Design

    • Mobile-optimized interface
    • Responsive CSS styling
    • Cross-browser compatibility

Tech Stack

  • Backend: Django 3.1.5
  • Database: SQLite3
  • Frontend: HTML5, CSS3, JavaScript
  • UI Components: Bootstrap, Owl Carousel
  • Image Processing: Pillow

Project Structure

ShopX/
├── app/                           # Main Django application
│   ├── models.py                 # Database models
│   ├── views.py                  # View logic
│   ├── urls.py                   # URL routing
│   ├── forms.py                  # Django forms
│   ├── admin.py                  # Admin configuration
│   ├── migrations/               # Database migrations
│   ├── templates/app/            # HTML templates
│   └── static/app/               # CSS, JS, images
├── shopx/                         # Project configuration
│   ├── settings.py               # Django settings
│   ├── urls.py                   # Project URL configuration
│   ├── asgi.py                   # ASGI config
│   └── wsgi.py                   # WSGI config
├── media/                         # User-uploaded media
│   └── productimage/             # Product images
├── manage.py                      # Django management script
├── requirements.txt               # Python dependencies
├── build.sh                       # Build and deployment script
└── db.sqlite3                     # SQLite database

Installation

Prerequisites

  • Python 3.6 or higher
  • pip (Python package manager)
  • Virtual environment (recommended)

Setup Instructions

  1. Clone the repository

    git clone <repository-url>
    cd ShopX
  2. Create and activate virtual environment

    python -m venv venv
    # On Windows
    venv\Scripts\activate
    # On Linux/Mac
    source venv/bin/activate
  3. Install dependencies

    pip install -r requirements.txt
  4. Run migrations

    python manage.py migrate
  5. Create a superuser (admin)

    python manage.py createsuperuser
  6. Collect static files (for production)

    python manage.py collectstatic --no-input

Running the Application

Development Server

python manage.py runserver

The application will be available at http://localhost:8000/

Access Admin Panel

Navigate to http://localhost:8000/admin/ and log in with your superuser credentials.

Build Script

Use the provided build.sh script for automated setup:

bash build.sh

This script will:

  • Install all dependencies from requirements.txt
  • Collect static files
  • Run database migrations

Database

The project uses SQLite3 for the database. The database file db.sqlite3 is created after the first migration.

Running Migrations

To create new migrations:

python manage.py makemigrations

To apply migrations:

python manage.py migrate

Templates

Available Templates

  • home.html - Homepage with product listings
  • login.html - User login page
  • customerregistration.html - New user registration
  • productdetail.html - Detailed product view
  • addtocart.html - Add to cart functionality
  • cart.html - Shopping cart display
  • checkout.html - Checkout process
  • orders.html - Order history
  • address.html - Address management
  • profile.html - User profile
  • changepassword.html - Password change
  • mobile.html - Mobile-optimized view
  • base.html - Base template with common layout

Static Files

CSS

  • bootstrap - CSS framework
  • owl.carousel.min.css - Carousel styling
  • style.css - Custom application styles

JavaScript

  • owl.carousel.min.js - Carousel functionality
  • bootstrap - JavaScript components
  • myscript.js - Custom application scripts

Images

  • Banner images
  • Product images
  • Payment method icons

API Endpoints

The application provides the following main endpoints:

  • / - Homepage
  • /login/ - User login
  • /register/ - User registration
  • /product/<id>/ - Product details
  • /cart/ - Shopping cart
  • /checkout/ - Checkout process
  • /orders/ - Order history
  • /profile/ - User profile
  • /address/ - Address management

Models

Customer

  • Linked to Django User model
  • Stores customer information (name, locality, etc.)
  • Supports multiple addresses for Indian states

Product

  • Product details and pricing
  • Image support
  • Category classification

Order

  • Order tracking
  • Order status management
  • Order details and history

Development

Making Changes

  1. Create a new branch for your feature
  2. Make your changes
  3. Test thoroughly
  4. Submit a pull request

Code Style

  • Follow PEP 8 guidelines for Python
  • Use meaningful variable and function names
  • Add comments for complex logic
  • Keep functions small and focused

Troubleshooting

Common Issues

ModuleNotFoundError

  • Ensure virtual environment is activated
  • Run pip install -r requirements.txt

Database Error

  • Run python manage.py migrate
  • Delete db.sqlite3 and re-run migrations if needed

Static Files Not Loading

  • Run python manage.py collectstatic --no-input
  • Check STATIC_ROOT setting in settings.py

Port Already in Use

  • Use a different port: python manage.py runserver 8001

Deployment

For production deployment:

  1. Set DEBUG = False in settings.py
  2. Configure ALLOWED_HOSTS
  3. Use environment variables for SECRET_KEY
  4. Set up a production database (PostgreSQL recommended)
  5. Configure a web server (Nginx, Apache)
  6. Use a production WSGI server (Gunicorn, uWSGI)

Refer to Django deployment documentation for detailed instructions.

License

This project is provided as-is for educational and commercial purposes.

Support

For issues and questions:

Future Enhancements

  • Payment gateway integration (Stripe, PayPal, RazorPay)
  • Email notifications
  • SMS notifications
  • Advanced search and filtering
  • Product reviews and ratings
  • Wishlist functionality
  • Admin dashboard analytics
  • Inventory management
  • Multi-language support

Version: 1.0.0
Last Updated: May 2026

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors