Home
Softono
b2c-marketplace-storefront

b2c-marketplace-storefront

Open source TypeScript
188
Stars
121
Forks
18
Issues
10
Watchers
3 weeks
Last Commit

About b2c-marketplace-storefront

![B2C Storefront Cover](https://cdn.prod.website-files.com/6790aeffc4b432ccaf1b56e5/67a21bd27b4ac8b812c1d84f_B2C%20Storefront%20Cover.png) <div align="center"> <h1> B2C Storefront <br> for <a href="https://github.com/mercurjs/mercur">Mercur</a> - Open Source Marketplace Platform </h1> <!-- Shields.io Badges --> <a href="https://github.com/mercurjs/mercur/tree/main?tab=MIT-1-ov-file"> <img alt="License" src="https://img.shields.io/badge/license-MIT-blue.svg" /> </a> <a href="#"> <img alt="PRs Welcome" src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" /> </a> <a href="https://mercurjs.com/contact"> <img alt="Support" src="https://img.shields.io/badge/support-contact%20author-blueviolet.svg" /> </a> <!-- Website Links --> <p> <a href="https://b2c.mercurjs.com/">🛍️ B2C Marketplace Storefront Demo </a> · <a href="https://mercurjs.com/">Mercur Website</a> · <a href="https://docs.mercurjs.com/">📃 Explore the docs</a> </p> </div> ## B2C Storefront for Market ...

Platforms

Web Self-hosted

Languages

TypeScript

B2C Storefront Cover

B2C Storefront
for Mercur - Open Source Marketplace Platform

License PRs Welcome Support

🛍️ B2C Marketplace Storefront Demo · Mercur Website · 📃 Explore the docs

B2C Storefront for Marketplace

Customizable storefront designed for B2C with all elements including browsing and buying products across multiple vendors at once.

Ready to go:

Part of Mercur

Mercur is an open source marketplace platform that allows you to create high-quality experiences for shoppers and vendors while having the most popular Open Source commerce platform MedusaJS as a foundation.

Mercur is a platform to start, customize, manage, and scale your marketplace for every business model with a modern technology stack.

Mercur

Quickstart

Installation

Clone the repository

git clone https://github.com/mercurjs/b2c-marketplace-storefront.git

 

Go to directory

cd b2c-marketplace-storefront

 

Install dependencies

yarn install

 

Make a .env.local file and copy the code below

# API URL
MEDUSA_BACKEND_URL=http://localhost:9000
# Your publishable key generated in mercur admin panel
NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY=
# Your public url
NEXT_PUBLIC_BASE_URL=http://localhost:3000
# Default region
NEXT_PUBLIC_DEFAULT_REGION=pl
# Stripe payment key. It can be random string, don't leave it empty.
NEXT_PUBLIC_STRIPE_KEY=supersecret
# Backend cookie secret
REVALIDATE_SECRET=supersecret
# Your site name in metadata
NEXT_PUBLIC_SITE_NAME="Fleek Marketplace"
# Your site description in metadata
NEXT_PUBLIC_SITE_DESCRIPTION="Fleek Markeplace"
# Algolia Application ID
NEXT_PUBLIC_ALGOLIA_ID=supersecret
# Algolia Search API Key
NEXT_PUBLIC_ALGOLIA_SEARCH_KEY=supersecret
#TalkJS APP ID
NEXT_PUBLIC_TALKJS_APP_ID=<your talkjs app id>

 

Start storefront

yarn dev

 

Guides

How to get Aloglia Keys

How to get TalkJs App ID

Configure Algolia index

To work Algolia correctly you need to configure facets and searchable attributes. You can use import function to upload algolia-config.json file  

In Algolia dashboard chose your index and select Import configuration from Manage index dropdown menu  

Algolia import

 

algolia-config.json

{
  "settings": {
    "minWordSizefor1Typo": 4,
    "minWordSizefor2Typos": 8,
    "hitsPerPage": 20,
    "maxValuesPerFacet": 100,
    "searchableAttributes": [
      "title",
      "subtitle",
      "brand.name",
      "tags.value",
      "type.value",
      "categories.name",
      "collection.title",
      "variants.title"
    ],
    "numericAttributesToIndex": null,
    "attributesToRetrieve": null,
    "unretrievableAttributes": null,
    "optionalWords": null,
    "attributesForFaceting": [
      "average_rating",
      "filterOnly(categories.id)",
      "categories.name",
      "seller.handle",
      "seller.store_status",
      "filterOnly(supported_countries)",
      "searchable(title)",
      "variants.color",
      "variants.condition",
      "variants.prices.currency_code",
      "variants.size"
    ],
    "attributesToSnippet": null,
    "attributesToHighlight": null,
    "paginationLimitedTo": 1000,
    "attributeForDistinct": null,
    "exactOnSingleWordQuery": "attribute",
    "ranking": [
      "typo",
      "geo",
      "words",
      "filters",
      "proximity",
      "attribute",
      "exact",
      "custom"
    ],
    "customRanking": null,
    "separatorsToIndex": "",
    "removeWordsIfNoResults": "none",
    "queryType": "prefixLast",
    "highlightPreTag": "<em>",
    "highlightPostTag": "</em>",
    "alternativesAsExact": ["ignorePlurals", "singleWordSynonym"],
    "renderingContent": {
      "facetOrdering": {
        "facets": {
          "order": ["variants.color", "variants.size", "variants.condition"]
        },
        "values": {
          "variants.color": {
            "sortRemainingBy": "count"
          },
          "variants.condition": {
            "sortRemainingBy": "count"
          },
          "variants.size": {
            "sortRemainingBy": "count"
          }
        }
      }
    }
  },
  "rules": [],
  "synonyms": []
}