<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mediawiki.comfac.net/index.php?action=history&amp;feed=atom&amp;title=Webshop-01-Architecture-Overview</id>
	<title>Webshop-01-Architecture-Overview - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mediawiki.comfac.net/index.php?action=history&amp;feed=atom&amp;title=Webshop-01-Architecture-Overview"/>
	<link rel="alternate" type="text/html" href="https://mediawiki.comfac.net/index.php?title=Webshop-01-Architecture-Overview&amp;action=history"/>
	<updated>2026-06-05T11:02:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://mediawiki.comfac.net/index.php?title=Webshop-01-Architecture-Overview&amp;diff=159&amp;oldid=prev</id>
		<title>Justinaquino: &quot;Add all 14 Frappe ERPNext Webshop chapter pages from wikitext-upload&quot;</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.comfac.net/index.php?title=Webshop-01-Architecture-Overview&amp;diff=159&amp;oldid=prev"/>
		<updated>2026-03-06T13:00:41Z</updated>

		<summary type="html">&lt;p&gt;&amp;quot;Add all 14 Frappe ERPNext Webshop chapter pages from wikitext-upload&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= 01 - Architecture Overview =&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parent:&amp;#039;&amp;#039;&amp;#039; [Webshop-Index Webshop Index]  &lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Source:&amp;#039;&amp;#039;&amp;#039; [https://github.com/Comfac-Global-Group/comfac-webshop/wiki/01-Architecture-Overview Comfac Webshop Wiki - Chapter 01]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Framework Stack ==&lt;br /&gt;
&lt;br /&gt;
- &amp;#039;&amp;#039;&amp;#039;Frappe Framework&amp;#039;&amp;#039;&amp;#039; - Python/JS full-stack framework&lt;br /&gt;
  - Server: Python 3, MariaDB/PostgreSQL&lt;br /&gt;
  - ORM: Frappe DocType system (metadata-driven)&lt;br /&gt;
  - Web: Jinja2 templates, jQuery frontend&lt;br /&gt;
  - API: Whitelisted Python functions exposed as REST endpoints&lt;br /&gt;
- &amp;#039;&amp;#039;&amp;#039;ERPNext&amp;#039;&amp;#039;&amp;#039; - ERP layer providing Item, Customer, Quotation, Sales Order, Pricing Rule, etc.&lt;br /&gt;
- &amp;#039;&amp;#039;&amp;#039;Payments&amp;#039;&amp;#039;&amp;#039; - Payment gateway integration&lt;br /&gt;
&lt;br /&gt;
== How the App Integrates ==&lt;br /&gt;
&lt;br /&gt;
The webshop is a &amp;#039;&amp;#039;&amp;#039;Frappe app&amp;#039;&amp;#039;&amp;#039; installed alongside ERPNext. It:&lt;br /&gt;
&lt;br /&gt;
1. &amp;#039;&amp;#039;&amp;#039;Overrides ERPNext DocTypes&amp;#039;&amp;#039;&amp;#039; via &amp;lt;code&amp;gt;override_doctype_class&amp;lt;/code&amp;gt; in hooks.py:&lt;br /&gt;
   - &amp;lt;code&amp;gt;Item&amp;lt;/code&amp;gt; -&amp;gt; adds website publishing fields&lt;br /&gt;
   - &amp;lt;code&amp;gt;Item Group&amp;lt;/code&amp;gt; -&amp;gt; adds website rendering (acts as category pages)&lt;br /&gt;
   - &amp;lt;code&amp;gt;Payment Request&amp;lt;/code&amp;gt; -&amp;gt; customized payment flow&lt;br /&gt;
