Skip to content

Br1zz1713/ecoshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

116 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

EcoShop - High-Performance Full-Stack E-commerce MVP

EcoShop

Production-Ready | Scalable Architecture | Enterprise-Grade Code Quality

Django React PostgreSQL License: MIT


πŸ“‹ Executive Summary

EcoShop is a professionally architected, full-stack e-commerce platform built with modern technologies and enterprise-grade development practices. This production-ready MVP features a fully decoupled architecture, enabling independent scaling of frontend and backend services while maintaining clean API contracts. Designed with extensibility and maintainability at its core, EcoShop provides a robust foundation for launching high-performance e-commerce ventures with minimal time-to-market.


✨ Core Features

πŸ” User Authentication & Authorization

  • JWT-based authentication with secure token management (access/refresh tokens)
  • Custom user model supporting phone number and email-based login
  • Role-based access control with admin/staff permissions
  • Secure password handling with Django's built-in encryption
  • Session management with automatic token refresh

πŸ›οΈ Dynamic Product Catalog

  • Advanced filtering system by category, skin type, and ingredients
  • Multi-image product gallery with optimized image handling
  • Real-time search and category-based navigation
  • Product view tracking for analytics and insights
  • Detailed product specifications including volume, country of origin, and ingredients

πŸ›’ Shopping Cart & Checkout

  • Persistent cart state with real-time quantity updates
  • Seamless checkout flow with customer information collection
  • Order management system with status tracking
  • Price calculation engine with support for discounts and promotions

πŸŽ›οΈ Integrated Admin Dashboard

  • Full CRUD operations for products, categories, and orders
  • Image upload functionality with validation and optimization
  • Category management with featured product assignments
  • Order tracking and customer management
  • Blog post management for content marketing

🎨 Responsive & Modern UI/UX

  • Multi-language support: English, Ukrainian, Russian with instant switching
  • Dark/Light theme with persistent user preferences
  • Mobile-first responsive design optimized for all screen sizes
  • Smooth animations and micro-interactions for enhanced UX
  • Accessibility-focused with semantic HTML and ARIA labels

πŸ› οΈ Technical Stack

Layer Technology Purpose
Frontend Framework React 18 Component-based UI with hooks and context API
Build Tool Vite 5 Lightning-fast HMR and optimized production builds
Styling Tailwind CSS Utility-first CSS with custom design system
State Management React Context API Global state for auth, cart, theme, and language
HTTP Client Axios Promise-based API communication with interceptors
Routing React Router DOM 6 Client-side routing with lazy loading
Icons Lucide React Modern, scalable icon library
Backend Framework Django 6.0 High-level Python web framework
API Layer Django REST Framework Powerful toolkit for building Web APIs
Authentication SimpleJWT JWT authentication for stateless sessions
Database (Production) Supabase (PostgreSQL) Enterprise-grade relational database
Database (Development) SQLite3 Lightweight database for local development
ORM Django ORM Database abstraction with migrations
File Storage Supabase Storage (S3) Object storage for product images and media
CORS Handling django-cors-headers Cross-origin resource sharing configuration
Static Files WhiteNoise Efficient static file serving for production
Image Processing Pillow Python imaging library for product photos
Security CSP, HSTS Content Security Policy and HTTP Strict Transport Security
Frontend Deployment Vercel Edge network with automatic HTTPS
Backend Deployment Railway / Render Container-based deployment with Supabase DB
CI/CD Git-based Automated deployments on push

πŸ—οΈ Software Architecture

Decoupled Architecture (API-First Design)

EcoShop implements a modern, decoupled architecture that separates the frontend and backend into independent services communicating via a RESTful API. This architectural pattern provides significant advantages for scalability, maintainability, and team collaboration.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     FRONTEND LAYER (React SPA)                   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”          β”‚
β”‚  β”‚   Pages      β”‚  β”‚  Components  β”‚  β”‚   Contexts   β”‚          β”‚
β”‚  β”‚  (Routes)    β”‚  β”‚  (Reusable)  β”‚  β”‚   (State)    β”‚          β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β”‚
β”‚         β”‚                  β”‚                  β”‚                  β”‚
β”‚         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                  β”‚
β”‚                            β”‚                                     β”‚
β”‚                       Axios Client                               β”‚
β”‚                            β”‚                                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚
                    RESTful API (JSON)
                             β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                            β”‚                                     β”‚
