A lightweight, modern starter kit built with Astro + Svelte and powered by the Shopify Storefront API. Designed for speed, clarity, and full creative control โ ideal for developers building performant headless storefronts with minimal setup.
https://shopify-headless-demo.netlify.app
git clone https://github.com/LivexTwin/shopify-headless-demo
cd shopify-headless-demo
Set up environment variables
cp .env.example .env
.env
file must include:
PUBLIC_SHOPIFY_DOMAIN=your-store.myshopify.com
PUBLIC_SHOPIFY_TOKEN=your-storefront-api-token
Install Dependencies
npm install
npm run dev
shopify-headless-demo/
โโโ public/ # Static assets (favicons, SEO images, etc.)
โโโ src/
โ โโโ components/ # Svelte components (Cart, ProductCard, etc.)
โ โโโ layouts/ # Page layouts
โ โโโ pages/ # Astro pages and route definitions
โ โโโ styles/ # Global styles
โ โโโ utils/ # Currency, image formatting, helpers
โ โโโ lib/ # Shopify API client logic
โโโ .env.example # Template for environment variables
โโโ README.md
โโโ package.json
This starter is intentionally minimal โ no heavy UI libraries or styling decisions baked in. It's meant to be a foundation you can shape into a unique, performant eCommerce experience.
This project generates a fully static site by default, so no server adapter is included. Deploy easily on Netlify, Vercel, or any static hosting platform.
For advanced use cases (like server-side rendering, serverless functions, or on-demand rendering), you can add a platform-specific adapter such as @astrojs/netlify
or @astrojs/vercel
as needed.
Here's a minimal example of how to fetch product data using the built-in Shopify client and display product titles in an Astro page:
---
import { shopifyFetch } from '../lib/shopify.js';
import { GET_PRODUCTS } from '../lib/queries/products.ts';
const data = await shopifyFetch(GET_PRODUCTS);
const products = data.products;
---
<ul>
{products.map(product => (
<li>{product.title}</li>
))}
</ul>
This example shows how to use the reusable GraphQL query from lib/queries/products.ts
and the client in lib/shopify.ts
to fetch and render products on a page.
Built using Shopify Storefront API v2025-07
.
โ View official docs
This project is open-source under the MIT License.
Made with โค๏ธ by Anthony