Welcome to the Remix Store built with Shopify, React Router, and Hydrogen!
This is the codebase behind shop.remix.run. Run it locally to explore how to build a production headless Shopify store with modern web technologies.
npm installCopy the example environment file to create your local environment:
cp .env.example .envnpm run devYou'll have a local version of the Remix Store running with real product data, inventory, and checkout functionality.
npm run buildIf you've never setup the Hydrogen CLI, run the following command
npx shopify hydrogen shortcutIf you have access to the Shopify store, go ahead and link via hydrogen
h2 linkh2 pullEventually these docs might make it somewhere else, but just trying to capture some quirks about how Shopify Admin feeds into this project.
The hero component uses data from the Hero metaobject with 3 fields:
- Masthead
- Asset Images (frames for animation)
- Product link
See hero.server.ts for the GraphQL query.
Uses "Lookbook Entry" metaobjects with:
- Image
- Product (optional)
See lookbook.server.ts for implementation.
Products use custom metafields under "Product metafields":
- Description
- Technical Description
The store-wide sales require 2 things in Shopify Admin:
-
A metaobject with the following fields:
- Title
- Description
- End date
-
An automatic discount
The data is fetched in header.server.ts and accessed via useCartDiscounts defined in cart.
Note: there is a 1 hour cache on the header data, so updates will not be live without a redeploy.
We use metafields instead of the default description to access rich text data via GraphQL.
This is the production codebase for shop.remix.run. We welcome feedback and bug reports via GitHub issues.
See an issue you'd like to fix? Please open a PR!
MIT License - see LICENSE.md for details.
Built with ❤️ by the Remix team