Mercur is the first JavaScript open-source platform for building multi-vendor marketplaces. Built on top of Medusa.js, it simplifies the development of customized marketplaces.
After seeing the rising trend in multi-vendor business models and setting up several marketplaces from scratch at Rigby, we wanted to eliminate the repetitive setup of marketplaces.
The aim is to enable users to start a new marketplace in about five minutes, providing a strong starting point for anyone looking to build their own multi-vendor platform.
Medusa is an amazing and strong foundation for building marketplaces but requires a few modifications to adjust to this business model. We wanted a faster way to get these platforms up and running — Mercur is that accelerator for building multi-vendor marketplace with Medusa.js as a core.
We aim to make Mercur adaptable for various marketplace types, such as rental or service marketplaces.
We also want to build an ecosystem of plugins tailored to multi-vendor setups, including solutions for payment distributions like Stripe. We want to publish all plugins adapted to the multi-vendor market under the name medusa-mercur-...
e.g. medusa-mercur-stripe
. With this annotation, developers will always know that this is a plugin for the MVM.
Feel free to share your ideas on Medusa Discord, how you imagine the development of this project.
Create a new Mercur project with the command:
npx mercurjs marketplace
You will be asked to enter the project's name and select the project’s modules (admin / vendor / storefront) platform you wish to use. Once selected, the CLI will create project files in the directory matching your project name.
Initial Setup
/api
directory.yarn
command to install dependencies.yarn run build:admin && yarn run build:vendor
Environment Configuration
.env
file in the root of the project.DATABASE_URL
variable with your PostgreSQL database URL.Database and Server Initialization
yarn seed
yarn dev
The server will start on http://localhost:9000.
/api
folder.yarn dev
command to start API and admin panel in development mode/api
folder.yarn dev:vendor
command to start vendor panel in development modevendor_url/register
pageUsers
page in admin panel/vendor
folder in src
directory (See medusa admin quickstart)/store-front
folder.yarn
command to install dependencies..env
file in the root of the project folder with the following entries:NEXT_PUBLIC_MEDUSA_BACKEND_URL=http://localhost:9000
NEXT_PUBLIC_BASE_URL=http://localhost:8000
NEXT_PUBLIC_DEFAULT_REGION=eu
REVALIDATE_SECRET=supersecret
yarn dev
This will launch the storefront, typically available at http://localhost:8000.
To add a vendor user via the API, follow these steps:
api_url/vendor/users
with the body:{
"email": "vendoremail@email.com",
"password": "vendorpassword"
}
Replace api_url with your actual API endpoint URL, typically something like http://localhost:9000.
This will create a new vendor user in the system. Before the vendor can log in, the admin must authorize his registration in the administration panel by making his status active.
Mercur is a community-driven, open-source initiative. We are committed to keeping it free and accessible by releasing it under the MIT License.
Licensed under the MIT License.