Skip to content

Commit

Permalink
trying headless storefront - see CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
unclehowell committed Apr 15, 2024
1 parent 498b6d5 commit 565da7e
Show file tree
Hide file tree
Showing 90 changed files with 32,594 additions and 47 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

## [0.0.1-rtw.15] - Q2/2024
Apr-15 - Moved /static/11ty-store/ to /static/11ty-store.old and placed a shopify,hygraph website in a new 11ty-store directory
Apr-05 - Added /static/11ty-store/ - Testing Headless CMS Shopify solution
Apr-04 - Added a store
Apr-04 - See UPDATE.md in /static/library - It's about evidence submission for cases and deals
Expand Down
File renamed without changes.
36 changes: 36 additions & 0 deletions static/11ty-store.old/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Shopify Storefront reference with 11ty

A reference site for exploring the Shopify storefront API with Eleventy

Running at https://shopify-11ty.netlify.app/
Blogged at https://www.netlify.com/blog/



```
# install the dependencies
npm i
# Run the local dev server during development
netlify dev
# Build the site
npm run build
```

## Clone and deploy

Make a copy of this site and deploy it for free to Netlify by clicking this button:

[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/philhawksworth/shopify-11ty)


## Environment variables

This example site is preconfigured with the following environment variable (via the netlify.toml file) since these variables are safe to share. To customise this example to point at your own store in Shopify, you'll need to update these to your own values.

```conf
SHOPIFY_API_ENDPOINT = "{YOUR SHOPIFY STORE URL}/api/unstable/graphql.json"
SHOPIFY_STOREFRONT_API_TOKEN = "{YOUR SHOPIFY STOREFRONT ACCESS TOKEN}"
```

File renamed without changes.
30 changes: 30 additions & 0 deletions static/11ty-store.old/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "shopify-storefront-reference-with-eleventy",
"version": "0.1.0",
"description": "A reference site for exploring the Shopify storefront API with Eleventy ",
"repository": {
"type": "git",
"url": "https://github.com/philhawksworth/shopify-11ty"
},
"scripts": {
"build": "eleventy",
"serve": "eleventy --serve",
"start": "npm run dev",
"dev": "ntl dev"
},
"keywords": [
"eleventy",
"11ty",
"ssg",
"serverless",
"netlify"
],
"author": "Phil Hawksworth <[email protected]>",
"license": "ISC",
"dependencies": {
"@11ty/eleventy": "^0.12.1",
"dotenv": "^10.0.0",
"node-fetch": "^2.6.1",
"sass": "^1.29.0"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
452 changes: 452 additions & 0 deletions static/11ty-store/CHANGELOG.md

Large diffs are not rendered by default.

53 changes: 31 additions & 22 deletions static/11ty-store/README.md
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,36 +1,45 @@
# Shopify Storefront reference with 11ty
# Hydrogen template: Skeleton

A reference site for exploring the Shopify storefront API with Eleventy
Hydrogen is Shopify’s stack for headless commerce. Hydrogen is designed to dovetail with [Remix](https://remix.run/), Shopify’s full stack web framework. This template contains a **minimal setup** of components, queries and tooling to get started with Hydrogen.

Running at https://shopify-11ty.netlify.app/
Blogged at https://www.netlify.com/blog/
[Check out Hydrogen docs](https://shopify.dev/custom-storefronts/hydrogen)
[Get familiar with Remix](https://remix.run/docs/en/v1)

## What's included

- Remix
- Hydrogen
- Oxygen
- Vite
- Shopify CLI
- ESLint
- Prettier
- GraphQL generator
- TypeScript and JavaScript flavors
- Minimal setup of components and routes

```
# install the dependencies
npm i
# Run the local dev server during development
netlify dev
# Build the site
npm run build
```
## Getting started

## Clone and deploy
**Requirements:**

Make a copy of this site and deploy it for free to Netlify by clicking this button:
- Node.js version 18.0.0 or higher

[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/philhawksworth/shopify-11ty)
```bash
npm create @shopify/hydrogen@latest
```

## Building for production

## Environment variables
```bash
npm run build
```

This example site is preconfigured with the following environment variable (via the netlify.toml file) since these variables are safe to share. To customise this example to point at your own store in Shopify, you'll need to update these to your own values.
## Local development

```conf
SHOPIFY_API_ENDPOINT = "{YOUR SHOPIFY STORE URL}/api/unstable/graphql.json"
SHOPIFY_STOREFRONT_API_TOKEN = "{YOUR SHOPIFY STOREFRONT ACCESS TOKEN}"
```bash
npm run dev
```

## Setup for using Customer Account API (`/account` section)

Follow step 1 and 2 of <https://shopify.dev/docs/custom-storefronts/building-with-the-customer-account-api/hydrogen#step-1-set-up-a-public-domain-for-local-development>
28 changes: 28 additions & 0 deletions static/11ty-store/app/assets/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions static/11ty-store/app/components/Aside.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**
* A side bar component with Overlay that works without JavaScript.
* @example
* ```jsx
* <Aside id="search-aside" heading="SEARCH">
* <input type="search" />
* ...
* </Aside>
* ```
* @param {{
* children?: React.ReactNode;
* heading: React.ReactNode;
* id?: string;
* }}
*/
export function Aside({children, heading, id = 'aside'}) {
return (
<div aria-modal className="overlay" id={id} role="dialog">
<button
className="close-outside"
onClick={() => {
history.go(-1);
window.location.hash = '';
}}
/>
<aside>
<header>
<h3>{heading}</h3>
<CloseAside />
</header>
<main>{children}</main>
</aside>
</div>
);
}

function CloseAside() {
return (
/* eslint-disable-next-line jsx-a11y/anchor-is-valid */
<a className="close" href="#" onChange={() => history.go(-1)}>
&times;
</a>
);
}
Loading

0 comments on commit 565da7e

Please sign in to comment.