Mercur uses Turborepo to manage the project.

Follow these steps to install and run Mercur on your operating system:

Step 1: Clone the Mercur repository:

git clone https://github.com/mercurjs/mercur.git

Step 2: Navigate to the Mercur directory and execute the following command:

cd mercur
yarn install

Step 3: Go to the backend directory and prepare .env file

cd apps/backend

cp .env.template .env

Step 4: Configure database credentials in the .env file

# Replace user, password, address and port parameters with your values
DATABASE_URL=postgres://[user]:[password]@[address]:[port]/$DB_NAME
# For example:
DATABASE_URL=postgres://postgres:postgres@localhost:5432/$DB_NAME

Do not delete $DB_NAME from the connection string. You’ll be prompted to choose database name during the next step.

Step 5: Setup database and run migrations

yarn medusa db:create && yarn medusa db:migrate && yarn seed

Step 6: Create admin user

npx medusa user --email <email> --password <password>

Step 7: Go to the root directory and run the following command to start Turborepo

cd ../..

yarn dev