Skip to content

Commit

Permalink
Merge branch 'develop' into feat/admin-ext-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperkristensen authored Jan 8, 2025
2 parents d996087 + a0e944a commit d11079e
Show file tree
Hide file tree
Showing 15 changed files with 547 additions and 75 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ In your customization, you can emit an event, then listen to it in a subscriber

There are two types of events in Medusa:

1. Worflow event: an event that's emitted in a workflow after a commerce feature is performed. For example, Medusa emits the `order.placed` event after a cart is completed.
1. Workflow event: an event that's emitted in a workflow after a commerce feature is performed. For example, Medusa emits the `order.placed` event after a cart is completed.
2. Service event: an event that's emitted to track, trace, or debug processes under the hood. For example, you can emit an event with an audit trail.

### Which Event Type to Use?
Expand Down
6 changes: 5 additions & 1 deletion www/apps/book/app/learn/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Medusa ships with three main tools:

When you install Medusa, you get a fully fledged commerce platform with all the features you need to get off the ground. However, unlike other platforms, Medusa is built with customization in mind. You don't need to build hacky workarounds that are difficult to maintain and scale. Your efforts go into building features that brings your business's vision to life.

---
---

## Who should use Medusa

Expand Down Expand Up @@ -84,6 +84,10 @@ This documentation is split into the following sections:

To get started, check out the [Installation chapter](./installation/page.mdx).

### Using with LLM Editors

