This project demonstrates how to integrate a Shopify store into a Next.js application using the Shopify Storefront API.
Follow these steps to set up the project on your local machine.
- Node.js installed
- Shopify store with API credentials (see Shopify Setup)
-
Clone this repository:
git clone https://github.com/tfmukles/shopify-ecomerce.git
-
Navigate to the project directory:
cd shopify-ecomerce
-
Install dependencies:
npm install
-
Create an .env.local file in the root directory and add the following environment variables
SHOPIFY_STORE_DOMAIN=YOUR_SHOPFY_STORE_DOMAIN SHOPIFY_STOREFRONT_ACCESS_TOKEN=YOUR_STORE_STOREFRONT_ACCESS_TOKEN
-
Create a Shopify store if you don't have one: Shopify Website
-
Create a Shopify app in your store admin (Apps and sales channels > Develop apps > Create app) and obtain the Storefront API access token.
-
Replace the placeholders in your .env.local file with your Shopify store details.
Start the Next.js development server:
npm run dev