Jump to content

Repo comfac-webshop DirectoryMap

From Game in the Brain Wiki
Revision as of 16:33, 9 March 2026 by Ocjustin260223 (talk | contribs) ("Repo analysis: comfac-hrms and comfac-webshop (14 pages)")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Repo:comfac-webshop/DirectoryMap — Directory Structure

Top-Level Structure

Path Purpose Edit Frequency
webshop/ Main app code — e-commerce logic 🟢 YOU WILL EDIT THIS
webshop/public/ CSS, JS, images for website 🟢 YOU WILL EDIT THIS
webshop/templates/ Jinja2 HTML templates 🟢 YOU WILL EDIT THIS
webshop/www/ Web page controllers 🟢 YOU WILL EDIT THIS
setup/ Installation scripts 🔵 GOOD TO KNOW
patches/ Database migrations 🔵 GOOD TO KNOW
.github/ CI/CD workflows ⚫ IGNORE

The 20% You'll Actually Use

Core Directories

Path What It Contains When You'd Edit Here
webshop/hooks.py App configuration, website routes, overrides Changing URLs, adding event handlers
webshop/webshop/doctype/ Webshop DocTypes: Website Item, Wishlist, etc. Adding product fields, wishlist features
webshop/webshop/shopping_cart/ Cart, checkout, order logic Modifying cart behavior, checkout flow
webshop/webshop/crud_events/ Event handlers for ERPNext docs Syncing Item changes to Website Item
webshop/webshop/product_data_engine/ Product search, filtering, listing Customizing product display, search
webshop/www/ Website pages (all, cart, checkout) Changing page layouts, adding new pages
webshop/templates/ Jinja templates for all pages Modifying HTML structure, styling
webshop/public/scss/ SASS stylesheets Changing colors, fonts, responsive design

Key DocType Locations

Webshop DocTypes (in webshop/webshop/doctype/):

DocType Purpose
website_item/ Products displayed on the storefront
webshop_settings/ Store configuration (currency, price list, etc.)
wishlist/, wishlist_item/ Customer wishlist functionality
item_review/ Product reviews and ratings
website_offer/ Promotions and discounts
homepage_featured_product/ Featured products on homepage
recommended_items/ Product recommendations

Override DocTypes (in webshop/webshop/doctype/override_doctype/):

  • item.py, item_group.py — Override ERPNext Item/Item Group
  • payment_request.py — Override payment handling

Shopping Cart System

File Purpose
shopping_cart/cart.py Core cart operations (add, remove, update)
shopping_cart/cart_address.py Shipping/billing address handling
shopping_cart/product_info.py Product availability, pricing
utils/ Helper functions for cart and products

Website Pages (www/)

Path Purpose
www/all-products/ Product listing page
www/cart/ Shopping cart page
www/checkout/ Checkout process
www/orders/ Order history
www/wishlist/ Wishlist page
www/item/ Individual product page (via website_generator)

Templates Structure

Path Purpose
templates/webshop/ Main webshop templates
templates/includes/ Reusable components (navbar, footer, product cards)
templates/pages/ Static page layouts

Frontend Assets (public/)

Path Purpose
public/scss/ SASS stylesheets
public/js/ JavaScript (product page, cart interactions)

File Types Present

Extension Meaning in This Project
.json (in doctype folders) DocType schema definitions
.py Python controllers, server-side logic
.html Jinja2 templates
.scss SASS stylesheets
.js Client-side JavaScript
.md Documentation

Important: Where Config vs Code Lives

  • DocType JSON files (*/doctype/*/*.json) define the structure (fields, types, labels)
  • Python controllers (*/doctype/*/*.py) define behavior (validation, calculations)
  • www/ files define web routes and page logic
  • templates/ files define HTML presentation
  • public/ files define CSS and client-side JS
  • hooks.py wires everything together

Directories to Ignore

  • __pycache__/ — Python bytecode
  • .git/ — Version control
  • node_modules/ — NPM packages
  • Compiled CSS in public/dist/