$ account Shopify
IdentityCache is a Ruby gem that provides opt-in read-through caching for ActiveRecord models, using memcached as the backend store. It allows developers to declare cache indexes on model attributes and associations, and automatically handles cache invalidation via after_commit hooks. The library supports embedded and reference-based caching for associations, secondary indexes, attribute caching, and batch fetching. It includes advanced features like fill locks to mitigate thundering herd problems, memoization per request, and deferred expiration. The codebase is well-structured with clear separation of concerns, extensive test coverage, and production use at Shopify.
Shopify/shopify_app is a Ruby on Rails engine gem (v23.0.3, MIT) that provides the foundational integration layer for building Shopify Apps. It handles OAuth 2.0 authentication with both legacy and new embedded-API token exchange flows, session management (online/offline with access scopes), webhook registration and verification, script tag management, billing, and App Bridge support. The gem ships with dozens of Rails generators to scaffold models, controllers, jobs, views, and routes tailored to embedded and non-embedded app patterns. Architecture is a mounted engine with mixin-based controller concerns (e.g., LoginProtection, EnsureHasSession, WebhookVerification) and configurable session storage backends (default ActiveRecord via host app models, with in-memory stores for development). Key data flows: the app directs users through Shopify OAuth, stores session tokens (with automatic refresh for expiring tokens), then uses the Shopify API (via shopify_api gem) for authenticated calls. The codebase demonstrates disciplined Rails engine design, robust security practices (HMAC verification, CSP, CSRF protection, sanitized redirects), and strong test coverage with 300+ test files. Notable craftsmanship includes the session storage mixins (ShopSessionStorage, UserSessionStorage) that separate concerns via method injection, the access-scope verification strategies, and the full-page redirect pattern for embedded apps. Maintenance is activeβdespite some doc-coverage inconsistencies (e.g., deprecated modules still tested) and two coexisting auth strategies that add conditional complexity, the gem tracks modern Shopify API versions and Ruby/Rails requirements (>= 3.2 / >= 7.1). The large generator surface and i18n support (20 locales) show attention to developer experience.
This repository provides a collection of shared configurations and tools for web development at Shopify. It is structured as a monorepo containing multiple npm packages, including ESLint and Stylelint plugins with custom rules, Babel presets, TypeScript configurations, Prettier settings, and utilities for image optimization. The project enforces consistent coding standards across Shopify's web applications and is used in their build and development pipelines. The architecture is modular, with each package providing a specific tool or configuration that can be extended by consumers.