How hackstarsj/django-ecommerce-project-amazon-clone works
Project type and purpose
• This is a monolithic full-stack web application built with Django (Python) that functions as an Amazon-style e-commerce admin panel.
• It provides CRUD interfaces for categories, sub-categories, merchants, products, customers, staff, inventory management, media uploads, and uses the Stisla admin theme.
File structure
• Top-level “DjangoEcommerce” directory contains Django project settings (settings.py, urls.py), ASGI/WSGI entrypoints, and the SQLite database file.
• “DjangoEcommerceApp” is the single Django app holding models.py, views.py, AdminViews.py, URL conf (adminurls.py), migrations, templates, static assets, and tests.
• “static” & “DjangoEcommerceApp/static” host CSS/JS/theme modules (Stisla, Bootstrap, DataTables, Summernote, etc.).
• “templates/admin_templates” contains Jinja2/Django templates for the admin UI.
• “media” stores uploaded product media files.
README
• It confirms use of the Stisla theme for UI.
Main components
a. Client Layer
• Web Browser (Admin user)
b. Edge / Reverse Proxy
• Nginx or a load balancer terminating HTTPS and serving static files
c. Application Layer
• WSGI Server (Gunicorn or uWSGI)
• Django Project (“DjangoEcommerce”)
‑ URL Router (django.urls)
‑ View Layer (views.py, AdminViews.py)
‑ Template Engine (Django templates under templates/)
‑ ORM / Model Layer (models.py → SQLite via django.db)
‑ Business logic (inventory management, pagination, search)
d. Data Layer
• SQLite database (db.sqlite3)
• Media file storage (local filesystem under /media)
e. Static Asset Layer
• WhiteNoise or Nginx serving /static and /DjangoEcommerceApp/static
f. External/Optional Services
• Email SMTP for notifications (if configured)
• CDN for offloading static modules (optional)
• Third-party APIs (none in current code)
Relationships and interactions
• Browser → (HTTPS) → Nginx
• Nginx:
• If request path starts with /static or /media, serve files directly
• Else proxy to Gunicorn
• Gunicorn (WSGI) → Django URL Router → matched View
• View → ORM queries/updates → SQLite
• View → render() → template → HTML response
• HTML → Browser
• Browser fetches additional assets (/static/js, /static/css) directly from Nginx
• File uploads (media) handled by Django → saved to /media
Architectural patterns and design principles
• MVC/MVT pattern: Models (models.py), Views (views.py), Templates
• Layered architecture: presentation (templates), business (views), data (ORM, DB)
• Separation of concerns: static assets vs. dynamic requests
• Single-app monolith: easy to deploy but can be broken into micro-services if scaled
Essential elements to capture
• Admin user’s browser as an external actor
• Reverse proxy/static server separate from the application server
• Django’s MVT internals (URL router, views, templates, models)
• Data storage: relational DB and file storage
• Static asset pipeline and theme modules