β”‚                  Django REST Framework                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”          β”‚
β”‚  β”‚   ViewSets   β”‚  β”‚    Models    β”‚  β”‚ Serializers  β”‚          β”‚
β”‚  β”‚   (API)      β”‚  β”‚    (ORM)     β”‚  β”‚   (JSON)     β”‚          β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β”‚
β”‚         β”‚                  β”‚                  β”‚                  β”‚
β”‚         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                  β”‚
β”‚                            β”‚                                     β”‚
β”‚                      PostgreSQL                                  β”‚
β”‚                   (Relational Database)                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Architectural Benefits

βœ… Independent Scaling: Frontend and backend can scale independently based on traffic patterns
βœ… Technology Flexibility: Replace or upgrade either layer without affecting the other
βœ… Team Collaboration: Frontend and backend teams work in parallel with clear API contracts
βœ… API Reusability: Same backend API can serve web, mobile, and third-party integrations
βœ… Deployment Flexibility: Deploy to different platforms optimized for each layer
βœ… Maintenance Efficiency: Clear separation of concerns simplifies debugging and updates

Clean API Design

The API follows RESTful principles with:

  • Resource-based URLs (/api/products/, /api/categories/)
  • HTTP method semantics (GET, POST, PUT, DELETE)
  • JSON request/response format for universal compatibility
  • JWT token authentication for stateless, scalable sessions
  • Versioned endpoints for backward compatibility
  • Comprehensive error handling with meaningful status codes

πŸš€ Deployment & CI/CD

Production-Ready Infrastructure

EcoShop is fully configured for production deployment with automated CI/CD pipelines, ensuring zero-downtime updates and seamless scalability.

Deployment Pipeline

Developer Push β†’ GitHub Repository β†’ Automated Build β†’ Environment Config β†’ Database Migration β†’ Live Deployment

1. Code Push: Developer commits and pushes to GitHub
2. Automatic Build: Vercel/Railway detect changes and trigger builds
3. Environment Configuration: Secrets loaded from platform dashboards
4. Database Migration: Django migrations run automatically
5. Static Asset Optimization: Frontend assets minified and served via CDN
6. Live Deployment: Changes go live within 2-3 minutes

Deployment Platforms

Service Platform Features
Frontend Vercel Edge network, automatic HTTPS, instant rollbacks
Backend Railway / Render Container deployment, auto-scaling
Database Supabase Managed PostgreSQL with real-time capabilities
Storage Supabase Storage S3-compatible object storage for media
Static Files WhiteNoise + CDN Compressed assets with cache headers

Environment Variables

Backend (Railway):

SECRET_KEY=your-django-secret-key-here
DATABASE_URL=postgresql://user:password@host:port/database
ALLOWED_HOSTS=yourdomain.com,www.yourdomain.com
DEBUG=False

Frontend (Vercel):

VITE_API_URL=https://your-backend-api.railway.app

Security Note: Never commit .env files to version control. All sensitive keys should be configured in your deployment platform's dashboard.

CI/CD Features

βœ… Automatic deployments on git push to main branch
βœ… Preview deployments for pull requests
βœ… Instant rollbacks to previous versions
βœ… Zero-downtime deployments with health checks
βœ… Environment-based configuration for staging/production
βœ… Automated database migrations on deployment


πŸ“¦ Installation & Setup

Prerequisites

  • Python 3.10+ (Backend)
  • Node.js 18+ (Frontend)
  • PostgreSQL (Optional, for production-like environment)
  • Git (Version control)

Backend Setup

# Clone the repository
git clone https://github.com/Br1zz1713/ecoshop.git
cd ecoshop

# Create and activate virtual environment
python -m venv venv
venv\Scripts\activate  # Windows
# source venv/bin/activate  # macOS/Linux

# Install dependencies
pip install -r requirements.txt

# Optional: if Supabase/remote DB is unavailable locally
set FORCE_SQLITE=true

# Run database migrations
python manage.py migrate

# Create superuser for admin access
python manage.py createsuperuser

