docs: revised build custom features chapter (#10338)

This commit is contained in:
Shahed Nasser
2024-11-28 12:28:27 +02:00
committed by GitHub
parent 441b7adaa7
commit aced04e182
2 changed files with 10 additions and 8 deletions

View File

@@ -4,13 +4,15 @@ export const metadata = {
# {metadata.title}
In this chapter, you'll learn about the concepts you need to build custom features in your Medusa application.
In the upcoming chapters, you'll follow step-by-step guides to build custom features in Medusa. These guides gradually introduce Medusa's concepts to help you understand what they are and how to use them.
To add a custom feature to your application, you create:
By following these guides, you'll add brands to the Medusa application that you can associate with products.
1. A module with data models and a main service to manage them.
2. A workflow to create, update, and delete records of data models. You implement functionalities in a workflow to benefit from features such as roll-back in case of errors, retry configurations, and more.
3. An API route that exposes the workflow's functionality to clients, such as the storefront or admin dashboard.
To build a custom feature in Medusa, you need three main ingredients:
- [Module](../../basics/modules/page.mdx): a re-usable package that defines commerce functionalities for a single domain. It defines new tables to add to the database, and a class of methods to manage these tables.
- [Workflow](../../basics/workflows/page.mdx): a special function that performs a task in a series of steps with advanced features like roll-back mechanism and retry configurations. The steps of a workflow use functionalities implemented by modules.
- [API route](../../basics/api-routes/page.mdx): a REST endpoint that exposes commerce features to clients, such as the admin dashboard or a storefront. The API route executes a workflow that implements the commerce feature using modules.
![Diagram showcasing the flow of a custom developed feature](https://res.cloudinary.com/dza7lstvk/image/upload/v1725867628/Medusa%20Book/custom-development_nofvp6.jpg)
@@ -18,8 +20,8 @@ To add a custom feature to your application, you create:
## Next Chapters: Brand Module Example
In the next chapters, you'll follow an example to:
The next chapters will guide you to:
1. Add a Brand Module that creates a `Brand` data model and provides data-management features.
1. Build a Brand Module that creates a `Brand` data model and provides data-management features.
2. Add a workflow to create a brand.
3. Expose an API route that allows admin users to create a brand using the workflow.

View File

@@ -94,7 +94,7 @@ export const generatedEditDates = {
"app/learn/customization/custom-features/workflow/page.mdx": "2024-09-30T08:43:53.133Z",
"app/learn/customization/extend-models/create-links/page.mdx": "2024-09-30T08:43:53.133Z",
"app/learn/customization/extend-models/extend-create-product/page.mdx": "2024-09-30T08:43:53.134Z",
"app/learn/customization/custom-features/page.mdx": "2024-09-12T11:18:13.271Z",
"app/learn/customization/custom-features/page.mdx": "2024-11-28T08:21:55.207Z",
"app/learn/customization/customize-admin/page.mdx": "2024-09-12T12:25:29.853Z",
"app/learn/customization/customize-admin/route/page.mdx": "2024-10-07T12:43:11.335Z",
"app/learn/customization/customize-admin/widget/page.mdx": "2024-10-07T12:44:24.538Z",