Skip to main content

PLP 2.0 Architecture

System overview and data flowโ€‹

The new PLP 2.0 implements a hybrid data architecture combining multiple data sources through a multi-phase loading strategy. This is an API driven approach integrating with Search Spring, Shopify and Builder.io.

Data Flow Diagramโ€‹

Loading Phasesโ€‹

PhasePurposeData SourceKey Files
1Critical metadata + initial productsShopify + Search Springcollection.ts, loader.helper.server.ts
2CMS-managed contentBuilder.ioloader.helper.server.ts
3Session restorationCookie + Search Springsession.server.ts
4Product enrichmentShopify Storefront APIcollection.ts

Integration points with Shopifyโ€‹

Shopify Storefront API (GraphQL)โ€‹

Used for authoritative product and collection data:

QueryPurposeFile
SEARCH_SPRING_COLLECTION_QUERYCollection metadata, metafields, SEOCollectionQuery.ts
GET_PLP_PRODUCT_DATA_BY_HANDLEProduct pricing, images, variantsProductQuery.ts
GET_COLOR_BUBBLE_META_BY_HANDLEColor swatch thumbnailsProductQuery.ts
COLLECTION_QUERY_BY_IDRec tray collection productsCollectionQuery.ts

Key Metafields Retrieved:

  • enable_rollup - Whether to group products by style/fabric/type
  • enable_color_bar - Show color bar
  • enable_rts - 'Ready To Ship' toggle
  • visual_navigation - Builder content ID
  • rec_tray - Recommendation tray Builder ID
  • sub_navigation - Subcollection tabs
  • alternate_title / enable_shop_all - Title display options

Search Spring API (REST)โ€‹

Primary source for product search, filtering, and sorting. Routes through internal API endpoint:

const url = `${origin}${APIRoutes.COLLECTION_PAGE}${handle}?${params.toString()}`;

Returns:

  • results - Array of SanitizedSearchProductResult with basic product info
  • facets - Available filters (color, size, type, etc.)
  • sorting - Available sort options
  • pagination - Page info (currentPage, nextPage, totalPages)
  • merchandising - Inline banner configurations
  • filterSummary - Currently active filters

Builder.io CMSโ€‹

Content management for merchandising elements:

ModelPurpose
plp-visual-navigationVisual nav tiles at top of PLP
rec-trayRecommended products carousel

Key technical constraints and issuesโ€‹

Technical Constraintsโ€‹

  1. Feature Flag Gate - Needed to build this behind a feature gate to allow for production testing while maintaining current experience for customers.
  2. Rollup Collection Complexity - Products grouped by style-fabric-type key, requires pre-fetching rollup map. Requires creating and maintaining our own pagination.
  3. Deferred Data Pattern - Product enrichment uses promises that resolve during render with React Suspense. There is an active ticket to SSR this with Search Spring data and hydrate with Shopify data.
  4. Multiple Data Sources - Needed to pull in data from multiple sources to satisfy requirements from all stakeholders. This adds complexity and multiple points of failure to capture.

Known issues and technical debtโ€‹

IssueLocationDescription
No Search Spring fallbackloader.helper.server.ts:31No fallback to Storefront API if Search Spring fails. There is a ticket in the current sprint to resolve data with Shopify if Search Spring does not respond.
Sequential page fetchingRoute lines 147-156Session restoration fetches pages sequentially, not in parallel
Rollup Map CachingAPINeed to move the rollup map creation and caching to our CDN. There is currently a ticket in this sprint for this