This documentation provides an [llms.txt](https://docs.medusajs.com/llms.txt) file to support LLM editors such as Cursor. Add the documentation to the list of supported documentation in your LLM editor to access the documentation directly from your editor and benefit from code generation.

---

## Useful Links
Expand Down
2 changes: 1 addition & 1 deletion www/apps/book/generated/edit-dates.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export const generatedEditDates = {
"app/learn/fundamentals/scheduled-jobs/page.mdx": "2024-12-09T10:51:40.570Z",
"app/learn/fundamentals/workflows/page.mdx": "2024-12-09T14:45:17.837Z",
"app/learn/deployment/page.mdx": "2024-11-25T14:32:44.949Z",
"app/learn/page.mdx": "2024-11-28T14:17:53.023Z",
"app/learn/page.mdx": "2025-01-08T10:49:58.879Z",
"app/learn/fundamentals/modules/commerce-modules/page.mdx": "2024-12-09T10:46:29.339Z",
"app/learn/fundamentals/workflows/retry-failed-steps/page.mdx": "2024-12-04T07:37:59.823Z",
"app/learn/fundamentals/workflows/workflow-hooks/page.mdx": "2024-12-09T10:44:33.781Z",
Expand Down
283 changes: 283 additions & 0 deletions www/apps/book/public/llms.txt

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions www/apps/book/sidebar.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ export const sidebar = numberSidebarItems(
},
{
type: "link",
path: "/learn/fundamentals/module-links/remote-link",
title: "Remote Link",
path: "/learn/fundamentals/module-links/link",
title: "Link",
},
{
type: "link",
Expand Down
23 changes: 21 additions & 2 deletions www/apps/resources/app/architectural-modules/cache/page.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChildDocs } from "docs-ui"
import { CardList } from "docs-ui"

export const metadata = {
title: `Cache Modules`,
Expand All @@ -18,7 +18,26 @@ By default, Medusa uses the In-Memory Cache Module. This module uses a plain Jav

This is useful for development. However, for production, it's highly recommended to use other Cache Modules, such as the Redis Cache Module.

<ChildDocs type="item" hideItems={["Guides"]} onlyTopLevel={true} />
<CardList
items={[
{
title: "In-Memory",
href: "/architectural-modules/cache/in-memory",
badge: {
variant: "neutral",
children: "For Development"
}
},
{
title: "Redis",
href: "/architectural-modules/cache/redis",
badge: {
variant: "green",
children: "For Production"
}
}
]}
/>

---

Expand Down
23 changes: 21 additions & 2 deletions www/apps/resources/app/architectural-modules/event/page.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChildDocs } from "docs-ui"
import { CardList } from "docs-ui"

export const metadata = {
title: `Event Modules`,
Expand All @@ -18,7 +18,26 @@ By default, Medusa uses the Local Event Module. This module uses Node’s EventE

This is useful for development. However, for production, it’s highly recommended to use other Event Modules, Redis Event Module.

<ChildDocs type="item" hideItems={["Guides"]} onlyTopLevel={true} />
<CardList
items={[
{
title: "Local",
href: "/architectural-modules/event/local",
badge: {
variant: "neutral",
children: "For Development"
}
},
{
title: "Redis",
href: "/architectural-modules/event/redis",
badge: {
variant: "green",
children: "For Production"
}
}
]}
/>

---

Expand Down
23 changes: 21 additions & 2 deletions www/apps/resources/app/architectural-modules/file/page.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChildDocs } from "docs-ui"
import { CardList } from "docs-ui"

export const metadata = {
title: `File Module Providers`,
Expand All @@ -14,7 +14,26 @@ By default, Medusa uses the Local File Module. This module uploads files to the

This is useful for development. However, for production, it’s highly recommended to use other File Modules, such as the S3 Module.

<ChildDocs type="item" hideItems={["Guides"]} onlyTopLevel={true} />
<CardList
items={[
{
title: "Local",
href: "/architectural-modules/file/local",
badge: {
variant: "neutral",
children: "For Development"
}
},
{
title: "AWS S3 (and Compatible APIs)",
href: "/architectural-modules/file/s3",
badge: {
variant: "green",
children: "For Production"
}
}
]}
/>

---

Expand Down
28 changes: 28 additions & 0 deletions www/apps/resources/app/architectural-modules/file/s3/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,30 @@ The S3 File Module Provider integrates Amazon S3 and services following a compat
4. Click ALL for "Allowed Operations", click the "Review" button, then the "Save policy" button.

</TabsContent>
<TabsContent value="Cloudflare R2">
1. Create a [Cloudflare account](https://dash.cloudflare.com/sign-up).
2. Set up your R2 bucket:
- Navigate to R2 Object Storage in your dashboard. You may need to provide your credit-card information.
- Click "Create bucket"
- Enter a unique bucket name
- Select "Automatic" for location
- Choose "Standard" for storage class
- Confirm by clicking "Create bucket"
3. Configure public access:
- On your bucket's dashboard, click on the Settings tab.
- Scroll down to the Public Access section, and click on "Allow Access" in the "R2.dev subdomain" card.
- Type 'allow' to confirm
- Copy the Public R2.dev Bucket URL for your `S3_FILE_URL`
4. Retrieve credentials:
- [Go to API tokens page](https://dash.cloudflare.com/?to=/:account/r2/api-tokens):
- Select "Create API token"
- Edit the "R2 Token" name
- Under Permissions, select Object Read & Write permission types
- You can optionally specify the buckets that this API token has access to under the "Specify bucket(s)" section.
- Once done, click the "Create API Token" button.
- You'll receive an access key ID and a secret access key. Save them to use them later for the `S3_ACCESS_KEY_ID` and `S3_SECRET_ACCESS_KEY` environment variables.

</TabsContent>
</TabsContentWrapper>
</Tabs>

Expand Down Expand Up @@ -170,6 +194,7 @@ module.exports = {
- For MinIO, it's the URL to the MinIO server with the bucket's name. For example, `https://{server-domain}/{bucket}`.
- For DigitalOcean Spaces, it's either the Origin Endpoint or the CDN endpoint of your Spaces Object Storage bucket.
- for Supabase, it's `https://{uniqueID}.supabase.co/storage/v1/object/public/{bucket}`. You can retrieve the `uniqueID` from [Storage Settings](https://supabase.com/docs/guides/storage/s3/authentication?queryGroups=language&language=javascript#s3-access-keys) page in the Endpoint URL.
- For Cloudflare R2, it's `Public R2.dev Bucket URL`.

</Table.Cell>
<Table.Cell>
Expand Down Expand Up @@ -223,6 +248,8 @@ module.exports = {
The bucket's region code.

For MinIO, use `us-east-1`.

For Cloudflare, use `auto`.

</Table.Cell>
<Table.Cell>
Expand Down Expand Up @@ -262,6 +289,7 @@ module.exports = {
- For MinIO, it's the URL to the MinIO server.
- For DigitalOcean Spaces, it's the Spaces Origin Endpoint of the format `https://{region}.digitaloceanspaces.com`.
- For Supabase, it's the Endpoint URL in the [Storage Settings](https://supabase.com/docs/guides/storage/s3/authentication?queryGroups=language&language=javascript#s3-access-keys).
- For Cloudflare, it's `https://{your-account-id}.r2.cloudflarestorage.com`.

</Table.Cell>
<Table.Cell>
Expand Down
23 changes: 21 additions & 2 deletions www/apps/resources/app/architectural-modules/notification/page.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChildDocs } from "docs-ui"
import { CardList } from "docs-ui"

export const metadata = {
title: `Notification Module Providers`,
Expand All @@ -18,7 +18,26 @@ By default, Medusa uses the Local Notification Module which only simulates sendi

Medusa provides other Notification Modules that actually send notifications, such as the SendGrid Notification Module Provider.

<ChildDocs type="item" hideItems={["Guides"]} onlyTopLevel={true} />
<CardList
items={[
{
title: "Local",
href: "/architectural-modules/notification/local",
badge: {
variant: "neutral",
children: "For Development"
}
},
{
title: "SendGrid",
href: "/architectural-modules/notification/sendgrid",
badge: {
variant: "green",
children: "For Production"
}
}
]}
/>

---

Expand Down
2 changes: 1 addition & 1 deletion www/apps/resources/app/architectural-modules/page.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChildDocs, CardList } from "docs-ui"
import { CardList } from "docs-ui"

export const metadata = {
title: `Architectural Modules`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChildDocs } from "docs-ui"
import { CardList } from "docs-ui"

export const metadata = {
title: `Workflow Engine Modules`,
Expand All @@ -10,4 +10,23 @@ Workflow engine modules handle tracking and recording the transactions and statu

Medusa uses the In-Memory Workflow Engine Module by default. For production purposes, it's recommended to use the Redis Engine Module instead.

<ChildDocs type="item" hideItems={["Guides"]} onlyTopLevel={true} />
<CardList
items={[
{
title: "In-Memory",
href: "/architectural-modules/workflow-engine/in-memory",
badge: {
variant: "neutral",
children: "For Development"
}
},
{
title: "Redis",
href: "/architectural-modules/workflow-engine/redis",
badge: {
variant: "green",
children: "For Production"
}
}
]}
/>
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ This document explains how the Inventory Module is used within the Medusa applic

When a product variant is created and its `manage_inventory` property's value is `true`, the Medusa application creates an inventory item associated with that product variant.

<Note title="Tip">

This flow is implemented within the [createProductVariantsWorkflow](/references/medusa-workflows/createProductVariantsWorkflow)

</Note>

![A diagram showcasing how the Inventory Module is used in the product variant creation form](https://res.cloudinary.com/dza7lstvk/image/upload/v1709661511/Medusa%20Resources/inventory-product-create_khz2hk.jpg)

---
Expand All @@ -18,6 +24,12 @@ When a product variant is created and its `manage_inventory` property's value is

When a product variant with `manage_inventory` set to `true` is added to cart, the Medusa application checks whether there's sufficient stocked quantity. If not, an error is thrown and the product variant won't be added to the cart.

<Note title="Tip">

This flow is implemented within the [addToCartWorkflow](/references/medusa-workflows/addToCartWorkflow)

</Note>

![A diagram showcasing how the Inventory Module is used in the add to cart flow](https://res.cloudinary.com/dza7lstvk/image/upload/v1709711645/Medusa%20Resources/inventory-cart-flow_achwq9.jpg)

---
Expand All @@ -26,6 +38,12 @@ When a product variant with `manage_inventory` set to `true` is added to cart, t

When an order is placed, the Medusa application creates a reservation item for each product variant with `manage_inventory` set to `true`.

<Note title="Tip">

This flow is implemented within the [completeCartWorkflow](/references/medusa-workflows/completeCartWorkflow)

</Note>

![A diagram showcasing how the Inventory Module is used in the order placed flow](https://res.cloudinary.com/dza7lstvk/image/upload/v1709712005/Medusa%20Resources/inventory-order-placed_qdxqdn.jpg)

---
Expand All @@ -38,6 +56,12 @@ When an item in an order is fulfilled and the associated variant has its `manage
- Resets the `reserved_quantity` to `0`.
- Deletes the associated reservation item.

<Note title="Tip">

This flow is implemented within the [createOrderFulfillmentWorkflow](/references/medusa-workflows/createOrderFulfillmentWorkflow)

</Note>

![A diagram showcasing how the Inventory Module is used in the order fulfillment flow](https://res.cloudinary.com/dza7lstvk/image/upload/v1709712390/Medusa%20Resources/inventory-order-fulfillment_o9wdxh.jpg)

---
Expand All @@ -46,6 +70,12 @@ When an item in an order is fulfilled and the associated variant has its `manage

When an item in an order is returned and the associated variant has its `manage_inventory` property set to `true`, the Medusa application increments the `stocked_quantity` of the inventory item's level with the returned quantity.

<Note title="Tip">

This flow is implemented within the [confirmReturnReceiveWorkflow](/references/medusa-workflows/confirmReturnReceiveWorkflow)

</Note>

![A diagram showcasing how the Inventory Module is used in the order return flow](https://res.cloudinary.com/dza7lstvk/image/upload/v1709712457/Medusa%20Resources/inventory-order-return_ihftyk.jpg)

### Dismissed Returned Items
Expand Down
Loading

0 comments on commit d11079e

Please sign in to comment.