# tg11-org/storefront architecture

> Architecture diagram of the GitHub repository tg11-org/storefront, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tg11-org/storefront
- Repository: https://github.com/tg11-org/storefront

## Overview

TG11 Shop is a Django ecommerce storefront with marketplace and fulfillment integrations. The main customer journey is browsing the catalog, building a cart, then submitting checkout; checkout coordinates pricing, order creation, and payment. A successful payment updates order state and can initiate fulfillment. Supporting branches cover customer accounts, promotions/shipping/tax, marketplace listing and order synchronization, and staff merchandising. The graph uses sampled source references and README claims; some provider-specific and unsampled routes are therefore shown only as documented, unverified integrations.

Main entry points: [`checkout/views.py`](https://github.com/tg11-org/storefront/blob/main/checkout/views.py) (Checkout), [`payments/services.py`](https://github.com/tg11-org/storefront/blob/main/payments/services.py) (Payment Services), [`catalog/models.py`](https://github.com/tg11-org/storefront/blob/main/catalog/models.py) (Product Catalog), [`pricing/services.py`](https://github.com/tg11-org/storefront/blob/main/pricing/services.py) (Pricing Engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_catalog[("Product Catalog<br/>[models.py]")]
  node_cart[("Shopping Cart<br/>[models.py]")]
  node_checkout["Checkout<br/>[views.py]"]
end

subgraph group_commerce["Commerce Operations"]
  node_orders[("Order Records<br/>[models.py]")]
  node_order_services["Order Fulfillment<br/>[services.py]"]
  node_payments["Payment Services<br/>[services.py]"]
  node_payment_records[("Payment Records<br/>[models.py]")]
end

subgraph group_pricing["Pricing and Delivery"]
  node_pricing_engine["Pricing Engine<br/>[services.py]"]
  node_promotions[("Promotions and Coupons<br/>[models.py]")]
  node_tax["Tax Calculation<br/>[tax.py]"]
  node_shipping["Shipping Rates<br/>[services.py]"]
end

subgraph group_integrations["External Integrations"]
  node_stripe["Stripe"]
  node_connectors["Connector Services<br/>[services.py]"]
  node_connector_registry["Provider Registry<br/>[registry.py]"]
  node_etsy["Etsy Connector<br/>[etsy.py]"]
  node_popcustoms["PopCustoms Connector<br/>[popcustoms.py]"]
  node_shipping_providers["Shipping Providers"]
  node_shipping_webhooks["Shipping Webhooks<br/>[webhooks.py]"]
end

subgraph group_identity["Customer and Staff"]
  node_account[("Customer Accounts<br/>[models.py]")]
  node_staff["Store Dashboard"]
end

node_customer(("Shopper"))

node_customer -->|"browses"| node_catalog
node_customer -.->|"adds items"| node_cart
node_customer -.->|"submits checkout"| node_checkout
node_checkout -->|"reads"| node_cart
node_checkout -->|"reads"| node_catalog
node_checkout -->|"reads"| node_account
node_checkout -->|"calculates prices"| node_pricing_engine
node_checkout -->|"calculates tax"| node_tax
node_checkout -->|"creates orders"| node_orders
node_checkout -->|"starts payment"| node_payments
node_checkout -->|"reads channel data"| node_connectors
node_cart -->|"references products"| node_catalog
node_pricing_engine -->|"reads products"| node_catalog
node_pricing_engine -->|"reads orders"| node_orders
node_pricing_engine -.->|"uses promotions"| node_promotions
node_pricing_engine -.->|"requests rates"| node_shipping_providers
node_tax -->|"supports tax totals"| node_payments
node_payments -->|"creates sessions"| node_stripe
node_payments -->|"records payments"| node_payment_records
node_payments -->|"updates paid orders"| node_orders
node_payments -->|"clears checked-out cart"| node_cart
node_payments -->|"initiates fulfillment"| node_connectors
node_connectors -->|"updates sync state"| node_orders
node_connectors -->|"imports listings"| node_catalog
node_connectors -->|"gets connector"| node_connector_registry
node_connector_registry -->|"registers"| node_etsy
node_connector_registry -->|"registers"| node_popcustoms
node_orders -.->|"tracks fulfillment"| node_order_services
node_shipping_providers -.->|"sends events"| node_shipping_webhooks
node_staff -.->|"manages merchandising"| node_catalog

click node_catalog "https://github.com/tg11-org/storefront/blob/main/catalog/models.py"
click node_cart "https://github.com/tg11-org/storefront/blob/main/cart/models.py"
click node_checkout "https://github.com/tg11-org/storefront/blob/main/checkout/views.py"
click node_account "https://github.com/tg11-org/storefront/blob/main/accounts/models.py"
click node_staff "https://github.com/tg11-org/storefront/tree/main/dashboard"
click node_pricing_engine "https://github.com/tg11-org/storefront/blob/main/pricing/services.py"
click node_promotions "https://github.com/tg11-org/storefront/blob/main/pricing/models.py"
click node_tax "https://github.com/tg11-org/storefront/blob/main/pricing/tax.py"
click node_shipping "https://github.com/tg11-org/storefront/blob/main/pricing/services.py"
click node_orders "https://github.com/tg11-org/storefront/blob/main/orders/models.py"
click node_order_services "https://github.com/tg11-org/storefront/blob/main/orders/services.py"
click node_payments "https://github.com/tg11-org/storefront/blob/main/payments/services.py"
click node_payment_records "https://github.com/tg11-org/storefront/blob/main/payments/models.py"
click node_connectors "https://github.com/tg11-org/storefront/blob/main/connectors/services.py"
click node_connector_registry "https://github.com/tg11-org/storefront/blob/main/connectors/registry.py"
click node_etsy "https://github.com/tg11-org/storefront/blob/main/connectors/etsy.py"
click node_popcustoms "https://github.com/tg11-org/storefront/blob/main/connectors/popcustoms.py"
click node_shipping_webhooks "https://github.com/tg11-org/storefront/blob/main/pricing/webhooks.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_catalog,node_cart,node_checkout toneBlue
class node_orders,node_order_services,node_payments,node_payment_records toneAmber
class node_pricing_engine,node_promotions,node_tax,node_shipping toneMint
class node_stripe,node_connectors,node_connector_registry,node_etsy,node_popcustoms,node_shipping_providers,node_shipping_webhooks toneRose
class node_account,node_staff,node_customer toneIndigo
```

## Components

### Storefront

- [Product Catalog](https://github.com/tg11-org/storefront/blob/main/catalog/models.py): `catalog/models.py`
- [Shopping Cart](https://github.com/tg11-org/storefront/blob/main/cart/models.py): `cart/models.py`
- [Checkout](https://github.com/tg11-org/storefront/blob/main/checkout/views.py): `checkout/views.py`

### Commerce Operations

- [Order Records](https://github.com/tg11-org/storefront/blob/main/orders/models.py): `orders/models.py`
- [Order Fulfillment](https://github.com/tg11-org/storefront/blob/main/orders/services.py): `orders/services.py`
- [Payment Services](https://github.com/tg11-org/storefront/blob/main/payments/services.py): `payments/services.py`
- [Payment Records](https://github.com/tg11-org/storefront/blob/main/payments/models.py): `payments/models.py`

### Pricing and Delivery

- [Pricing Engine](https://github.com/tg11-org/storefront/blob/main/pricing/services.py): `pricing/services.py`
- [Promotions and Coupons](https://github.com/tg11-org/storefront/blob/main/pricing/models.py): `pricing/models.py`
- [Tax Calculation](https://github.com/tg11-org/storefront/blob/main/pricing/tax.py): `pricing/tax.py`
- [Shipping Rates](https://github.com/tg11-org/storefront/blob/main/pricing/services.py): `pricing/services.py`

### External Integrations

- **Stripe**
- [Connector Services](https://github.com/tg11-org/storefront/blob/main/connectors/services.py): `connectors/services.py`
- [Provider Registry](https://github.com/tg11-org/storefront/blob/main/connectors/registry.py): `connectors/registry.py`
- [Etsy Connector](https://github.com/tg11-org/storefront/blob/main/connectors/etsy.py): `connectors/etsy.py`
- [PopCustoms Connector](https://github.com/tg11-org/storefront/blob/main/connectors/popcustoms.py): `connectors/popcustoms.py`
- **Shipping Providers**
- [Shipping Webhooks](https://github.com/tg11-org/storefront/blob/main/pricing/webhooks.py): `pricing/webhooks.py`

### Customer and Staff

- [Customer Accounts](https://github.com/tg11-org/storefront/blob/main/accounts/models.py): `accounts/models.py`
- [Store Dashboard](https://github.com/tg11-org/storefront/tree/main/dashboard): `dashboard`

### Other components

- **Shopper**

## Connections

- Shopper → Product Catalog: browses
- Shopper → Shopping Cart: adds items
- Shopper → Checkout: submits checkout
- Checkout → Shopping Cart: reads (evidence: `checkout/views.py`)
- Checkout → Product Catalog: reads (evidence: `checkout/views.py`)
- Checkout → Customer Accounts: reads (evidence: `checkout/views.py`)
- Checkout → Pricing Engine: calculates prices (evidence: `checkout/views.py`)
- Checkout → Tax Calculation: calculates tax (evidence: `checkout/views.py`)
- Checkout → Order Records: creates orders (evidence: `checkout/views.py`)
- Checkout → Payment Services: starts payment (evidence: `checkout/views.py`)
- Checkout → Connector Services: reads channel data (evidence: `checkout/views.py`)
- Shopping Cart → Product Catalog: references products (evidence: `cart/models.py`)
- Pricing Engine → Product Catalog: reads products (evidence: `pricing/services.py`)
- Pricing Engine → Order Records: reads orders (evidence: `pricing/services.py`)
- Pricing Engine → Promotions and Coupons: uses promotions (evidence: `pricing/services.py`)
- Pricing Engine → Shipping Providers: requests rates
- Tax Calculation → Payment Services: supports tax totals (evidence: `pricing/tax.py`)
- Payment Services → Stripe: creates sessions (evidence: `payments/services.py`)
- Payment Services → Payment Records: records payments (evidence: `payments/services.py`)
- Payment Services → Order Records: updates paid orders (evidence: `payments/services.py`)
- Payment Services → Shopping Cart: clears checked-out cart (evidence: `payments/services.py`)
- Payment Services → Connector Services: initiates fulfillment (evidence: `payments/services.py`)
- Connector Services → Order Records: updates sync state (evidence: `connectors/services.py`)
- Connector Services → Product Catalog: imports listings (evidence: `connectors/services.py`)
- Connector Services → Provider Registry: gets connector (evidence: `connectors/services.py`)
- Provider Registry → Etsy Connector: registers (evidence: `connectors/registry.py`)
- Provider Registry → PopCustoms Connector: registers (evidence: `connectors/registry.py`)
- Order Records → Order Fulfillment: tracks fulfillment (evidence: `orders/services.py`)
- Shipping Providers → Shipping Webhooks: sends events
- Store Dashboard → Product Catalog: manages merchandising
