Next.jsReactE-commerceStarter

react-query-shopify — Next.js Ecommerce Template

By jasonandrewth

A Next.js and React Query starter for a headless Shopify storefront that fetches product data via the Storefront GraphQL API and generates types with GraphQL Codegen.

Explore the design

Compare the page layouts and mobile experience. Open any screenshot for a closer look.

3 previews
Desktop homepage1 / 3
Desktop captureTop of page

Actual screenshot captured by the server browser.

All pages & views 3

Screenshots show visual appearance; interactive behavior may differ.

Recorded 2026-10-02View source

What stands out

A quick read of the recorded project description.

01

A headless Shopify storefront frontend built with Next.js, React, and TypeScript

02

Manages data requests to the Shopify Storefront GraphQL API via React Query

03

Provides a GraphQL Codegen type generation script outputting to src/generated/graphql.ts

04

Uses Tailwind for page styling

05

The repository uses the MIT license, allowing free use, modification, commercial use, and distribution

Template Details

This is a frontend starter template for headless Shopify e-commerce scenarios, built with TypeScript, Next.js, React, and React Query. Data comes from the Shopify Storefront GraphQL API, and the styling layer uses Tailwind. The repository provides a way to start the development server (npm run dev or yarn dev), with preview by default on local port 3000.

The template includes a GraphQL type generation workflow: running npm run graphql:codegen or yarn graphql:codegen will generate types based on the codegen.yml configuration, combining React Query and GraphQL Codegen, with output at src/generated/graphql.ts. The README notes that the generated output is based on the older react-query and requires manually changing imports to @tanstack/react-query to work properly.

Connecting to a real store requires configuring two variables in a .env file at the project root: NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN and NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN. The repository uses the MIT license, allowing free use, modification, commercial use, and distribution of this version of the code, but third-party assets such as demo images, fonts, and icons, as well as external services like domains and hosting, require separate verification of licensing and costs.

Next.jsReactE-commerceStarter

Is it right for your project?

Use Cases

  • Building a custom headless frontend interface for a Shopify store
  • Learning how Next.js and React Query work with a GraphQL API for data fetching
  • Practicing a GraphQL Codegen workflow for generating TypeScript types in a project
  • Using as starter code for secondary development of e-commerce Next.js projects

Suitable For

  • Developers familiar with React and Next.js who want to build their own Shopify storefront
  • Frontend projects that need to use the Shopify Storefront GraphQL API
  • Teams or individuals looking to introduce GraphQL Codegen and React Query

Getting started & customization

Use these recorded setup notes alongside the repository instructions for your chosen version.

  1. 1

    Run npm run dev or yarn dev to start the development server, accessible by default at http://localhost:3000

  2. 2

    Create a .env file at the project root and configure NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN and NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN

  3. 3

    Run npm run graphql:codegen or yarn graphql:codegen to generate types, with output at src/generated/graphql.ts

  4. 4

    The generated types reference the older react-query by default; manually change imports to @tanstack/react-query

  5. 5

    Third-party assets such as demo images, fonts, and icons require separate verification under their respective licenses

Read repository instructions

License & source material

Usage conditions & limitations

Free to use · keep license notice

This entry covers the free version under the MIT license in the public repository; the free scope is the code of this version and does not mean external services or third-party assets are free.

Must comply with when using

  • Free use, modification, commercial use, and distribution of this version of the code are permitted.
  • When distributing copies or substantial portions of the code, retain the original author's copyright notice and the full MIT license notice.
  • The code is provided as is; warranties and limitations of liability are governed by the original license and applicable law.

Additional costs & items to verify

  • Using this template requires registering your own Shopify store and obtaining a Storefront API access token, then configuring NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN and NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN in .env before real product data can be fetched; a Shopify account and API calls may incur platform fees.
  • The types generated by GraphQL Codegen reference the older react-query by default and require manually changing imports to @tanstack/react-query to work properly, which is a code adjustment that must be completed before use.
  • Demo images, fonts, icons, and other third-party assets require verification under their respective licenses and cannot be judged solely by the code's MIT license.
  • External services such as domains, hosting, databases, payments, or AI may incur separate charges.
View Original Text Basis

Permission is hereby granted, free of charge

Original License Text

NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN=yourshopifytoken

Original README

To make it work simply update the import to `from "@tanstack/react-query"`

Original README
https://github.com/jasonandrewth/react-query-shopify/blob/main/LICENCE.txthttps://github.com/jasonandrewth/react-query-shopify/blob/main/README.md

Compiled by DeepSeek based on repository license and README ·2026-10-02. Results only cover the materials read; dependencies, images, fonts, and subsequent term changes are subject to their respective original texts.

Project checks & description sources

Template Information

Source platforms
GitHub
Documentation and maintenance reference score
Partly documented · 73 / 100
Technologies
Next.js · React
Website type
E-commerce · Starter
How this score is calculated

Our heuristic uses license records (up to 30), a demo link (12), a preview (10), stars (15), recorded maintenance (15), description completeness (8), feature records (5) and classification data (5). It is not a code, security or performance test, or a Google score. A link does not establish tested functionality.

What to verify for this project

Repository update recorded
2022-11-29
Screenshot last checked
2026-10-02

A demo link is listed. Check it with your own content and viewport sizes; its presence does not confirm that forms, authentication or payments work.

The catalog identifies Next.js as the primary stack. Check the actual dependency manifest and lockfile for versions and hosting requirements. These notes use recorded metadata, not a code audit or a deployment test.

Use a selection guide →

How this description was prepared

AI-assisted description based on catalog records and repository material. Repository authors are not automatically the reviewers of this description.

Automatically checked against source and license rules; no manual editorial review.

Inspect the recorded source material

SHA-256: b0a61930c4ba2949bd199a0ead84ed87752f7e94b2e4158fae13e315fcc9889a

2026-10-02T07:42:23.750Z

Source file / repository
# 🛍 Next Shopify Storefront

A **headless shopify storefront** built with [TypeScript](https://www.typescriptlang.org/), [Next.js](https://nextjs.org/), [React.js](https://reactjs.org/), [React Query](https://react-query.tanstack.com/), [Shopify Storefront GraphQL API](https://shopify.dev/api/storefront) and [Tailwind](https://tailwindcss.com/).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.

## Type generation

```bash
npm run graphql:codegen
# or
yarn graphql:codegen
```

This will generate types with react-query and GraphQL Codegen as specified in the `codegen.yml`
Check out this [blog post](https://nhost.io/blog/how-to-use-graphql-code-generator-with-react-query) for an intro to this stack. Curently when types are generated they are stored in src/generated/graphql.ts but with the old version of reaxt-query. To make it work simply update the import to `from "@tanstack/react-query"`

```
//.env file in project root
NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN=yourshopifytoken
NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN=yourshop.myshopify.com
```

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
Report a correction

Explore similar templates

Compare previews and descriptions within the same stack and category.