forked from mercurjs/mercur
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(adding medusajs api in apps dir) (mercurjs#1)
- Loading branch information
Showing
66 changed files
with
3,219 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
apps/ | ||
README.md |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
let ignore = [`**/dist`] | ||
|
||
// Jest needs to compile this code, but generally we don't want this copied | ||
// to output folders | ||
if (process.env.NODE_ENV !== `test`) { | ||
ignore.push(`**/__tests__`) | ||
} | ||
|
||
module.exports = { | ||
presets: [["babel-preset-medusa-package"], ["@babel/preset-typescript"]], | ||
ignore, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
JWT_SECRET=something | ||
COOKIE_SECRET=something | ||
|
||
DATABASE_TYPE="postgres" | ||
REDIS_URL=redis://localhost:6379 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
module.exports = { | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
project: 'tsconfig.json', | ||
sourceType: 'module', | ||
}, | ||
plugins: ['@typescript-eslint/eslint-plugin', 'prettier'], | ||
extends: ['plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'], | ||
root: true, | ||
env: { | ||
node: true, | ||
jest: true, | ||
}, | ||
ignorePatterns: [ | ||
'.eslintrc.js', | ||
'**/.prettier*', | ||
'**/.version*', | ||
'**/*.md', | ||
'**/*.json', | ||
'**/*.js', | ||
'**/*.js.map', | ||
'**/*.d.ts', | ||
'**/*.d.ts.map', | ||
], | ||
overrides: [ | ||
{ | ||
files: ['*'], | ||
rules: { | ||
'prefer-rest-params': 'off', | ||
}, | ||
}, | ||
], | ||
rules: { | ||
'prettier/prettier': 'error', | ||
'@typescript-eslint/ban-types': [ | ||
'error', | ||
{ | ||
types: { | ||
Function: false, | ||
}, | ||
extendDefaults: true, | ||
}, | ||
], | ||
'@typescript-eslint/no-var-requires': 'off', | ||
'@typescript-eslint/ban-ts-comment': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "npm" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
allow: | ||
- dependency-type: production | ||
groups: | ||
medusa: | ||
patterns: | ||
- "@medusajs*" | ||
- "medusa*" | ||
update-types: | ||
- "minor" | ||
- "patch" | ||
ignore: | ||
- dependency-name: "@medusajs*" | ||
update-types: ["version-update:semver-major"] | ||
- dependency-name: "medusa*" | ||
update-types: ["version-update:semver-major"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/dist | ||
.env | ||
.DS_Store | ||
/uploads | ||
/node_modules | ||
yarn-error.log | ||
|
||
.idea | ||
|
||
coverage | ||
|
||
!src/** | ||
|
||
./tsconfig.tsbuildinfo | ||
package-lock.json | ||
yarn.lock | ||
medusa-db.sql | ||
build | ||
.cache | ||
|
||
.yarn/* | ||
!.yarn/patches | ||
!.yarn/plugins | ||
!.yarn/releases | ||
!.yarn/sdks | ||
!.yarn/versions | ||
|
||
.vscode/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "es5", | ||
"useTabs": true, | ||
"printWidth": 120, | ||
"endOfLine": "auto", | ||
"arrowParens": "always", | ||
"bracketSpacing": true, | ||
"tabWidth": 4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Introduction | ||
|
||
This marketplace starter provides a foundational example to help you build and customize your own marketplace using Medusa.js. Begin your project with this starter template and tailor it to meet your specific needs. | ||
|
||
# User Management | ||
|
||
The user management is facilitated by two additional columns in the user table: `is_admin` and `store_id`. A marketplace admin is identified by the `is_admin` column set to TRUE, and `store_id` set to NULL, indicating an administrative role. Additionally, the `role` column in the user table can be utilized to implement Role-Based Access Control (RBAC) for marketplace and store users. | ||
|
||
# Store Setup | ||
|
||
Upon registering, a user's account is linked to a new Store entity. The store owner can then invite additional users to their store using Medusa's invite system, enabling team collaboration. | ||
|
||
# Shipping Options | ||
|
||
Stores have the ability to create and manage their own shipping options, which are then associated with their products. These shipping options are visible in the product responses to ensure clear communication of shipping terms. | ||
|
||
# Product Management | ||
|
||
When a product is created, the `store_id` of the currently logged-in user's store is associated with the product. This ensures that all products are correctly linked to their respective stores. | ||
|
||
# Order Processing | ||
|
||
Upon placing an order, the system automatically generates child orders for each vendor involved. This is achieved by iterating through each line item, checking the `store_id`, and grouping items from the same store into a single order. These child orders are then visible in the respective vendor's dashboard for processing. | ||
|
||
Feel free to extend and modify this starter as needed to suit your marketplace requirements. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
{ | ||
"store": { | ||
"currencies": [ | ||
"eur", | ||
"usd" | ||
] | ||
}, | ||
"users": [], | ||
"regions": [ | ||
{ | ||
"id": "test-region-eu", | ||
"name": "EU", | ||
"currency_code": "eur", | ||
"tax_rate": 0, | ||
"payment_providers": [ | ||
"manual" | ||
], | ||
"fulfillment_providers": [ | ||
"manual" | ||
], | ||
"countries": [ | ||
"gb", | ||
"de", | ||
"dk", | ||
"se", | ||
"fr", | ||
"es", | ||
"it" | ||
] | ||
}, | ||
{ | ||
"id": "test-region-na", | ||
"name": "NA", | ||
"currency_code": "usd", | ||
"tax_rate": 0, | ||
"payment_providers": [ | ||
"manual" | ||
], | ||
"fulfillment_providers": [ | ||
"manual" | ||
], | ||
"countries": [ | ||
"us", | ||
"ca" | ||
] | ||
} | ||
], | ||
"shipping_options": [ | ||
{ | ||
"name": "PostFake Standard", | ||
"region_id": "test-region-eu", | ||
"provider_id": "manual", | ||
"data": { | ||
"id": "manual-fulfillment" | ||
}, | ||
"price_type": "flat_rate", | ||
"amount": 1000 | ||
}, | ||
{ | ||
"name": "PostFake Express", | ||
"region_id": "test-region-eu", | ||
"provider_id": "manual", | ||
"data": { | ||
"id": "manual-fulfillment" | ||
}, | ||
"price_type": "flat_rate", | ||
"amount": 1500 | ||
}, | ||
{ | ||
"name": "PostFake Return", | ||
"region_id": "test-region-eu", | ||
"provider_id": "manual", | ||
"data": { | ||
"id": "manual-fulfillment" | ||
}, | ||
"price_type": "flat_rate", | ||
"is_return": true, | ||
"amount": 1000 | ||
}, | ||
{ | ||
"name": "I want to return it myself", | ||
"region_id": "test-region-eu", | ||
"provider_id": "manual", | ||
"data": { | ||
"id": "manual-fulfillment" | ||
}, | ||
"price_type": "flat_rate", | ||
"is_return": true, | ||
"amount": 0 | ||
}, | ||
{ | ||
"name": "FakeEx Standard", | ||
"region_id": "test-region-na", | ||
"provider_id": "manual", | ||
"data": { | ||
"id": "manual-fulfillment" | ||
}, | ||
"price_type": "flat_rate", | ||
"amount": 800 | ||
}, | ||
{ | ||
"name": "FakeEx Express", | ||
"region_id": "test-region-na", | ||
"provider_id": "manual", | ||
"data": { | ||
"id": "manual-fulfillment" | ||
}, | ||
"price_type": "flat_rate", | ||
"amount": 1200 | ||
}, | ||
{ | ||
"name": "FakeEx Return", | ||
"region_id": "test-region-na", | ||
"provider_id": "manual", | ||
"data": { | ||
"id": "manual-fulfillment" | ||
}, | ||
"price_type": "flat_rate", | ||
"is_return": true, | ||
"amount": 800 | ||
}, | ||
{ | ||
"name": "I want to return it myself", | ||
"region_id": "test-region-na", | ||
"provider_id": "manual", | ||
"data": { | ||
"id": "manual-fulfillment" | ||
}, | ||
"price_type": "flat_rate", | ||
"is_return": true, | ||
"amount": 0 | ||
} | ||
], | ||
"products": [], | ||
"categories": [], | ||
"publishable_api_keys": [ | ||
{ | ||
"title": "Development" | ||
} | ||
] | ||
} |
Oops, something went wrong.