&lt;br /&gt;
2. &amp;#039;&amp;#039;&amp;#039;Hooks into doc_events&amp;#039;&amp;#039;&amp;#039; for Quotation (validate cart items), Item (sync Website Item), Price List, Tax Rule&lt;br /&gt;
&lt;br /&gt;
3. &amp;#039;&amp;#039;&amp;#039;Provides website generators&amp;#039;&amp;#039;&amp;#039; for &amp;lt;code&amp;gt;Website Item&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Item Group&amp;lt;/code&amp;gt; (auto-generates web pages from DocType records)&lt;br /&gt;
&lt;br /&gt;
4. &amp;#039;&amp;#039;&amp;#039;Registers web pages&amp;#039;&amp;#039;&amp;#039; at:&lt;br /&gt;
   - &amp;lt;code&amp;gt;/all-products&amp;lt;/code&amp;gt; - product listing with filters&lt;br /&gt;
   - &amp;lt;code&amp;gt;/shop-by-category&amp;lt;/code&amp;gt; - category browsing&lt;br /&gt;
   - &amp;lt;code&amp;gt;/cart&amp;lt;/code&amp;gt; - shopping cart page&lt;br /&gt;
   - &amp;lt;code&amp;gt;/orders&amp;lt;/code&amp;gt; - order history&lt;br /&gt;
   - &amp;lt;code&amp;gt;/wishlist&amp;lt;/code&amp;gt; - saved items&lt;br /&gt;
   - &amp;lt;code&amp;gt;/&amp;lt;item-route&amp;gt;&amp;lt;/code&amp;gt; - individual product pages (generated)&lt;br /&gt;
   - &amp;lt;code&amp;gt;/&amp;lt;item-group-route&amp;gt;&amp;lt;/code&amp;gt; - category pages (generated)&lt;br /&gt;
&lt;br /&gt;
== Data Flow Summary ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Website Item (published product)&lt;br /&gt;
    |&lt;br /&gt;
    v&lt;br /&gt;
Product Page (variant selector if template item)&lt;br /&gt;
    |&lt;br /&gt;
    v&lt;br /&gt;
Add to Cart -&amp;gt; Quotation (order_type=&amp;quot;Shopping Cart&amp;quot;, docstatus=0)&lt;br /&gt;
    |           - Quotation Item rows (item_code, qty, rate, amount)&lt;br /&gt;
    |           - Pricing rules applied via ERPNext&lt;br /&gt;
    |           - Taxes calculated&lt;br /&gt;
    v&lt;br /&gt;
Place Order -&amp;gt; Quotation.submit() -&amp;gt; Sales Order created&lt;br /&gt;
    |&lt;br /&gt;
    v&lt;br /&gt;
Payment (if checkout enabled) -&amp;gt; Payment Request&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Key Design Decisions ==&lt;br /&gt;
&lt;br /&gt;
=== 1. Cart = Quotation ===&lt;br /&gt;
The shopping cart IS an ERPNext Quotation document with &amp;lt;code&amp;gt;order_type=&amp;quot;Shopping Cart&amp;quot;&amp;lt;/code&amp;gt;. All pricing, taxes, and discounts flow through ERPNext&amp;#039;s standard Quotation logic.&lt;br /&gt;
&lt;br /&gt;
=== 2. Website Item vs Item ===&lt;br /&gt;
ERPNext &amp;lt;code&amp;gt;Item&amp;lt;/code&amp;gt; is the master. &amp;lt;code&amp;gt;Website Item&amp;lt;/code&amp;gt; is a separate DocType that links to &amp;lt;code&amp;gt;Item&amp;lt;/code&amp;gt; and adds web-specific fields (route, images, description). This allows selective publishing.&lt;br /&gt;
&lt;br /&gt;
=== 3. Variant Handling ===&lt;br /&gt;
Uses ERPNext&amp;#039;s Item Variant system. Template items show a configurator; variant items are the actual purchasable products. Variant data is cached in Redis.&lt;br /&gt;
&lt;br /&gt;
=== 4. No SPA ===&lt;br /&gt;
Traditional server-rendered pages with jQuery for interactivity. Cart updates happen via AJAX calls that return re-rendered HTML fragments.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Next:&amp;#039;&amp;#039;&amp;#039; [Webshop-02-DocTypes 02 - DocTypes]&lt;/div&gt;</summary>
		<author><name>Justinaquino</name></author>
	</entry>
</feed>