This directory holds the code for the Create Returns from Storefront tutorial.
This codebase only includes the storefront and doesn't include the Medusa application. Refer to the documentation to learn how to install Medusa.
- Clone the repository and change to the
returns-storefrontdirectory:
git clone https://github.com/medusajs/examples.git
cd examples/returns-storefront2. Rename the .env.template file to .env and set the following variables:
NEXT_PUBLIC_MEDUSA_BACKEND_URL=
NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY=Where:
NEXT_PUBLIC_MEDUSA_BACKEND_URLis the URL to your Medusa application server.NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEYis the publishable key for your Medusa application. You can retrieve it form the Medusa Admin by going to Settings > Publishable API Keys.
3. Install dependencies:
yarn # or npm install4. While the Medusa application is running, start the Next.js server:
yarn dev # or npm run devThe storefront will run at http://localhost:8000.
This storefront is cloned from the Next.js Starter Storefront's repository. To make sure your storefront always has the necessary updates that the Medusa team pushes to the starter's repository, it's recommended that you add the repo as an upstream:
git remote add upstream https://github.com/medusajs/nextjs-starter-medusa.gitYou can then pull updates from the Next.js Starter Storefront's repository.