Skip to content

Layerkick Docs

Edge rendering platform for Shopify themes — zero-latency storefronts via Cloudflare Workers, Liquid-to-TypeScript transpilation, and surgical cache invalidation.

This is a living outline of planned documentation. Pages marked with a link are written; the rest are stubs to be filled in as we build.

How the system works under the hood.

Request Flow

End-to-end request lifecycle: DNS → Cloudflare edge → dispatch worker → theme worker → Shopify origin (fallback). How routing decisions are made.

Transpiler Pipeline

How Liquid templates become TypeScript render functions. IR stages, AST transformations, code generation, registry shim.

Cache Strategy

Per-section content-addressable caching. Cache key construction (settings hash + locale + market + deploy version). TTL strategy. Webhook-driven surgical invalidation.

Islands & Script Loading

Third-party app isolation, requestIdleCallback deferral, app block hydration. How scripts are categorized and loaded.

Data Pipeline

KV data model: products, collections, pages, blogs, menus. Storefront API queries, Admin API metafield enrichment. Fetch manifests.

Step-by-step instructions for common operations.

Client Onboarding

Setting up a new client: 4-char slug, Shopify custom app, D1/KV/R2 provisioning, .mise.local.toml, first build and seed.

Deployment

deploy:theme, deploy:dispatch, promotion pipeline, rollback, A/B testing. Manual steps when automation fails.

Local Development

pnpm dev, worktree conventions, port offsets, Miniflare state, cache clearing. Common gotchas.

Parity Workflow

pnpm parity:loop, section-by-section verification, Chrome extension visual diff, DOM comparison.

Adding a Liquid Filter or Tag

How to add support for a new Liquid construct: transpiler IR node, code generator, runtime helper, test fixture.

Webhook Invalidation

How product/collection/theme webhooks trigger surgical cache purges. Adding new webhook handlers.

Operational details. These pages contain sensitive configuration and are excluded from the public build.

Infrastructure Config

Cloudflare account IDs, API token locations, KV/D1/R2 namespace IDs, worker naming conventions. Per-client custom app credentials.

Client Runbooks

Per-client specifics: known template issues, coverage status, metafield manifests, contact details.

Incident Response

What to do when: worker goes down, cache is stale, Shopify changes an API, a deploy breaks production. Rollback procedures.

Manual Operations

Forced redeployment, manual webhook processing, D1 migrations, R2 cleanup, KV bulk operations.

Cost Tracking

Cloudflare usage per client, KV read/write volumes, Worker invocation counts, R2 storage.

As the platform scales, these will become important:

  • API Reference — Dashboard API endpoints, webhook payload schemas
  • Performance Benchmarking — Lighthouse CI, PSI comparisons, FCP/LCP/CLS tracking methodology
  • A/B Testing — Server-side experiments, dispatch worker routing, cart token correlation
  • Visual Regression — Playwright pipeline, pixel-parity validation
  • Contributor Guide — Git conventions, PR process, testing expectations, Claude Code workflows