How aditya-bachhav/wrappdelights works
1. Top-level shape
- This is a single Django monolith for a gifting/catalog store called WrappDelights.
- The main application code lives under delights_backend/core, with one Django project package (core) and one primary app (store).
2. Execution model
- The app is served as a server-side rendered Django site using templates, not a separate frontend.
- The WSGI entrypoint is delights_backend/core/core/wsgi.py; asgi.py also exists, but the deployment path is WSGI/Gunicorn-oriented.
3. Request routing boundary
- Global URL routing is centralized in core/urls.py.
- That router fans out into public store pages, custom hamper flows, corporate inquiry flows, and dashboard/admin routes defined in store/views.py and related templates.
4. Domain/application layer
- The store app contains the business logic and Django models for the catalog and ordering domain.
- The migrations show the core entities evolved around: products, categories, banners, carts, favorites, hampers, hamper items, predefined bundles, corporate inquiries, and order items.
5. Public customer-facing surfaces
- Customer pages are template-driven and include:
- homepage and catalog browsing
- product detail and search
- favorites
- corporate inquiry page and success page
- custom hamper builder flow with step/review screens
- These are backed by store/views.py, forms.py, and shared UI fragments in templates/partials.
6. Admin and internal dashboard boundary
- There are two distinct privileged interfaces:
- Django admin, mounted at a secret path via ADMIN_PANEL_PATH
- a custom dashboard under /dashboard/
- Dashboard templates live in templates/dashboard/ and cover product/category/bundle/section management, orders, and corporate requests.
- Access is restricted to superusers.
7. Data persistence
- Locally, the repo includes db.sqlite3; on Render it is designed to use DATABASE_URL, implying a hosted database such as PostgreSQL.
- Media files are stored under core/media/, with product and bundle assets separated into subfolders.
- Static assets are handled through Django’s static pipeline, which is why the build step matters for admin CSS and other collected assets.
8. Operational tooling and bootstrap commands
- The repo includes several management commands under store/management/commands/ for operational tasks:
- creating/ensuring an admin user
- importing products
- seeding the catalog
- assigning categories
- listing/setup/checking categories
- These commands are part of the deployment and content-initialization workflow, not the request path.
9. Category hierarchy subsystem
- Categories are a notable architectural feature, not just a label field.
- Migrations add parent/child relationships, slug fixes, images, and hierarchy population logic.
- There are supporting scripts like check_category_slugs.py, verify_categories.py, and assign_categories.py, indicating category integrity is maintained both in-app and through standalone checks.
10. Custom hamper / bundle subsystem
- Hampers are a first-class product construct with pricing, steps, included items, and image support.
- Predefined bundles exist alongside custom hamper creation, so the product model is extended into curated compositions rather than only single SKUs.
11. Content and interaction flows
- The main data flows are:
- catalog data → product/category pages
- user selections → cart/favorites/hamper state
- inquiry form submissions → corporate inquiry records
- admin/dashboard edits → persisted catalog and category updates
- Most flows stay inside Django’s request/response cycle and database-backed models.
12. Deployment and environment
- render.yaml, build.sh, and requirements.txt show this is designed for Render deployment.
- The README emphasizes running migrations and superuser bootstrap at startup, which means the runtime depends on environment variables such as SECRET_KEY, DATABASE_URL, DEBUG, and admin bootstrap credentials.
13. Repository layout for diagramming
- A good architecture diagram should show:
- the Django runtime at the center
- public browser traffic into core/urls.py
- store/views.py and templates as the presentation layer
- store/models.py plus migrations as the persistence/domain layer
- management commands and scripts as an operational side lane
- media/static storage as external file storage
- Render/Postgres as deployment/database infrastructure
Main entry points: views.py Views · models.py Models · settings.py Settings · render.yaml Render deploy
Components 21
Django runtime
Server-side Django project, URL routing, and deployment entrypoints
- WSGI entry · Gunicorn-oriented server entrypoint
delights_backend/core/core/wsgi.py - ASGI entry · Async entrypoint kept alongside WSGI
delights_backend/core/core/asgi.py - Settings · Project configuration and environment wiring
delights_backend/core/core/settings.py - URL router · Central fan-out for public, custom hamper, corporate, dashboard, and admin routes
delights_backend/core/core/urls.py
Store app
Domain logic, request handlers, forms, and admin customization
- Models · Catalog, category, hamper, bundle, cart, favorite, inquiry, and order data model
delights_backend/core/store/models.py - Views · Public pages, hamper flow, corporate inquiries, and dashboard handlers
delights_backend/core/store/views.py - Forms · Validated inputs for customer and internal workflows
delights_backend/core/store/forms.py - Admin · Admin registrations and custom admin hooks
delights_backend/core/store/admin.py - Context · Shared template context processors
delights_backend/core/store/context_processors.py
Templates
Shared shell plus public and dashboard presentation templates
- Base layout · Common site shell used by public and dashboard pages
delights_backend/core/store/templates/base.html - Public pages · Homepage, products, search, favorites, corporate, and custom hamper screens
delights_backend/core/store/templates/home.html - Dashboard UI · Privileged management screens for products, categories, bundles, orders, and inquiries
delights_backend/core/store/templates/dashboard/dashboard.html - Partials · Reusable navbar, footer, and product card fragments
delights_backend/core/store/templates/partials/navbar.html
Ops & data
Migrations, management commands, scripts, media, database, and deployment
- Migrations · Schema evolution for products, categories, hampers, bundles, inquiries, favorites, and orders
delights_backend/core/store/migrations/0001_initial.py - Commands · Catalog import, seeding, category setup, and admin bootstrap commands
delights_backend/core/store/management/commands/import_products.py - Scripts · Standalone category checks and assignment helpers
delights_backend/core/assign_categories.py - Media files · Uploaded product and bundle assets
delights_backend/core/media/products - SQLite DB · Local development database snapshot
delights_backend/core/db.sqlite3 - Render deploy · Render build and runtime configuration
render.yaml - Build step · Deployment build and collect-static step
build.sh - Dependencies · Python package set for the monolith
requirements.txt
Connections 22
- WSGI entry → Settings: loads · WSGI bootstraps project configuration
- ASGI entry → Settings: loads · ASGI bootstraps the same settings
- URL router → Views: dispatches to · Routes public, custom hamper, corporate, and dashboard requests into view handlers
- URL router → Admin: mounts admin · Exposes Django admin at a protected path
- Views → Models: reads/writes · Request handlers operate on catalog and ordering data
- Views → Forms: validates · Form-backed customer, hamper, and inquiry submissions
- Views → Public pages: renders · Customer-facing browsing, search, favorites, corporate, and hamper flows
- Views → Dashboard UI: renders · Dashboard management screens for privileged users
- Views → Partials: composes · Public and dashboard pages reuse shared fragments
- Context → Base layout: feeds · Shared context supports the site shell and fragments
- Models → Migrations: evolves via · Schema and domain changes are captured in migrations
- Admin → Dashboard UI: customizes · Admin surfaces use custom templates and widgets
- Commands → Models: operates on · Commands import, seed, and normalize catalog data
- Scripts → Models: verifies · Standalone scripts check and repair category integrity
- Render deploy → Build step: invokes · Render deploy relies on build-time preparation
- Build step → Dependencies: installs · Build step depends on the Python package set
- Render deploy → SQLite DB: provisions · Deployment uses an external database in production
- Models → SQLite DB: persists to · Domain data is stored in the database
- Models → Media files: references · Products and bundles use uploaded media assets
- Commands → Render deploy: bootstrap workflow · Commands support startup and content initialization
- Settings → SQLite DB: connects to · Settings select local SQLite or DATABASE_URL-backed storage
- Settings → Media files: serves · Settings configure media handling for uploaded assets