Skip to content

Commit

Permalink
updating the readme + help
Browse files Browse the repository at this point in the history
  • Loading branch information
iamkevingreen committed Jun 28, 2023
1 parent f924407 commit 4125992
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
28 changes: 16 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Hydrogen template: Hello World
# Superhi - Modular Commerce

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.
This is a mono-repo-like experience, you will find the core of hydrogen running in the root directory, you will also find a `sanity` instance running inside of the `cms` directory powered by `next.js`.

### Hydrogen:

[Check out Hydrogen docs](https://shopify.dev/custom-storefronts/hydrogen)
[Get familiar with Remix](https://remix.run/docs/en/v1)
Expand All @@ -23,20 +25,22 @@ Hydrogen is Shopify’s stack for headless commerce. Hydrogen is designed to dov

- Node.js version 16.14.0 or higher

*Remember to update `.env` with your shop's domain and Storefront API token!

```bash
npm create @shopify/hydrogen@latest --template hello-world
yarn or npm install
```

Remember to update `.env` with your shop's domain and Storefront API token!
## CMS

## Building for production
This is tricker given the way the Sanity CLI is configured, the easiest method is to generate a new Sanity instance which you can do following this [guide](https://www.sanity.io/docs/installation) and I will explain in a lesson to make it easier.

```bash
npm run build
```
Once you init a new sanity instance, you can simply take the generate sanity ID and place it in a duplicated `.sample.env` file that you should save as `.env` and not commit to your repo! We will be deploying the cms to vercel and putting our environment variable there as well so the sanity instance is hosted.

## Local development

```bash
npm run dev
```
### FAQs

<details>
<summary>Why is Sanity in Next.js?</summary>
Sanity is a unique CMS platform that can be embedded anywhere, that means we don't have to host the studio on sanity itself. We can instead host it on any platform we want (in this case vercel). We do this because it gives our sanity extra powers out of the box, we can now utilize next.js as well as `api` routes for handling complex api interactions without our studio, we won't go into explicit details around everything you can do with the additional power of next.js but I want you to have the best tool set to do more with modular commerce. I'll be linking a tutorial to how I upload files directly to Shopify in my Sanity studio and it's only possible with next.js and vercel hosted solutions. We can also give our CMS a custom domain like cms.website.com that makes it easier for the client or you to access it on the web.
</details>
4 changes: 4 additions & 0 deletions cms/.sample.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SHOPIFY_ADMIN_TOKEN_SANITY_UPLOAD="33333_askdfjaskldfjklasdjflasjdf"
SHOPIFY_ADMIN_URL="https://website.myshopify.com/admin/api/2023-01"
NEXT_PUBLIC_SANITY_PROJECT_ID="333333"
NEXT_PUBLIC_SANITY_DATASET="production"

0 comments on commit 4125992

Please sign in to comment.