A modern, scalable, and customizable e-commerce platform built with Django. Features a beautiful responsive design, comprehensive product management, shopping cart functionality, customer accounts, and easy white-labeling capabilities.
- Product Management: Comprehensive product catalog with categories, variants, and attributes
- Shopping Cart: Full-featured cart with AJAX updates and session persistence
- Checkout Process: Streamlined checkout with multiple payment options
- Order Management: Complete order processing and tracking system
- Inventory Control: Stock management with low inventory alerts
- User Authentication: Custom registration and login system
- Customer Accounts: Personal dashboards with order history
- Wishlist System: Save products for later (authenticated users)
- Address Management: Multiple shipping/billing addresses
- Order Tracking: Real-time order status updates
- Responsive Design: Mobile-first approach with Tailwind CSS
- Dark/Light Mode: Built-in theme switching
- Customizable Themes: Easy rebranding with CSS variables
- Interactive Components: Alpine.js and HTMX for dynamic interactions
- Professional UI: Clean, modern interface design
- Django 5.x: Latest Django framework with best practices
- PostgreSQL: Robust database with full-text search
- Redis: Caching and session management
- Celery: Background task processing
- Docker Ready: Production deployment configuration
- SEO Optimized: Search engine friendly URLs and meta tags
- Python 3.8+
- PostgreSQL 12+
- Redis (optional, for caching)
- Node.js (for development)
-
Clone the repository
git clone https://github.com/yourusername/xcommerce.git cd xcommerce
-
Create virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Environment setup
cp .env.example .env # Edit .env with your configuration
-
Database setup
python manage.py makemigrations python manage.py migrate python manage.py createsuperuser
-
Run development server
python manage.py runserver
Visit http://localhost:8000
to see your xCommerce store!
xcommerce/
βββ xcommerce/ # Main project settings
βββ core/ # Core functionality and homepage
βββ products/ # Product catalog and management
βββ customers/ # User accounts and authentication
βββ cart/ # Shopping cart and wishlist
βββ orders/ # Order processing and management
βββ payments/ # Payment processing integration
βββ templates/ # HTML templates
β βββ base.html
β βββ components/ # Reusable UI components
β βββ store/ # Store pages
β βββ products/ # Product pages
β βββ customers/ # Account pages
β βββ cart/ # Cart and checkout
βββ static/ # Static files (CSS, JS, images)
βββ media/ # User uploaded files
βββ requirements.txt # Python dependencies
βββ manage.py # Django management script
Create a .env
file in the project root:
# Database
DATABASE_URL=postgresql://user:password@localhost:5432/xcommerce
# Security
SECRET_KEY=your-secret-key-here
DEBUG=True
# Redis (optional)
REDIS_URL=redis://localhost:6379/0
# Email (for order notifications)
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USE_TLS=True
EMAIL_HOST_USER=your-email@gmail.com
EMAIL_HOST_PASSWORD=your-app-password
# Storage (for production)
AWS_ACCESS_KEY_ID=your-aws-key
AWS_SECRET_ACCESS_KEY=your-aws-secret
AWS_STORAGE_BUCKET_NAME=your-bucket-name
The project supports multiple database backends:
- SQLite (development): Default, no setup required
- PostgreSQL (recommended): Set
DATABASE_URL
in.env
- MySQL: Compatible with minor configuration changes
xCommerce uses CSS variables for easy theme customization. Edit static/css/main.css
:
:root {
/* Primary Brand Colors */
--color-primary-50: #f0f9ff;
--color-primary-500: #0ea5e9;
--color-primary-600: #0284c7;
--color-primary-700: #0369a1;
/* Secondary Colors */
--color-secondary-500: #64748b;
/* Success, Warning, Error */
--color-success-500: #10b981;
--color-warning-500: #f59e0b;
--color-error-500: #ef4444;
/* Typography */
--font-family-primary: 'Inter', sans-serif;
--font-family-heading: 'Inter', sans-serif;
/* Spacing */
--border-radius: 0.5rem;
--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
--shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}
- Logo: Upload your logo in Django Admin β Core β Store
- Store Name: Configure in Django Admin β Core β Store
- Favicon: Set custom favicon in store settings
- Colors: Update CSS variables as shown above
- Typography: Change font families in CSS variables
Access Django Admin at /admin/
to configure:
- Store Settings: Name, logo, description, contact info
- Categories: Product categories and navigation
- Products: Add/edit products, images, variants
- Pages: Create custom pages (About, Terms, etc.)
- Email Templates: Customize order confirmation emails
-
Build the image
docker build -t xcommerce .
-
Run with docker-compose
docker-compose up -d
-
Prepare for production
pip install gunicorn python manage.py collectstatic python manage.py migrate
-
Configure web server (Nginx example)
server { listen 80; server_name yourdomain.com; location /static/ { alias /path/to/xcommerce/static/; } location /media/ { alias /path/to/xcommerce/media/; } location / { proxy_pass http://127.0.0.1:8000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } }
-
Run with Gunicorn
gunicorn xcommerce.wsgi:application --bind 0.0.0.0:8000
xCommerce is designed to integrate with popular payment processors:
- Stripe: Credit cards, digital wallets
- PayPal: PayPal and credit card processing
- Square: In-person and online payments
- Custom: Build your own payment integration
- FedEx: Real-time rates and tracking
- UPS: Shipping rates and label printing
- USPS: Postal service integration
- Custom: Add your preferred shipping provider
- Google Analytics: E-commerce tracking
- Mailchimp: Email marketing integration
- Twilio: SMS notifications
- Cloudinary: Advanced image processing
- Customer registration trends
- Product performance metrics
- Order completion rates
- Revenue reporting
Configure Google Analytics 4 for advanced e-commerce tracking:
<!-- Add to base.html template -->
<!-- Google Analytics 4 -->
<script async src="https://www.googletagmanager.com/gtag/js?id=GA_TRACKING_ID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'GA_TRACKING_ID');
</script>
Run the test suite:
# Run all tests
python manage.py test
# Run specific app tests
python manage.py test products
# Run with coverage
coverage run --source='.' manage.py test
coverage report
xCommerce includes a REST API for mobile apps and integrations:
- Products API:
/api/products/
- Cart API:
/api/cart/
- Orders API:
/api/orders/
- Customers API:
/api/customers/
API documentation is available at /api/docs/
when running the server.
- 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
# Install development dependencies
pip install -r requirements-dev.txt
# Run pre-commit hooks
pre-commit install
# Run linting
flake8 .
black .
Database connection error
# Check PostgreSQL is running
sudo systemctl status postgresql
# Verify database exists
psql -U postgres -l
Static files not loading
# Collect static files
python manage.py collectstatic --clear
# Check STATIC_ROOT setting
Cart not persisting
# Check session configuration
python manage.py check --deploy
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: Check the docs folder
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: support@yourcompany.com
- Django community for the amazing framework
- Tailwind CSS for the utility-first CSS framework
- Alpine.js for lightweight interactivity
- All contributors who helped build this platform
- Multi-vendor marketplace support
- Advanced inventory management
- Subscription products
- Multi-language support
- Mobile app API
- Advanced analytics dashboard
- AI-powered product recommendations
Made with β€οΈ by the xCommerce team
Transform your business with a modern e-commerce platform that grows with you.