# Start Django development server
python manage.py runserver

Backend runs on: http://localhost:8000
Admin panel: http://localhost:8000/admin

Frontend Setup

# Navigate to frontend directory
cd frontend

# Install dependencies
npm install

# Start Vite development server
npm run dev

Frontend runs on: http://localhost:5173

Health Endpoints

  • GET /health/live/ - process is alive
  • GET /health/ready/ - database and storage readiness
  • GET /ping/ - DB reachability quick check

Quick Start (Windows)

# One-click startup script
start_local.bat

This automated script will:

  • βœ… Activate virtual environment
  • βœ… Run database migrations
  • βœ… Start backend server (port 8000)
  • βœ… Start frontend server (port 5173)
  • βœ… Open application in browser

πŸ“ Code Standards

Python Backend (PEP8 Compliance)

EcoShop adheres to PEP 8 - the official Python style guide, ensuring code readability and maintainability:

βœ… 4-space indentation for consistent formatting
βœ… Descriptive variable names following snake_case convention
βœ… Docstrings for all public modules, functions, classes, and methods
βœ… Type hints for improved code documentation
βœ… Maximum line length of 79 characters for code, 72 for comments
βœ… Import organization (standard library, third-party, local)
βœ… Class and function naming following PEP 8 conventions

React Frontend (Industry Standards)

The frontend follows modern React best practices and component-based architecture:

βœ… Functional components with React Hooks (useState, useEffect, useContext)
βœ… Component composition for reusability and maintainability
βœ… Custom hooks for shared logic extraction
βœ… Context API for global state management
βœ… PropTypes/TypeScript for type safety (expandable)
βœ… CSS-in-JS with Tailwind utility classes
βœ… Code splitting with React.lazy for performance
βœ… Consistent file structure (components, pages, contexts, utils)

Additional Standards

  • Git commit messages following conventional commits format
  • Environment-based configuration (no hardcoded secrets)
  • Error handling with try-catch blocks and user-friendly messages
  • Security best practices (CSRF protection, XSS prevention, SQL injection protection)
  • Performance optimization (lazy loading, code splitting, image optimization)

πŸ“Š Project Statistics

  • 6,574 Lines of Code - Substantial, production-ready codebase
  • 50+ Git Commits - Professional version control history
  • 8 Django Apps - Modular, maintainable backend architecture
  • 20+ React Components - Reusable UI building blocks
  • 15+ API Endpoints - Comprehensive backend coverage
  • 3 Language Support - English, Ukrainian, Russian
  • 100% Responsive - Mobile, tablet, desktop optimized

🎯 Use Cases

EcoShop is ideal for:

  • 🌿 Eco-friendly product marketplaces
  • πŸ’„ Cosmetics and beauty stores
  • πŸ›οΈ Boutique e-commerce ventures
  • πŸ“¦ Dropshipping platforms
  • πŸͺ Multi-vendor marketplaces (with extensions)
  • 🎁 Subscription box services (with modifications)

πŸ”’ Security Features

  • JWT Authentication with secure token rotation
  • HTTPS Enforcement in production
  • CSRF Protection for all state-changing operations
  • Content Security Policy (CSP) headers
  • HTTP Strict Transport Security (HSTS)
  • Secure cookie handling with HttpOnly and Secure flags
  • SQL Injection Protection via Django ORM
  • XSS Prevention with React's built-in escaping
  • Environment-based secrets (no hardcoded credentials)

πŸ“ˆ Scalability & Performance

  • Decoupled architecture for independent scaling
  • Database indexing on frequently queried fields
  • Static file compression with WhiteNoise
  • Lazy loading for images and components
  • Code splitting for optimized bundle sizes
  • CDN integration for global content delivery
  • Database connection pooling for efficient resource usage
  • Caching strategies (expandable with Redis)

πŸ“„ License

This project is licensed under the MIT License.

MIT License

Copyright (c) 2025 EcoShop

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

🀝 Support & Contact

For commercial inquiries, customization requests, or technical support:


Built with πŸ’š using Django REST Framework & React

Enterprise-Grade | Production-Ready | Scalable Architecture

⭐ Star this repository if you find it valuable!

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors