Skip to content

This monorepo serves as a starter template/example for building B2C e-commerce applications using Medusa, Nextjs and Sanity

License

Notifications You must be signed in to change notification settings

tinloof/medusa-dtc-starter-munchies

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Medusa B2C Starter

This monorepo serves as a starter template/example for building B2C e-commerce applications using Medusa for e-commerce functionality, Next.js for the frontend, and Sanity for content management.

Project Setup

To get started with this project, follow these steps:

  1. Clone the repository:
git clone --depth 1 https://github.com/tinloof/medusa-b2c-starter
  1. Install dependencies:

This project utilizes pnpm for package management and monorepo functionality. To install dependencies using pnpm, execute the following command:

pnpm install

Sanity Setup

To set up Sanity for your project:

  1. cd into the frontend directory:
cd frontend
  1. Run the sanity init command:
pnpx sanity init --env
  1. Make sure to append NEXT_PUBLIC_ where it makes sense in your .env file, you can refer to the .env.example file in the frontend directory.

  2. Set the NEXT_PUBLIC_SANITY_API_VERSION in .env to today's date in the format YYYY-MM-DD.

  3. Get the SANITY_API_TOKEN by navigating to the Sanity Manage Dashboard. Choose your project, access the API section, and generate a token with editor permissions.

Medusa Setup

To set up Medusa for your project:

Once project is deployed

  1. Create a Publishable api key in the dashboard settings and set it to NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY

  2. Add the URL of the Medusa project to NEXT_PUBLIC_MEDUSA_BACKEND_URL

Running the Project

After you go through the setup steps, you can run the project using the following command from the root directory:

pnpm dev

About

This monorepo serves as a starter template/example for building B2C e-commerce applications using Medusa, Nextjs and Sanity

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages