Skip to main content

Overview

The Weaverse Hydrogen theme follows a modern Shopify Hydrogen structure, optimized for performance and developer experience. Let’s explore the key components of your theme.

Core Structure

my-theme
app
.server
components
graphql
hooks
routes
sections
styles
types
utils
weaverse
entry.client.tsx
entry.server.tsx
routes.ts
root.tsx
public
server.ts
vite.config.ts
react-router.config.ts
.env

Key Directories

/app/components

Reusable UI components:

/app/sections

Theme sections for Weaverse Studio:

/app/weaverse

Core Weaverse configuration files:
  • components.ts - Component registry (the components array passed to WeaverseClient)
  • schema.server.ts - Theme schema
  • index.tsx - WeaverseContent renderer and page-data validation
  • style.tsx - Global styles generated from theme settings
  • csp.ts - Content Security Policy directives for Studio

Essential Files

app/.server/context.ts

Builds the per-request app context, including the Weaverse client. Hydrogen 2026.10 has no createHydrogenContext(), so the theme creates the session, Storefront client and customer account itself:

server.ts

The Oxygen worker entry. It builds the app context, lets Hydrogen answer the routes it owns (/api/cart, /account/login, …), renders the app with React Router, and looks up Shopify URL redirects on a 404 — the Weaverse client itself is created in app/.server/context.ts:
See Step 3 of the v6 migration guide for the full file.

entry.server.tsx

Server-side rendering setup with React Router v7. The CSP header and nonce come from the theme’s own app/utils/csp.ts (see Content Security Policy):

.env

Required environment variables:

Development Commands

Next Steps

Need help? Check our Community or FAQ.
Last modified on November 10, 2026