Skip to content

Deploy #88

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 60 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,61 @@
<h1 align="center">
Mercur
</h1>
![Mercur Main Cover](https://cdn.prod.website-files.com/6790aeffc4b432ccaf1b56e5/67a225dc6fa298afc1cc4ae6_Mercur%20Cover.png)
<div align="center">
<h1>Mercur <br> 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://rigbyjs.com/#contact">
<img alt="Support" src="https://img.shields.io/badge/support-contact%20author-blueviolet.svg" />
</a>
<!-- Website Links -->
<p>
<a href="https://mercurjs.com/">Mercur</a> | <a href="https://docs.mercurjs.com/">Docs</a>
</p>
</div>

# What is Mercur?

<a href="https://www.mercurjs.com/">Mercur</a> is the first truly limitless open source marketplace platform that combines the simplicity of SaaS with the freedom of open source. Built on [MedusaJS](https://github.com/medusajs/medusa) 2.0, it empowers businesses to create custom marketplaces without choosing between ownership and ease of use.

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

## Why Choose Mercur?

- Full Ownership: Unlike SaaS platforms, you own your marketplace with no transaction fees or vendor lock-in
- Modern Foundation: Built on MedusaJS, offering a modern tech stack that developers love
- Beautiful by Default: Create stunning storefronts without sacrificing customization

## Power Any Marketplace Model

- Custom B2B Marketplace: Build enterprise-grade platforms with specialized workflows
- Custom B2C Marketplace: Create engaging consumer marketplaces with modern UX
- eCommerce Extension: Transform your store into a marketplace (coming soon)

![Mercur Use Cases](https://cdn.prod.website-files.com/6790aeffc4b432ccaf1b56e5/67b46aa08180d5b8499c6a15_Use-cases.jpg)
&nbsp;

<h4 align="center">
<a href="https://docs.mercurjs.com">Documentation</a> |
<a href="https://www.mercurjs.com">Website</a>
</h4>
# Ready-to-go marketplace features

<p align="center">
Marketplace solution built on top of <a href="https://medusajs.com/" target="_blank">Medusa 2.0</a>
</p>
<b>Storefronts for Marketplace </b> <br>
Customizable storefronts designed for B2B and B2C with all elements including browsing and buying products across multiple vendors at once.

## Table
Discover <a href="https://github.com/mercurjs/b2c-marketplace-storefront">B2C Storefront Repository</a> - <a href="https://b2c.mercurjs.com/">🛍️ Check demo </a>

- [Prerequisites](#prerequisites)
- [Features](#features)
- [Quickstart](#quickstart)
- [Resources](#resources)
<b>Admin Panel</b> <br>
Control over whole marketplace: setting product categories, vendors, commissions and rules

## Prerequisites
<b>Vendor Panel</b> <br>
A powerful dashboard giving sellers complete control over their products, orders, and store management in one intuitive interface.

- Node.js v20+
- PostgreSQL
- Git CLI

&nbsp;
<b>Integrations</b> <br>
Built-in integration with Stripe for payments and Resend for communication needs. More integrations coming soon.

## Features
![Mercur](https://cdn.prod.website-files.com/6790aeffc4b432ccaf1b56e5/67a1020f202572832c954ead_6b96703adfe74613f85133f83a19b1f0_Fleek%20Tilt%20-%20Readme.png)

- **Product management**. Sellers can manage their products and variants.
- **Order management**. Sellers can manage their orders.
- **Stock location and inventory managment**. Sellers can create stock locations and manage their inventory.
- **Team management**. Sellers can invite and manage their team members.
- **Fulfillment management**. Sellers can manage their fulfillments, shipping options and delivery types.
- **Order spliting**. Orders are splitted into multiple orders by sellers in the cart.
- **OpenAPI support**. Mercur API endpoints are available via OpenAPI.
- **Payouts**. Automated payouts to sellers.
- **Stripe Connect Integration**. Integration with Stripe Connect for payment and payout processing.

&nbsp;

Expand Down Expand Up @@ -83,14 +102,20 @@ yarn dev

&nbsp;

## Prerequisites

- Node.js v20+
- PostgreSQL
- Git CLI

# Resources

#### Learn more about Mercur

- [Website](https://www.mercurjs.com/)
- [Docs](https://docs.mercurjs.com/introduction)
- [Mercur Website](https://www.mercurjs.com/)
- [Mercur Docs](https://docs.mercurjs.com/introduction)

#### Learn more about Medusa

- [Website](https://www.medusajs.com/)
- [Docs](https://docs.medusajs.com/v2)
- [Medusa Website](https://www.medusajs.com/)
- [Medusa Docs](https://docs.medusajs.com/v2)
5 changes: 4 additions & 1 deletion apps/backend/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ DATABASE_URL=postgres://[user]:[password]@[address]:[port]/$DB_NAME
DB_NAME=

STRIPE_SECRET_API_KEY=supersecret
STRIPE_CONNECTED_ACCOUNTS_WEBHOOK_SECRET=supersecret
STRIPE_CONNECTED_ACCOUNTS_WEBHOOK_SECRET=supersecret

RESEND_API_KEY=supersecret
RESEND_FROM_EMAIL=onboarding@resend.dev
31 changes: 20 additions & 11 deletions apps/backend/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
{
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"printWidth": 80,
"trailingComma": "none",
"importOrder": ["^@medusajs/(.*)$", "^@mercurjs/(.*)$", "^[./]"],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
"plugins": ["@trivago/prettier-plugin-sort-imports"],
"importOrderParserPlugins": ["typescript", "decorators-legacy"]
}
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"printWidth": 80,
"trailingComma": "none",
"importOrder": [
"^@medusajs/(.*)$",
"^@mercurjs/(.*)$",
"^[./]"
],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
"plugins": [
"@trivago/prettier-plugin-sort-imports"
],
"importOrderParserPlugins": [
"typescript",
"decorators-legacy"
]
}
19 changes: 19 additions & 0 deletions apps/backend/medusa-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@ module.exports = defineConfig({
{ resolve: './src/modules/configuration' },
{ resolve: './src/modules/order-return-request' },
{ resolve: './src/modules/requests' },
{ resolve: './src/modules/reviews' },
{ resolve: './src/modules/brand' },
{
resolve: './src/modules/taxcode',
options: {
apiKey: process.env.STRIPE_SECRET_API_KEY
}
},
{ resolve: './src/modules/commission' },
{
resolve: './src/modules/payout',
options: {
Expand Down Expand Up @@ -61,6 +64,22 @@ module.exports = defineConfig({
}
]
}
},
{
resolve: '@medusajs/medusa/notification',
options: {
providers: [
{
resolve: './src/modules/resend',
id: 'resend',
options: {
channels: ['email'],
api_key: process.env.RESEND_API_KEY,
from: process.env.RESEND_FROM_EMAIL
}
}
]
}
}
]
})
2 changes: 2 additions & 0 deletions apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@
"@medusajs/cli": "^2.1.0",
"@medusajs/framework": "latest",
"@medusajs/medusa": "latest",
"@mercurjs/http-client": "",
"@mikro-orm/core": "5.9.7",
"@mikro-orm/knex": "5.9.7",
"@mikro-orm/migrations": "5.9.7",
"@mikro-orm/postgresql": "5.9.7",
"awilix": "^8.0.1",
"pg": "^8.13.0",
"resend": "^4.1.2",
"stripe": "^17.4.0",
"@mercurjs/http-client": "*"
},
Expand Down
20 changes: 20 additions & 0 deletions apps/backend/src/admin/components/conditional-tooltip.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Tooltip } from "@medusajs/ui"
import { ComponentPropsWithoutRef, PropsWithChildren } from "react"

type ConditionalTooltipProps = PropsWithChildren<
ComponentPropsWithoutRef<typeof Tooltip> & {
showTooltip?: boolean
}
>

export const ConditionalTooltip = ({
children,
showTooltip = false,
...props
}: ConditionalTooltipProps) => {
if (showTooltip) {
return <Tooltip {...props}>{children}</Tooltip>
}

return children
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { createContext, useContext } from "react"

type DataTableFilterContextValue = {
removeFilter: (key: string) => void
removeAllFilters: () => void
}

export const DataTableFilterContext =
createContext<DataTableFilterContextValue | null>(null)

export const useDataTableFilterContext = () => {
const ctx = useContext(DataTableFilterContext)
if (!ctx) {
throw new Error(
"useDataTableFacetedFilterContext must be used within a DataTableFacetedFilter"
)
}
return ctx
}
Loading