Skip to main content
Headless4 min read

A Liquid Developer’s Path to a Headless Hydrogen Storefront

Portfolio build: SŌL moves an editorial, material-heavy catalog onto Shopify Hydrogen with server-rendered Storefront API data, a single Hydrogen cart, and a runtime-agnostic Web fetch entry point.

Driss OUDMINE
Driss OUDMINE
Shopify Theme & App Developer · hello@doudmine.com
A Liquid Developer’s Path to a Headless Hydrogen Storefront
Project preview — A Liquid Developer’s Path to a Headless Hydrogen Storefront
Project Links
Executive Summary & Key Architectural Rules
  • Catalog products: 24 (from Admin GraphQL import)
  • SSR routes: 10 (from Loader-driven pages)
  • Cart state stores: 1 (from Hydrogen cart store only)
  • Hydration cart fetches: 0 (from Cart seeded in SSR HTML)
  • 24 catalog products and 6 collections imported into a Shopify development store.
  • Material Explorer facets are derived from the Shopify catalog, plus a three-product comparison view.
  • Search, inspiration and project editorial routes rendered by SSR loaders.
  • Reduced-motion-aware GSAP and Framer Motion transitions with keyboard-accessible controls.
  • Per-request Storefront client with buyerIp handling and private-token isolation on the server.
  • Root middleware runs Shopify cart endpoints and the SFAPI proxy before routing; redirects run after a 404.

Portfolio build: SŌL moves an editorial, material-heavy catalog onto Shopify Hydrogen with server-rendered Storefront API data, a single Hydrogen cart, and a runtime-agnostic Web fetch entry point.

Good architecture is what lets a storefront stay fast and editable as the catalog and the team behind it grow.

The challenge. The original SŌL concept was a static prototype with local catalog fixtures. A materials catalog needs variant-specific technical data, coverage-based quantity calculations, and trustworthy cart/checkout behaviour — none of which a static site can own. The build also had to stay deployable to a non-Node runtime.

The solution. Migrated the prototype to Shopify Hydrogen 2026-10 with React Router framework mode. All catalog reads go through a single server-only CatalogAdapter using validated gql() documents; the root loader seeds the real Hydrogen cart into the SSR document; cart mutations post to Hydrogen’s /api/cart handler with optimistic reconciliation. Host-specific code is isolated in deployment/plugins.ts so the Web fetch server can run on MiniOxygen or Cloudflare Workers.

Measured results. Catalog products reached 24 from Admin GraphQL import; SSR routes reached 10 from Loader-driven pages; Cart state stores reached 1 from Hydrogen cart store only; Hydration cart fetches reached 0 from Cart seeded in SSR HTML.

Scope of work. Static prototype to Hydrogen migration; Shopify catalog import: products, variants, collections, metafields; Server-rendered variant and option-state handling; Hydrogen cart, checkout handoff and Workers deployment.

Architecture notes. Per-request Storefront client with buyerIp handling and private-token isolation on the server. Root middleware runs Shopify cart endpoints and the SFAPI proxy before routing; redirects run after a 404. Cart session lives in a Shopify HttpOnly cookie; no localStorage cart and no parallel client cart context. Area + waste allowance resolves to whole boxes and posts the selected Shopify variant merchandiseId as cart quantity. Variant selection is mirrored into URL search parameters so refreshes and shared links resolve the same variant.

Highlights. 24 catalog products and 6 collections imported into a Shopify development store.; Material Explorer facets are derived from the Shopify catalog, plus a three-product comparison view.; Search, inspiration and project editorial routes rendered by SSR loaders.; Reduced-motion-aware GSAP and Framer Motion transitions with keyboard-accessible controls..

The square-metre calculator lives outside Shopify: coverage per box comes from product data (metafields in the live store) and price comes from the selected variant’s MoneyV2 value. The result becomes the cart quantity, while cart totals always come from Shopify — never from client-side price math.

Deployment note. Shopify development store · mock.shop fallback · Cloudflare Workers

Project note. "Project note: SŌL was built to prove that a Liquid-first developer can deliver a headless Hydrogen storefront with the same cart reliability and merchandising control as a classic theme — while keeping deployment runtime-independent." — Driss OUDMINE, Portfolio build notes · headless commerce.

Built by Driss OUDMINE — Shopify Theme & App Developer.

Production-Ready Implementation

Source-level excerpts from the build.

Zero External Dependencies
app/lib/calculator.ts
// Shared quantity logic: all values come from product data, nothing hardcoded.
export function calculateQuantity(input: QuantityInput): QuantityResult {
  const { area, wastePercent, coveragePerBox, boxPrice } = input;
  const wasteArea = area * (wastePercent / 100);
  const totalArea = area + wasteArea;
  // Shopify variant quantities must be integers: round up to whole boxes.
  const boxes = Math.ceil(totalArea / coveragePerBox);
  const coverageProvided = boxes * coveragePerBox;
  const totalAmount = Math.round(boxes * boxPrice.amount * 100) / 100;
  return {
    boxes,
    totalPrice: { amount: totalAmount, currencyCode: boxPrice.currencyCode },
    coverageProvided,
    surplusArea: Math.round((coverageProvided - totalArea) * 100) / 100,
    valid: area > 0,
  };
}

Pre-Deployment Safety Checklist for Shopify Merchants

1.Always duplicate your live theme to create a staging preview before editing Liquid snippets.
2.Test all checkout progression hooks with test credit card credentials in sandbox mode.
3.Audit your Core Web Vitals on Google PageSpeed Insights after deploying to verify 0 layout shifts.
Driss OUDMINE
Written by

Driss OUDMINE

Shopify Theme & App Developer specializing in Online Store 2.0 themes, custom Shopify apps, Shopify APIs (GraphQL/REST), and store speed optimization. Not available for new opportunities at this moment.

hello@doudmine.com
Previous Article
Mastering Shopify Responsive Picture Tags: WebP, AVIF & Native Lazy Loading
Next Article
One Provider Switch, Two Commerce Backends: The VÉLTR Hydrogen Build
Get in Touch · Full-Time Roles

Let's discuss how I can contribute to your team.

I am not available for new opportunities at this moment. You can still reach out for general questions about my work and articles.

Direct Email

hello@doudmine.com
One-click clipboard copy:

Candidate Snapshot:

Fast Response (Within 24 Hours)

I personally monitor my inbox and respond to technical recruiters and engineering managers promptly.

Work Authorization & Setup

Ready for remote full-time employment via Deel, Oyster, Remote.com, or direct employment.

Flexible Notice Period

Able to join team sprints within 1–2 weeks upon agreement.