Hydrogen and Oxygen make up Shopify's recommended stack for headless commerce. The different parts of the system work together to make it faster and easier to build and deploy headless Shopify stores.
## Architecture
Three key parts of the Hydrogen stack work together to enable a unified developer experience:
Technology | What it does
---|---
**[Hydrogen](#hydrogen)**
(App) | A set of components, utilities, and design patterns that make it easier to work with Shopify APIs. Hydrogen projects are Remix apps that are preconfigured with Shopify-specific features and functionality. Hydrogen handles API client credentials, provides off-the-shelf components that are pre-wired for Shopify API data, and includes CLI tooling for local development, testing, and deployment.
**[Remix](#remix)**
(Framework) | The open-source React framework that Hydrogen is built on top of. Remix handles routing, data fetching, server-side rendering, UI reactivity, and styling.
**[Oxygen](#oxygen)**
(Hosting) | Shopifyβs global serverless hosting platform, built for deploying Hydrogen storefronts at the edge. Oxygen handles deployment environments, environment variable management, caching, and integration with Shopifyβs CDN.
Developing each layer of this tech stack together means provides an end-to-end developer experience that reduces boilerplate code, improves productivity, and promotes optimal performance, accessibility, and SEO practices.
## Hydrogen
### Project structure
Hydrogen projects are structured like typical [Remix](#remix) apps and you can configure them to your preferences. The following is the default [Quickstart](/docs/storefronts/headless/hydrogen/getting-started) project structure:
@shopify/hydrogen
| Main Hydrogen package. Contains Remix-specific components and utilities for interacting with Shopify APIs. Extends the framework-agnostic [`@shopify/hydrogen-react`](/docs/api/hydrogen-react) package.
@shopify/hydrogen-cli
| CLI tool for working with Hydrogen projects.
@shopify/mini-oxygen
| Local development server based on Oxygen.
@shopify/remix-oxygen
| [Remix adapter](https://remix.run/docs/en/main/pages/technical-explanation#http-handler-and-adapters) that enables Hydrogen to be served on [Oxygen](#oxygen).
### Hydrogen channel
The [Hydrogen sales channel app](https://apps.shopify.com/hydrogen) needs to be installed on your Shopify store to enable the following features:
- A Hydrogen sales channel where you can publish product inventory.
- [Oxygen](#oxygen) hosting, to deploy your Hydrogen projects.
- Managing [storefronts](/docs/storefronts/headless/hydrogen/storefronts) and deployment [environments](/docs/storefronts/headless/hydrogen/environments), including environment variable management.
- Access to deployment logs.
## Remix
Remix is the open-source React-based framework that Hydrogen is built on top of. Hydrogen projects are Remix apps with a set of preconfigured options, bundled with a collection of Shopify-optimized components and utilities. Hydrogen includes a custom Remix adapter that compiles your project for hosting on [Oxygen](#oxygen).
> Remix:
> Consider completing Remix's 30-minute [getting started tutorial](https://remix.run/docs/en/main/start/tutorial) for a solid foundation on the architecture and conventions of Remix apps.
### Key Remix concepts
Concept | Details
---|---
[Nested routes](https://remix.run/docs/en/main/discussion/routes) | Remix maps the nesting logic of app URLs to the nesting logic of components and data-loading. This allows all page data to load in parallel, reducing overall load times.
[Loaders](https://remix.run/docs/en/main/discussion/data-flow#route-loader) | Remix loaders are functions that load data so that it can be rendered server-side, which reduces the amount of JavaScript that's sent to the client. In Hydrogen, loaders fetch data from Shopify APIs and third-party sources.
[Actions](https://remix.run/docs/en/main/discussion/data-flow#route-action) | Remix actions are functions that accept web-standard form data from clients in order to update state, mutate data, or trigger side effects.
[SSR](https://remix.run/docs/en/main/discussion/server-vs-client) | Remix apps default to server-side rendering (SSR), where their React components are rendered as HTML before being sent to the browser.
[Progressive enhancement](https://remix.run/docs/en/main/discussion/progressive-enhancement) | Because Remix actions use web standard technology like HTML forms, they typically work without JavaScript, but can be enhanced with client-side JavaScript when it's available. This, along with an SSR-first approach, means Remix apps typically deliver smaller bundle sizes that load faster.
## Oxygen