medusa-b2b

Code for Medusa B2B tutorial

Stars
9

Medusa B2B Tutorial

This repository is the codebase of tutorial "How to Create B2B Store with Medusa".

Medusa Documentation | Medusa Website | Medusa Repository

Medusa Version

This tutorial uses Medusa v1.6.5. It is not guaranteed that it will work with future releases.

Prerequisites

Project Structure

This project includes three directories:

  1. b2b-admin: The Medusa admin dashboard.
  2. b2b-server: The Medusa server.
  3. b2b-storefront: The Medusa Next.js storefront.

How to Install

Using Medusa CLI Tool

If you're only interested in the Medusa server, you can install it using the Medusa CLI tool.

Check out the instructions in the B2B Server README

Using GitHub Cloning

  1. Clone this repository:
git clone --recurse-submodules https://github.com/shahednasser/medusa-b2b.git
cd medusa-b2b

2. Install the dependencies for each of the directories:

cd b2b-admin
npm install
cd ../b2b-server
npm install
cd ../b2b-storefront
npm install

3. Rename the template environment variables of Medusa server:

cd b2b-server
mv .env.template .env

And enter the necessary environment variables in the file.

4. Rename the template environment variables of Medusa storefront:

cd b2b-storefront
mv .env.template .env

And enter the necessary environment variables in the file.

5. Start Medusa Server:

cd b2b-server
npm start

You can then start the Medusa admin while the server is running with the following command:

cd b2b-admin
npm start

And you can then start the Medusa storefront while the server is running with the following command:

cd b2b-storefront
npm run dev

Other Resources