From 3d0ad0413c9db35093c8c1d469e275bd38c7db48 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Mon, 9 Dec 2024 13:37:41 +0200 Subject: [PATCH] docs: revise main docs outline --- .github/workflows/docs-test.yml | 4 +- .../advanced-development/api-routes/page.mdx | 14 - .../advanced-development/modules/page.mdx | 15 - .../app/learn/advanced-development/page.mdx | 15 - .../advanced-development/workflows/page.mdx | 14 - .../basics/admin-customizations/page.mdx | 64 ---- www/apps/book/app/learn/basics/page.mdx | 18 - .../basics/project-directories-files/page.mdx | 26 -- www/apps/book/app/learn/build/page.mdx | 2 +- .../custom-features/api-route/page.mdx | 8 +- .../custom-features/module/page.mdx | 10 +- .../customization/custom-features/page.mdx | 6 +- .../custom-features/workflow/page.mdx | 6 +- .../customization/customize-admin/page.mdx | 4 +- .../customize-admin/route/page.mdx | 8 +- .../customize-admin/widget/page.mdx | 2 +- .../extend-features/define-link/page.mdx | 4 +- .../extend-create-product/page.mdx | 10 +- .../customization/extend-features/page.mdx | 6 +- .../query-linked-records/page.mdx | 2 +- .../integrate-systems/handle-event/page.mdx | 14 +- .../customization/integrate-systems/page.mdx | 2 +- .../integrate-systems/schedule-task/page.mdx | 12 +- .../integrate-systems/service/page.mdx | 4 +- .../book/app/learn/customization/page.mdx | 14 - .../app/learn/first-customizations/page.mdx | 67 ---- .../admin/constraints/page.mdx | 0 .../admin/page.mdx | 0 .../admin/tips/page.mdx | 0 .../admin/ui-routes/page.mdx | 0 .../admin/widgets/page.mdx | 0 .../api-routes/additional-data/page.mdx | 2 +- .../api-routes/cors/page.mdx | 0 .../api-routes/errors/page.mdx | 0 .../api-routes/http-methods/page.mdx | 0 .../api-routes/middlewares/page.mdx | 0 .../api-routes/page.mdx | 0 .../api-routes/parameters/page.mdx | 0 .../api-routes/protected-routes/page.mdx | 0 .../api-routes/responses/page.mdx | 0 .../api-routes/validation/page.mdx | 2 +- .../custom-cli-scripts/page.mdx | 0 .../custom-cli-scripts/seed-data/page.mdx | 0 .../data-models/check-constraints/page.mdx | 0 .../data-models/configure-properties/page.mdx | 0 .../data-models/default-properties/page.mdx | 0 .../data-models/index/page.mdx | 0 .../data-models/infer-type/page.mdx | 0 .../data-models/manage-relationships/page.mdx | 0 .../data-models/page.mdx | 4 +- .../data-models/primary-key/page.mdx | 0 .../data-models/property-types/page.mdx | 0 .../data-models/relationships/page.mdx | 0 .../data-models/searchable-property/page.mdx | 0 .../data-models/write-migration/page.mdx | 0 .../environment-variables/page.mdx | 0 .../data-payload/page.mdx | 0 .../emit-event/page.mdx | 0 .../events-and-subscribers/page.mdx | 4 +- .../medusa-container/page.mdx | 14 +- .../module-links/custom-columns/page.mdx | 0 .../module-links/directions/page.mdx | 0 .../module-links/page.mdx | 0 .../module-links/query/page.mdx | 4 +- .../module-links/remote-link/page.mdx | 0 .../modules}/architectural-modules/page.mdx | 0 .../modules}/commerce-modules/page.mdx | 6 +- .../modules/container/page.mdx | 0 .../modules/db-operations/page.mdx | 0 .../modules/isolation/page.mdx | 4 +- .../modules}/loaders/page.mdx | 10 +- .../modules-directory-structure/page.mdx | 4 +- .../modules/multiple-services/page.mdx | 0 .../modules/options/page.mdx | 0 .../{basics => fundamentals}/modules/page.mdx | 12 +- .../modules/service-constraints/page.mdx | 0 .../modules/service-factory/page.mdx | 0 .../scheduled-jobs/execution-number/page.mdx | 0 .../scheduled-jobs/page.mdx | 2 +- .../workflows/access-workflow-errors/page.mdx | 0 .../workflows/add-workflow-hook/page.mdx | 0 .../workflows/compensation-function/page.mdx | 0 .../workflows/conditions/page.mdx | 0 .../constructor-constraints/page.mdx | 0 .../execute-another-workflow/page.mdx | 0 .../workflows/long-running-workflow/page.mdx | 0 .../workflows/multiple-step-usage/page.mdx | 0 .../workflows/page.mdx | 2 +- .../workflows/parallel-steps/page.mdx | 0 .../workflows/retry-failed-steps/page.mdx | 0 .../workflows/variable-manipulation/page.mdx | 0 .../workflows/workflow-hooks/page.mdx | 0 .../workflows/workflow-timeout/page.mdx | 0 www/apps/book/app/learn/installation/page.mdx | 28 +- .../architecture}/page.mdx | 0 .../learn/more-resources/cheatsheet/page.mdx | 160 --------- .../components/Homepage/CodeTabs/index.tsx | 16 +- .../Homepage/LinksSection/index.tsx | 4 +- www/apps/book/generated/edit-dates.mjs | 193 +++++----- www/apps/book/next.config.mjs | 37 +- www/apps/book/sidebar.mjs | 340 ++++++++---------- www/apps/book/utils/number-sidebar-items.mjs | 32 +- www/apps/book/utils/redirects.mjs | 109 ++++++ .../components/forms/page.mdx | 4 +- .../auth/create-actor-type/page.mdx | 2 +- .../app/commerce-modules/cart/extend/page.mdx | 22 +- .../commerce-modules/customer/extend/page.mdx | 22 +- .../payment/payment-flow/page.mdx | 2 +- .../commerce-modules/product/extend/page.mdx | 22 +- .../product/guides/price-with-taxes/page.mdx | 2 +- .../product/guides/price/page.mdx | 2 +- .../promotion/extend/page.mdx | 22 +- www/apps/resources/app/examples/page.mdx | 178 ++++----- .../app/integrations/guides/resend/page.mdx | 18 +- .../app/integrations/guides/sanity/page.mdx | 34 +- .../app/medusa-cli/commands/exec/page.mdx | 2 +- .../app/medusa-container-resources/page.mdx | 4 +- www/apps/resources/app/recipes/b2b/page.mdx | 16 +- .../app/recipes/commerce-automation/page.mdx | 24 +- .../examples/standard/page.mdx | 30 +- .../app/recipes/digital-products/page.mdx | 20 +- .../integrate-ecommerce-stack/page.mdx | 8 +- .../examples/restaurant-delivery/page.mdx | 26 +- .../marketplace/examples/vendors/page.mdx | 26 +- .../app/recipes/marketplace/page.mdx | 12 +- .../app/recipes/multi-region-store/page.mdx | 2 +- .../app/recipes/omnichannel/page.mdx | 6 +- www/apps/resources/app/recipes/oms/page.mdx | 10 +- .../recipes/personalized-products/page.mdx | 8 +- www/apps/resources/app/recipes/pos/page.mdx | 4 +- .../subscriptions/examples/standard/page.mdx | 20 +- .../app/recipes/subscriptions/page.mdx | 14 +- .../methods/list/page.mdx | 2 +- .../methods/listAndCount/page.mdx | 2 +- .../methods/retrieve/page.mdx | 2 +- .../app/service-factory-reference/page.mdx | 2 +- .../medusa-admin/no-widget-route/page.mdx | 4 +- .../functions/workflows.createHook/page.mdx | 2 +- .../page.mdx | 2 +- www/apps/ui/contentlayer.config.ts | 8 + www/apps/ui/package.json | 3 +- 141 files changed, 781 insertions(+), 1148 deletions(-) delete mode 100644 www/apps/book/app/learn/advanced-development/api-routes/page.mdx delete mode 100644 www/apps/book/app/learn/advanced-development/modules/page.mdx delete mode 100644 www/apps/book/app/learn/advanced-development/page.mdx delete mode 100644 www/apps/book/app/learn/advanced-development/workflows/page.mdx delete mode 100644 www/apps/book/app/learn/basics/admin-customizations/page.mdx delete mode 100644 www/apps/book/app/learn/basics/page.mdx delete mode 100644 www/apps/book/app/learn/basics/project-directories-files/page.mdx delete mode 100644 www/apps/book/app/learn/customization/page.mdx delete mode 100644 www/apps/book/app/learn/first-customizations/page.mdx rename www/apps/book/app/learn/{advanced-development => fundamentals}/admin/constraints/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/admin/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/admin/tips/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/admin/ui-routes/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/admin/widgets/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/api-routes/additional-data/page.mdx (98%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/api-routes/cors/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/api-routes/errors/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/api-routes/http-methods/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/api-routes/middlewares/page.mdx (100%) rename www/apps/book/app/learn/{basics => fundamentals}/api-routes/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/api-routes/parameters/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/api-routes/protected-routes/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/api-routes/responses/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/api-routes/validation/page.mdx (99%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/custom-cli-scripts/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/custom-cli-scripts/seed-data/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/data-models/check-constraints/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/data-models/configure-properties/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/data-models/default-properties/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/data-models/index/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/data-models/infer-type/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/data-models/manage-relationships/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/data-models/page.mdx (57%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/data-models/primary-key/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/data-models/property-types/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/data-models/relationships/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/data-models/searchable-property/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/data-models/write-migration/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/environment-variables/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/events-and-subscribers/data-payload/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/events-and-subscribers/emit-event/page.mdx (100%) rename www/apps/book/app/learn/{basics => fundamentals}/events-and-subscribers/page.mdx (92%) rename www/apps/book/app/learn/{basics => fundamentals}/medusa-container/page.mdx (78%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/module-links/custom-columns/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/module-links/directions/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/module-links/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/module-links/query/page.mdx (98%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/module-links/remote-link/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development/architecture => fundamentals/modules}/architectural-modules/page.mdx (100%) rename www/apps/book/app/learn/{basics => fundamentals/modules}/commerce-modules/page.mdx (70%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/modules/container/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/modules/db-operations/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/modules/isolation/page.mdx (94%) rename www/apps/book/app/learn/{basics => fundamentals/modules}/loaders/page.mdx (90%) rename www/apps/book/app/learn/{basics => fundamentals/modules}/modules-directory-structure/page.mdx (91%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/modules/multiple-services/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/modules/options/page.mdx (100%) rename www/apps/book/app/learn/{basics => fundamentals}/modules/page.mdx (93%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/modules/service-constraints/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/modules/service-factory/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/scheduled-jobs/execution-number/page.mdx (100%) rename www/apps/book/app/learn/{basics => fundamentals}/scheduled-jobs/page.mdx (98%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/workflows/access-workflow-errors/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/workflows/add-workflow-hook/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/workflows/compensation-function/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/workflows/conditions/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/workflows/constructor-constraints/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/workflows/execute-another-workflow/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/workflows/long-running-workflow/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/workflows/multiple-step-usage/page.mdx (100%) rename www/apps/book/app/learn/{basics => fundamentals}/workflows/page.mdx (98%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/workflows/parallel-steps/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/workflows/retry-failed-steps/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/workflows/variable-manipulation/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/workflows/workflow-hooks/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development => fundamentals}/workflows/workflow-timeout/page.mdx (100%) rename www/apps/book/app/learn/{advanced-development/architecture/overview => introduction/architecture}/page.mdx (100%) delete mode 100644 www/apps/book/app/learn/more-resources/cheatsheet/page.mdx create mode 100644 www/apps/book/utils/redirects.mjs diff --git a/.github/workflows/docs-test.yml b/.github/workflows/docs-test.yml index 5482a64686bec..dcc4c293f163f 100644 --- a/.github/workflows/docs-test.yml +++ b/.github/workflows/docs-test.yml @@ -41,9 +41,9 @@ jobs: NEXT_PUBLIC_BASE_URL: "http://localhost:3000" NEXT_PUBLIC_BASE_PATH: /api NEXT_PUBLIC_DOCS_URL: "https://medusa-docs.vercel.app" - NEXT_PUBLIC_UI_URL: "https://docs-ui.vercel.app" + NODE_ENV: production + NEXT_PUBLIC_RESOURCES_URL: "http://medusa-types-nine.vercel.app" # TODO change once we have actual URLs - NEXT_PUBLIC_RESOURCES_URL: "http://example.com" NEXT_PUBLIC_USER_GUIDE_URL: "http://example.com" vale-book: diff --git a/www/apps/book/app/learn/advanced-development/api-routes/page.mdx b/www/apps/book/app/learn/advanced-development/api-routes/page.mdx deleted file mode 100644 index 3b66757ea4b32..0000000000000 --- a/www/apps/book/app/learn/advanced-development/api-routes/page.mdx +++ /dev/null @@ -1,14 +0,0 @@ -export const metadata = { - title: `${pageNumber} API Routes Advanced Guides`, -} - -# {metadata.title} - -In the next chapters, you'll focus more on API routes to learn about topics such as: - -- Creating API routes for different HTTP methods. -- Accepting parameters in your API routes. -- Formatting response data and headers. -- Applying middlewares on API routes. -- Validating request body parameters. -- Protecting API routes by requiring user authentication. diff --git a/www/apps/book/app/learn/advanced-development/modules/page.mdx b/www/apps/book/app/learn/advanced-development/modules/page.mdx deleted file mode 100644 index 8811f4b9d4959..0000000000000 --- a/www/apps/book/app/learn/advanced-development/modules/page.mdx +++ /dev/null @@ -1,15 +0,0 @@ -export const metadata = { - title: `${pageNumber} Modules Advanced Guides`, -} - -# {metadata.title} - -In the next chapters, you'll learn more about developing modules and related resources. - -By the end of this chapter, you'll know more about: - -1. A module's container and how a module is isolated. -2. Passing options to a module. -3. The service factory and the methods it generates. -4. Using a module's service to query and perform actions on the database. -5. Using multiple services in a module. diff --git a/www/apps/book/app/learn/advanced-development/page.mdx b/www/apps/book/app/learn/advanced-development/page.mdx deleted file mode 100644 index 581d4161d0eac..0000000000000 --- a/www/apps/book/app/learn/advanced-development/page.mdx +++ /dev/null @@ -1,15 +0,0 @@ -export const metadata = { - title: `${pageNumber} Advanced Development`, -} - -# {metadata.title} - -In the previous chapters, you got a brief introduction to Medusa’s basic concepts. However, to build a custom commerce application, you need a deeper understanding of how you utilize these concepts for your business use case. - -The next chapters dive deeper into each concept, and explore Medusa's architecture. By the end of these chapters, you’ll be able to: - -- Expose API routes with control over authentication. -- Build sophisticated business logic in modules and manage links between them. -- Create advanced workflows and configure retries and timeout. -- Add new pages to the Medusa Admin. -- Do more with subscribers, scheduled jobs, and other tools. diff --git a/www/apps/book/app/learn/advanced-development/workflows/page.mdx b/www/apps/book/app/learn/advanced-development/workflows/page.mdx deleted file mode 100644 index 8b73c9a2e033b..0000000000000 --- a/www/apps/book/app/learn/advanced-development/workflows/page.mdx +++ /dev/null @@ -1,14 +0,0 @@ -export const metadata = { - title: `${pageNumber} Workflows Advanced Development`, -} - -# {metadata.title} - -In the next chapters, you'll learn about workflows in-depth and how to use them in your custom development. - -By the end of these chapters, you'll learn about: - -- Constructing a workflow and its constraints. -- Using a compensation function to undo a step's action when errors occur. -- Hooks and how to consume and expose them. -- Configurations to retry workflows or run them in the background. diff --git a/www/apps/book/app/learn/basics/admin-customizations/page.mdx b/www/apps/book/app/learn/basics/admin-customizations/page.mdx deleted file mode 100644 index aa604422d9b64..0000000000000 --- a/www/apps/book/app/learn/basics/admin-customizations/page.mdx +++ /dev/null @@ -1,64 +0,0 @@ -export const metadata = { - title: `${pageNumber} Admin Customizations`, -} - -# {metadata.title} - -In this chapter, you’ll learn how to customize the Medusa Admin dashboard. - -## What is the Medusa Admin? - -The Medusa Admin is an admin dashboard that merchants use to manage their store's data. - -You can extend the Medusa Admin to add widgets and new pages. In your customizations, you interact with API routes to provide merchants with custom functionalities. - -The Medusa Admin is installed in your Medusa application and runs at `http://localhost:9000/app` when you start the application. - ---- - -## Example: Create a Widget - -A widget is a React component that can be injected into an existing page in the admin dashboard. - -For example, create the file `src/admin/widgets/product-widget.tsx` with the following content: - -```tsx title="src/admin/widgets/product-widget.tsx" -import { defineWidgetConfig } from "@medusajs/admin-sdk" -import { Container, Heading } from "@medusajs/ui" - -const ProductWidget = () => { - return ( - -
- Product Widget -
-
- ) -} - -export const config = defineWidgetConfig({ - zone: "product.details.before", -}) - -export default ProductWidget -``` - -This inserts a widget with the text “Product Widget” at the beginning of a product’s details page. - -In your widget, use custom components from the [Medusa UI package](https://docs.medusajs.com/ui). - -### Test the Widget - -To test out the widget, start the Medusa application: - -```bash npm2yarn -npm run dev -``` - -Then, open a product’s details page in the Medusa Admin. You’ll find your custom widget at the top of the page. - ---- - -## Admin Components List - -To build admin customizations that match the Medusa Admin's designs and layouts, refer to [this guide](!resources!/admin-components) to find common components. diff --git a/www/apps/book/app/learn/basics/page.mdx b/www/apps/book/app/learn/basics/page.mdx deleted file mode 100644 index 39f031737da64..0000000000000 --- a/www/apps/book/app/learn/basics/page.mdx +++ /dev/null @@ -1,18 +0,0 @@ -export const metadata = { - title: `${pageNumber} The Basics`, -} - -# {metadata.title} - -In the next chapters, you’ll learn about the basic concepts of Medusa that are central to your development. - -By the end of these chapters, you’ll be able to: - -- Expose your custom functionalities through endpoints. -- Create custom modules that define custom business logic. -- Create custom tables in the database through data models. -- Execute scripts when the Medusa application starts. -- Perform asynchronous actions when an event occurs. -- Run tasks at a specified time or pattern during the Medusa application's runtime. -- Create custom flows as a series of steps involving multiple services. -- Customize the admin dashboard to inject components on existing pages or add new pages. diff --git a/www/apps/book/app/learn/basics/project-directories-files/page.mdx b/www/apps/book/app/learn/basics/project-directories-files/page.mdx deleted file mode 100644 index d883a574f69cc..0000000000000 --- a/www/apps/book/app/learn/basics/project-directories-files/page.mdx +++ /dev/null @@ -1,26 +0,0 @@ -export const metadata = { - title: `${pageNumber} Project File Conventions`, -} - -# {metadata.title} - -In this chapter, you’ll learn about important directories and files in your Medusa application's project. - -![A diagram of the directories overview](https://res.cloudinary.com/dza7lstvk/image/upload/v1732803813/Medusa%20Book/medusa-dir-overview_v7ks0j.jpg) - -## src - -This directory is the central place for your custom development. It includes the following sub-directories: - -- `admin`: Holds your admin dashboard's custom [widgets](../../advanced-development/admin/widgets/page.mdx) and [UI routes](../../advanced-development/admin/ui-routes/page.mdx). -- `api`: Holds your custom [API routes](../api-routes/page.mdx) that are added as endpoints in your Medusa application. -- `jobs`: Holds your [scheduled jobs](../scheduled-jobs/page.mdx) that run at a specified interval during your Medusa application's runtime. -- `links`: Holds you [module links](../../advanced-development/module-links/page.mdx) that build associations between data models of different modules. -- `modules`: Holds your custom [modules](../modules/page.mdx) that implement custom business logic. -- `scripts`: Holds your custom [scripts](../../advanced-development/custom-cli-scripts/page.mdx) to be executed using Medusa's CLI tool. -- `subscribers`: Holds your [event listeners](../events-and-subscribers/page.mdx) that are executed asynchronously whenever an event is emitted. -- `workflows`: Holds your custom [flows](../workflows/page.mdx) that can be executed from anywhere in your application. - -## medusa-config.ts - -This file holds your [Medusa configurations](!resources!/references/medusa-config), such as your PostgreSQL database configurations. diff --git a/www/apps/book/app/learn/build/page.mdx b/www/apps/book/app/learn/build/page.mdx index d0cc43bee76e6..033a3df6979c1 100644 --- a/www/apps/book/app/learn/build/page.mdx +++ b/www/apps/book/app/learn/build/page.mdx @@ -55,7 +55,7 @@ cp ../../.env .env.production -When `NODE_ENV=production`, the Medusa application loads the environment variables from `.env.production`. Learn more about environment variables in [this guide](../advanced-development/environment-variables/page.mdx). +When `NODE_ENV=production`, the Medusa application loads the environment variables from `.env.production`. Learn more about environment variables in [this guide](../fundamentals/environment-variables/page.mdx). diff --git a/www/apps/book/app/learn/customization/custom-features/api-route/page.mdx b/www/apps/book/app/learn/customization/custom-features/api-route/page.mdx index 979a0e5a962d4..dc416aa76d1ec 100644 --- a/www/apps/book/app/learn/customization/custom-features/api-route/page.mdx +++ b/www/apps/book/app/learn/customization/custom-features/api-route/page.mdx @@ -27,7 +27,7 @@ You create an API route in a `route.{ts,js}` file under a sub-directory of the ` -Learn more about API routes [in this guide](../../../basics/api-routes/page.mdx). +Learn more about API routes [in this guide](../../../fundamentals/api-routes/page.mdx). @@ -63,7 +63,7 @@ export const POST = async ( You export a route handler function with its name (`POST`) being the HTTP method of the API route you're exposing. -The function receives two parameters: a `MedusaRequest` object to access request details, and `MedusaResponse` object to return or manipulate the response. The `MedusaRequest` object's `scope` property is the [Medusa container](../../../basics/medusa-container/page.mdx) that holds framework tools and custom and core modules' services. +The function receives two parameters: a `MedusaRequest` object to access request details, and `MedusaResponse` object to return or manipulate the response. The `MedusaRequest` object's `scope` property is the [Medusa container](../../../fundamentals/medusa-container/page.mdx) that holds framework tools and custom and core modules' services. @@ -85,7 +85,7 @@ Medusa uses [Zod](https://zod.dev/) to create validation schemas. These schemas -Learn more about API route validation in [this chapter](../../../advanced-development/api-routes/validation/page.mdx). +Learn more about API route validation in [this chapter](../../../fundamentals/api-routes/validation/page.mdx). @@ -123,7 +123,7 @@ A middleware is a function executed before the route handler when a request is s -Learn more about middlewares in [this chapter](../../../advanced-development/api-routes/middlewares/page.mdx). +Learn more about middlewares in [this chapter](../../../fundamentals/api-routes/middlewares/page.mdx). diff --git a/www/apps/book/app/learn/customization/custom-features/module/page.mdx b/www/apps/book/app/learn/customization/custom-features/module/page.mdx index 07cd352b312d1..f49bd34622c47 100644 --- a/www/apps/book/app/learn/customization/custom-features/module/page.mdx +++ b/www/apps/book/app/learn/customization/custom-features/module/page.mdx @@ -12,7 +12,7 @@ In a module, you create data models and business logic to manage them. In the ne -Learn more about modules in [this chapter](../../../basics/modules/page.mdx). +Learn more about modules in [this chapter](../../../fundamentals/modules/page.mdx). @@ -30,7 +30,7 @@ A data model represents a table in the database. You create data models using Me -Learn more about data models in [this chapter](../../../basics/modules/page.mdx#1-create-data-model). +Learn more about data models in [this chapter](../../../fundamentals/modules/page.mdx#1-create-data-model). @@ -56,7 +56,7 @@ You define the data model using the `define` method of the `model` utility impor -Learn about other property types in [this chapter](../../../advanced-development/data-models/property-types/page.mdx). +Learn about other property types in [this chapter](../../../fundamentals/data-models/property-types/page.mdx). @@ -70,7 +70,7 @@ In this step, you'll create the Brand Module's service that provides methods to -Learn more about services in [this chapter](../../../basics/modules/page.mdx#2-create-service). +Learn more about services in [this chapter](../../../fundamentals/modules/page.mdx#2-create-service). @@ -168,7 +168,7 @@ A migration is a TypeScript or JavaScript file that defines database changes mad -Learn more about migrations in [this chapter](../../../basics/modules/page.mdx#5-generate-migrations). +Learn more about migrations in [this chapter](../../../fundamentals/modules/page.mdx#5-generate-migrations). diff --git a/www/apps/book/app/learn/customization/custom-features/page.mdx b/www/apps/book/app/learn/customization/custom-features/page.mdx index 3b3a1268c6662..204dfc459576c 100644 --- a/www/apps/book/app/learn/customization/custom-features/page.mdx +++ b/www/apps/book/app/learn/customization/custom-features/page.mdx @@ -10,9 +10,9 @@ By following these guides, you'll add brands to the Medusa application that you To build a custom feature in Medusa, you need three main tools: -- [Module](../../basics/modules/page.mdx): a package with commerce logic 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 tool to perform an operation comprising multiple steps with built-in rollback and retry mechanisms. -- [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. +- [Module](../../fundamentals/modules/page.mdx): a package with commerce logic for a single domain. It defines new tables to add to the database, and a class of methods to manage these tables. +- [Workflow](../../fundamentals/workflows/page.mdx): a tool to perform an operation comprising multiple steps with built-in rollback and retry mechanisms. +- [API route](../../fundamentals/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) diff --git a/www/apps/book/app/learn/customization/custom-features/workflow/page.mdx b/www/apps/book/app/learn/customization/custom-features/workflow/page.mdx index aa4f20d261c1d..c76eae0929a05 100644 --- a/www/apps/book/app/learn/customization/custom-features/workflow/page.mdx +++ b/www/apps/book/app/learn/customization/custom-features/workflow/page.mdx @@ -14,7 +14,7 @@ The workflow you'll create in this chapter will use the Brand Module's service t -Learn more about workflows in [this chapter](../../../basics/workflows/page.mdx). +Learn more about workflows in [this chapter](../../../fundamentals/workflows/page.mdx). @@ -67,7 +67,7 @@ You create a `createBrandStep` using the `createStep` function. It accepts the s The step function receives two parameters: input passed to the step when it's invoked, and an object of general context and configurations. This object has a `container` property, which is the Medusa container. -The [Medusa container](../../../basics/medusa-container/page.mdx) is a registry of framework and commerce tools accessible in your customizations, such as a workflow's step. The Medusa application registers the services of core and custom modules in the container, allowing you to resolve and use them. +The [Medusa container](../../../fundamentals/medusa-container/page.mdx) is a registry of framework and commerce tools accessible in your customizations, such as a workflow's step. The Medusa application registers the services of core and custom modules in the container, allowing you to resolve and use them. So, In the step function, you use the Medusa container to resolve the Brand Module's service and use its generated `createBrands` method, which accepts an object of brands to create. @@ -85,7 +85,7 @@ You define for each step a compensation function that's executed when an error o -Learn more about the compensation function in [this chapter](../../../advanced-development/workflows/compensation-function/page.mdx). +Learn more about the compensation function in [this chapter](../../../fundamentals/workflows/compensation-function/page.mdx). diff --git a/www/apps/book/app/learn/customization/customize-admin/page.mdx b/www/apps/book/app/learn/customization/customize-admin/page.mdx index 806a4c78e4c9b..44b44001e2e97 100644 --- a/www/apps/book/app/learn/customization/customize-admin/page.mdx +++ b/www/apps/book/app/learn/customization/customize-admin/page.mdx @@ -8,8 +8,8 @@ In the previous chapters, you've customized your Medusa application to [add bran After customizing and extending your application with new features, you may need to provide an interface for admin users to utilize these features. The Medusa Admin dashboard is extendable, allowing you to: -- Insert components, called [widgets](../../advanced-development/admin/widgets/page.mdx), on existing pages. -- Add new pages, called [UI Routes](../../advanced-development/admin/ui-routes/page.mdx). +- Insert components, called [widgets](../../fundamentals/admin/widgets/page.mdx), on existing pages. +- Add new pages, called [UI Routes](../../fundamentals/admin/ui-routes/page.mdx). From these customizations, you can send requests to custom API routes, allowing admin users to manage custom resources on the dashboard diff --git a/www/apps/book/app/learn/customization/customize-admin/route/page.mdx b/www/apps/book/app/learn/customization/customize-admin/route/page.mdx index 37b5eacc96b94..ff5b9885127dd 100644 --- a/www/apps/book/app/learn/customization/customize-admin/route/page.mdx +++ b/www/apps/book/app/learn/customization/customize-admin/route/page.mdx @@ -19,7 +19,7 @@ In this chapter, you'll add a UI route to the admin dashboard that shows the all ## 1. Get Brands API Route -In a [previous chapter](../../extend-features/query-linked-records/page.mdx), you learned how to add an API route that retrieves brands and their products using [Query](../../../advanced-development/module-links/query/page.mdx). You'll expand that API route to support pagination, so that on the admin dashboard you can show the brands in a paginated table. +In a [previous chapter](../../extend-features/query-linked-records/page.mdx), you learned how to add an API route that retrieves brands and their products using [Query](../../../fundamentals/module-links/query/page.mdx). You'll expand that API route to support pagination, so that on the admin dashboard you can show the brands in a paginated table. Replace or create the `GET` API route at `src/api/admin/brands/route.ts` with the following: @@ -76,7 +76,7 @@ You return in the response the retrieved brands and the pagination configuration -Learn more about pagination with Query in [this chapter](../../../advanced-development/module-links/query/page.mdx#apply-pagination). +Learn more about pagination with Query in [this chapter](../../../fundamentals/module-links/query/page.mdx#apply-pagination). @@ -138,7 +138,7 @@ By applying the above middleware, you can pass pagination configurations to `GET -Learn more about using the `validateAndTransformQuery` middleware to configure Query in [this chapter](../../../advanced-development/module-links/query/page.mdx#request-query-configurations). +Learn more about using the `validateAndTransformQuery` middleware to configure Query in [this chapter](../../../fundamentals/module-links/query/page.mdx#request-query-configurations). @@ -186,7 +186,7 @@ You'll now add the UI route that shows the paginated list of brands. A UI route -Learn more about UI routes in [this chapter](../../../advanced-development/admin/ui-routes/page.mdx). +Learn more about UI routes in [this chapter](../../../fundamentals/admin/ui-routes/page.mdx). diff --git a/www/apps/book/app/learn/customization/customize-admin/widget/page.mdx b/www/apps/book/app/learn/customization/customize-admin/widget/page.mdx index a78b64474ec37..13ac3187e9bb5 100644 --- a/www/apps/book/app/learn/customization/customize-admin/widget/page.mdx +++ b/www/apps/book/app/learn/customization/customize-admin/widget/page.mdx @@ -59,7 +59,7 @@ You'll now add a widget to the product-details page. A widget is a React compone -Learn more about widgets in [this documentation](../../../advanced-development/admin/widgets/page.mdx). +Learn more about widgets in [this documentation](../../../fundamentals/admin/widgets/page.mdx). diff --git a/www/apps/book/app/learn/customization/extend-features/define-link/page.mdx b/www/apps/book/app/learn/customization/extend-features/define-link/page.mdx index c671d0cfbc32c..3687c4134beb5 100644 --- a/www/apps/book/app/learn/customization/extend-features/define-link/page.mdx +++ b/www/apps/book/app/learn/customization/extend-features/define-link/page.mdx @@ -8,7 +8,7 @@ export const metadata = { In this chapter, you'll learn how to define a module link between a brand defined in the [custom Brand Module](../../custom-features/module/page.mdx), and a product defined in the [Product Module](!resources!/commerce-modules/product) that's available in your Medusa application out-of-the-box. -Modules are [isolated](../../../advanced-development/modules/isolation/page.mdx) from other resources, ensuring that they're integrated into the Medusa application without side effects. However, you may need to associate data models of different modules, or you're trying to extend data models from commerce modules with custom properties. To do that, you define module links. +Modules are [isolated](../../../fundamentals/modules/isolation/page.mdx) from other resources, ensuring that they're integrated into the Medusa application without side effects. However, you may need to associate data models of different modules, or you're trying to extend data models from commerce modules with custom properties. To do that, you define module links. A module link forms an association between two data models of different modules while maintaining module isolation. You can then manage and query linked records of the data models using Medusa's Modules SDK. @@ -16,7 +16,7 @@ In this chapter, you'll define a module link between the `Brand` data model of t -Learn more about module links in [this chapters](../../../advanced-development/module-links/page.mdx). +Learn more about module links in [this chapters](../../../fundamentals/module-links/page.mdx). diff --git a/www/apps/book/app/learn/customization/extend-features/extend-create-product/page.mdx b/www/apps/book/app/learn/customization/extend-features/extend-create-product/page.mdx index 8db53721fe149..512744fdd440f 100644 --- a/www/apps/book/app/learn/customization/extend-features/extend-create-product/page.mdx +++ b/www/apps/book/app/learn/customization/extend-features/extend-create-product/page.mdx @@ -8,7 +8,7 @@ export const metadata = { After linking the [custom Brand data model](../../custom-features/module/page.mdx) and Medusa's [Product Module](!resources!/commerce-modules/product) in the [previous chapter](../define-link/page.mdx), you'll extend the create product workflow and API route to allow associating a brand with a product. -Some API routes, including the [Create Product API route](!api!/admin#products_postproducts), accept an `additional_data` request body parameter. This parameter can hold custom data that's passed to the [hooks](../../../advanced-development/workflows/workflow-hooks/page.mdx) of the workflow executed in the API route, allowing you to consume those hooks and perform actions with the custom data. +Some API routes, including the [Create Product API route](!api!/admin#products_postproducts), accept an `additional_data` request body parameter. This parameter can hold custom data that's passed to the [hooks](../../../fundamentals/workflows/workflow-hooks/page.mdx) of the workflow executed in the API route, allowing you to consume those hooks and perform actions with the custom data. So, in this chapter, to extend the create product flow and associate a brand with a product, you will: @@ -17,7 +17,7 @@ So, in this chapter, to extend the create product flow and associate a brand wit -To learn more about the `additional_data` property and the API routes that accept additional data, refer to [this chapter](../../../advanced-development/api-routes/additional-data/page.mdx). +To learn more about the `additional_data` property and the API routes that accept additional data, refer to [this chapter](../../../fundamentals/api-routes/additional-data/page.mdx). @@ -42,7 +42,7 @@ A workflow hook is a point in a workflow where you can inject a step to perform -Learn more about the workflow hooks in [this chapter](../../../advanced-development/workflows/workflow-hooks/page.mdx). +Learn more about the workflow hooks in [this chapter](../../../fundamentals/workflows/workflow-hooks/page.mdx). @@ -87,7 +87,7 @@ createProductsWorkflow.hooks.productsCreated( Workflows have a special `hooks` property to access its hooks and consume them. Each hook, such as `productCreated`, accepts a step function as a parameter. The step function accepts the following parameters: 1. An object having an `additional_data` property, which is the custom data passed in the request body under `additional_data`. The object will also have properties passed from the workflow to the hook, which in this case is the `products` property that holds an array of the created products. -2. An object of properties related to the step's context. It has a `container` property whose value is the [Medusa container](../../../basics/medusa-container/page.mdx) to resolve framework and commerce tools. +2. An object of properties related to the step's context. It has a `container` property whose value is the [Medusa container](../../../fundamentals/medusa-container/page.mdx) to resolve framework and commerce tools. In the step, if a brand ID is passed in `additional_data`, you resolve the Brand Module's service and use its generated `retrieveBrand` method to retrieve the brand by its ID. The `retrieveBrand` method will throw an error if the brand doesn't exist. @@ -97,7 +97,7 @@ Next, you want to create a link between the created products and the brand. To d -Learn more about the remote link in [this chapter](../../../advanced-development/module-links/remote-link/page.mdx). +Learn more about the remote link in [this chapter](../../../fundamentals/module-links/remote-link/page.mdx). diff --git a/www/apps/book/app/learn/customization/extend-features/page.mdx b/www/apps/book/app/learn/customization/extend-features/page.mdx index 8cea08345e77b..2f0e066aac5ca 100644 --- a/www/apps/book/app/learn/customization/extend-features/page.mdx +++ b/www/apps/book/app/learn/customization/extend-features/page.mdx @@ -10,9 +10,9 @@ In other commerce platforms, you extend core features and models through hacky w Medusa's framework and orchestration tools mitigate these issues while supporting all your customization needs: -- [Module Links](../../advanced-development/module-links/page.mdx): Link data models of different modules without building direct dependencies, ensuring that the Medusa application integrates your modules without side effects. -- [Workflow Hooks](../../advanced-development/workflows/workflow-hooks/page.mdx): inject custom functionalities into a workflow at predefined points, called hooks. This allows you to perform custom actions as a part of a core workflow without hacky workarounds. -- [Additional Data in API Routes](../../advanced-development/api-routes/additional-data/page.mdx): Configure core API routes to accept request parameters relevant to your customizations. These parameters are passed to the underlying workflow's hooks, where you can manage your custom data as part of an existing flow. +- [Module Links](../../fundamentals/module-links/page.mdx): Link data models of different modules without building direct dependencies, ensuring that the Medusa application integrates your modules without side effects. +- [Workflow Hooks](../../fundamentals/workflows/workflow-hooks/page.mdx): inject custom functionalities into a workflow at predefined points, called hooks. This allows you to perform custom actions as a part of a core workflow without hacky workarounds. +- [Additional Data in API Routes](../../fundamentals/api-routes/additional-data/page.mdx): Configure core API routes to accept request parameters relevant to your customizations. These parameters are passed to the underlying workflow's hooks, where you can manage your custom data as part of an existing flow. --- diff --git a/www/apps/book/app/learn/customization/extend-features/query-linked-records/page.mdx b/www/apps/book/app/learn/customization/extend-features/query-linked-records/page.mdx index 2449a7e5a54f1..06c755ff91488 100644 --- a/www/apps/book/app/learn/customization/extend-features/query-linked-records/page.mdx +++ b/www/apps/book/app/learn/customization/extend-features/query-linked-records/page.mdx @@ -74,7 +74,7 @@ You can also retrieve linked records using Query. Query allows you to retrieve d -Learn more about Query in [this chapter](../../../advanced-development/module-links/query/page.mdx). +Learn more about Query in [this chapter](../../../fundamentals/module-links/query/page.mdx). diff --git a/www/apps/book/app/learn/customization/integrate-systems/handle-event/page.mdx b/www/apps/book/app/learn/customization/integrate-systems/handle-event/page.mdx index dc9f7e51ad619..11cf42a3678d4 100644 --- a/www/apps/book/app/learn/customization/integrate-systems/handle-event/page.mdx +++ b/www/apps/book/app/learn/customization/integrate-systems/handle-event/page.mdx @@ -10,11 +10,11 @@ In the [previous chapter](../service/page.mdx), you created a CMS Module that in In another previous chapter, you [added a workflow](../../custom-features/workflow/page.mdx) that creates a brand. After integrating the CMS, you want to sync that brand to the third-party system as well. -Medusa has an event system that emits events when an operation is performed. It allows you to listen to those events and perform an asynchronous action in a function called a [subscriber](../../../basics/events-and-subscribers/page.mdx). This is useful to perform actions that aren't integral to the original flow, such as syncing data to a third-party system. +Medusa has an event system that emits events when an operation is performed. It allows you to listen to those events and perform an asynchronous action in a function called a [subscriber](../../../fundamentals/events-and-subscribers/page.mdx). This is useful to perform actions that aren't integral to the original flow, such as syncing data to a third-party system. -Learn more about Medusa's event system and subscribers in [this chapter](../../../basics/events-and-subscribers/page.mdx). +Learn more about Medusa's event system and subscribers in [this chapter](../../../fundamentals/events-and-subscribers/page.mdx). @@ -87,13 +87,13 @@ Workflows have a built-in durable execution engine that helps you complete tasks -Learn more about workflows in [this chapter](../../../basics/workflows/page.mdx). +Learn more about workflows in [this chapter](../../../fundamentals/workflows/page.mdx). You'll create a `syncBrandToSystemWorkflow` that has two steps: -- `useQueryGraphStep`: a step that Medusa provides to retrieve data using [Query](../../../advanced-development/module-links/query/page.mdx). You'll use this to retrieve the brand's details using its ID. +- `useQueryGraphStep`: a step that Medusa provides to retrieve data using [Query](../../../fundamentals/module-links/query/page.mdx). You'll use this to retrieve the brand's details using its ID. - `syncBrandToCmsStep`: a step that you'll create to sync the brand to the CMS. ### syncBrandToCmsStep @@ -142,13 +142,13 @@ const syncBrandToCmsStep = createStep( ) ``` -You create the `syncBrandToCmsStep` that accepts a brand as an input. In the step, you resolve the CMS Module's service from the [Medusa container](../../../basics/medusa-container/page.mdx) and use its `createBrand` method. This method will create the brand in the third-party CMS. +You create the `syncBrandToCmsStep` that accepts a brand as an input. In the step, you resolve the CMS Module's service from the [Medusa container](../../../fundamentals/medusa-container/page.mdx) and use its `createBrand` method. This method will create the brand in the third-party CMS. You also pass the brand's ID to the step's compensation function. In this function, you delete the brand in the third-party CMS if an error occurs during the workflow's execution. -Learn more about compensation functions in [this chapter](../../../advanced-development/workflows/compensation-function/page.mdx). +Learn more about compensation functions in [this chapter](../../../fundamentals/workflows/compensation-function/page.mdx). @@ -270,7 +270,7 @@ In the function, you execute the `syncBrandToCmsWorkflow`, passing it the data p -Learn more about subscribers in [this chapter](../../../basics/events-and-subscribers/page.mdx). +Learn more about subscribers in [this chapter](../../../fundamentals/events-and-subscribers/page.mdx). diff --git a/www/apps/book/app/learn/customization/integrate-systems/page.mdx b/www/apps/book/app/learn/customization/integrate-systems/page.mdx index ae4b51a07dd0a..c09ef24a2f528 100644 --- a/www/apps/book/app/learn/customization/integrate-systems/page.mdx +++ b/www/apps/book/app/learn/customization/integrate-systems/page.mdx @@ -12,7 +12,7 @@ In Medusa, you integrate a third-party system by: 1. Creating a module whose service provides the methods to connect to and perform operations in the third-party system. 2. Building workflows that complete tasks spanning across systems. You use the module that integrates a third-party system in the workflow's steps. -3. Executing the workflows you built in an [API route](../../basics/api-routes/page.mdx), at a scheduled time, or when an event is emitted. +3. Executing the workflows you built in an [API route](../../fundamentals/api-routes/page.mdx), at a scheduled time, or when an event is emitted. --- diff --git a/www/apps/book/app/learn/customization/integrate-systems/schedule-task/page.mdx b/www/apps/book/app/learn/customization/integrate-systems/schedule-task/page.mdx index 5c21a584edbb2..4686c08f05fcd 100644 --- a/www/apps/book/app/learn/customization/integrate-systems/schedule-task/page.mdx +++ b/www/apps/book/app/learn/customization/integrate-systems/schedule-task/page.mdx @@ -14,7 +14,7 @@ You can create an action to be automatically executed at a specified interval us -Learn more about scheduled jobs in [this chapter](../../../basics/scheduled-jobs/page.mdx). +Learn more about scheduled jobs in [this chapter](../../../fundamentals/scheduled-jobs/page.mdx). @@ -39,7 +39,7 @@ Workflows have a built-in durable execution engine that helps you complete tasks -Learn more about workflows in [this chapter](../../../basics/workflows/page.mdx). +Learn more about workflows in [this chapter](../../../fundamentals/workflows/page.mdx). @@ -134,7 +134,7 @@ The step passes the created brands to the compensation function, which deletes t -Learn more about compensation functions in [this chapter](../../../advanced-development/workflows/compensation-function/page.mdx). +Learn more about compensation functions in [this chapter](../../../fundamentals/workflows/compensation-function/page.mdx). @@ -220,11 +220,11 @@ export const syncBrandsFromSystemWorkflow = createWorkflow( In the workflow, you only use the `retrieveBrandsFromSystemStep` for now, which retrieves the brands from the third-party CMS. -Next, you need to identify which brands must be created or updated. Since workflows are constructed internally and are only evaluated during execution, you can't access values to perform data manipulation directly. Instead, use [transform](../../../advanced-development/workflows/variable-manipulation/page.mdx) from the Workflows SDK that gives you access to the real-time values of the data, allowing you to create new variables using those values. +Next, you need to identify which brands must be created or updated. Since workflows are constructed internally and are only evaluated during execution, you can't access values to perform data manipulation directly. Instead, use [transform](../../../fundamentals/workflows/variable-manipulation/page.mdx) from the Workflows SDK that gives you access to the real-time values of the data, allowing you to create new variables using those values. -Learn more about data manipulation using `transform` in [this chapter](../../../advanced-development/workflows/variable-manipulation/page.mdx). +Learn more about data manipulation using `transform` in [this chapter](../../../fundamentals/workflows/variable-manipulation/page.mdx). @@ -320,7 +320,7 @@ A scheduled job file must export: - `name`: A unique name for the scheduled job. - `schedule`: A string that holds a [cron expression](https://crontab.guru/) indicating the schedule to run the job. -The scheduled job function accepts as a parameter the [Medusa container](../../../basics/medusa-container/page.mdx) used to resolve framework and commerce tools. You then execute the `syncBrandsFromCmsWorkflow` and use its result to log how many brands were created or updated. +The scheduled job function accepts as a parameter the [Medusa container](../../../fundamentals/medusa-container/page.mdx) used to resolve framework and commerce tools. You then execute the `syncBrandsFromCmsWorkflow` and use its result to log how many brands were created or updated. Based on the cron expression specified in `config.schedule`, Medusa will run the scheduled job every day at midnight. You can also change it to `* * * * *` to run it every minute for easier debugging. diff --git a/www/apps/book/app/learn/customization/integrate-systems/service/page.mdx b/www/apps/book/app/learn/customization/integrate-systems/service/page.mdx index daf0fb1121bab..29ee23c0fabf8 100644 --- a/www/apps/book/app/learn/customization/integrate-systems/service/page.mdx +++ b/www/apps/book/app/learn/customization/integrate-systems/service/page.mdx @@ -10,7 +10,7 @@ In the previous chapters, you've created a [Brand Module](../../custom-features/ -Learn more about modules in [this chapter](../../../basics/modules/page.mdx). +Learn more about modules in [this chapter](../../../fundamentals/modules/page.mdx). @@ -66,7 +66,7 @@ export default CmsModuleService You create a `CmsModuleService` that will hold the methods to connect to the third-party CMS. A service's constructor accepts two parameters: -1. The module's container. Since a module is [isolated](../../../advanced-development/modules/isolation/page.mdx), it has a [local container](../../../advanced-development/modules/container/page.mdx) different than the Medusa container you use in other customizations. This container holds framework tools like the [Logger utility](../../../debugging-and-testing/logging/page.mdx) and resources within the module. +1. The module's container. Since a module is [isolated](../../../fundamentals/modules/isolation/page.mdx), it has a [local container](../../../fundamentals/modules/container/page.mdx) different than the Medusa container you use in other customizations. This container holds framework tools like the [Logger utility](../../../debugging-and-testing/logging/page.mdx) and resources within the module. 2. Options passed to the module when it's later added in Medusa's configurations. These options are useful to pass secret keys or configurations that ensure your module is re-usable across applications. For the CMS Module, you accept the API key to connect to the dummy CMS as an option. When integrating a third-party system that has a Node.js SDK or client, you can initialize that client in the constructor to be used in the service's methods. diff --git a/www/apps/book/app/learn/customization/page.mdx b/www/apps/book/app/learn/customization/page.mdx deleted file mode 100644 index 9e794cdcf700b..0000000000000 --- a/www/apps/book/app/learn/customization/page.mdx +++ /dev/null @@ -1,14 +0,0 @@ -export const metadata = { - title: `${pageNumber} Custom Development`, -} - -# {metadata.title} - -In the next chapters, you’ll customize Medusa using the concepts you learned. - -You'll follow an example of building a Brands Module that leads you through: - -1. The main concepts you need to build custom features. -2. How to extend data models that are in the Commerce Modules. -3. How to use your custom features in pages and widgets in the admin dashboard. -4. How to integrate third-party systems into your Medusa application. \ No newline at end of file diff --git a/www/apps/book/app/learn/first-customizations/page.mdx b/www/apps/book/app/learn/first-customizations/page.mdx deleted file mode 100644 index 2eac7314456c5..0000000000000 --- a/www/apps/book/app/learn/first-customizations/page.mdx +++ /dev/null @@ -1,67 +0,0 @@ -export const metadata = { - title: `${pageNumber} Your First Customizations`, -} - -# {metadata.title} - -In this chapter, you’ll build your first customizations with Medusa. - -You'll create a `GET` API route at the path `/hello-world`. An API route exposes your application's commerce features to frontend clients, such as the admin dashboard or a storefront. - -Medusa has [Store](!api!/store) and [Admin](!api!/admin) API routes, and you can create custom API routes for your custom features. - -## 1. Create API Route - -API Routes expose business logic through REST APIs. You can create custom API routes to expose custom business logic. - -To create an API route, create the file `src/api/hello-world/route.ts` with the following content: - -```ts title="src/api/hello-world/route.ts" -import type { - MedusaRequest, - MedusaResponse, -} from "@medusajs/framework/http" - -export const GET = ( - req: MedusaRequest, - res: MedusaResponse -) => { - res.json({ - message: "Hello, world!", - }) -} -``` - ---- - -## 2. Test Customizations - -To test out your customizations: - -1. Start the Medusa application: - -```bash npm2yarn -npm run dev -``` - -2. Send a `GET` request to `/hello-world`: - -```bash -curl http://localhost:9000/hello-world -``` - -In the response, you’ll receive the following object: - -```json -{ - "message": "Hello, world!" -} -``` - ---- - -## Next Steps - -Congratulations, you’ve made your first customization with Medusa! - -You can now start your in-depth learning journey to become an expert. diff --git a/www/apps/book/app/learn/advanced-development/admin/constraints/page.mdx b/www/apps/book/app/learn/fundamentals/admin/constraints/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/admin/constraints/page.mdx rename to www/apps/book/app/learn/fundamentals/admin/constraints/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/admin/page.mdx b/www/apps/book/app/learn/fundamentals/admin/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/admin/page.mdx rename to www/apps/book/app/learn/fundamentals/admin/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/admin/tips/page.mdx b/www/apps/book/app/learn/fundamentals/admin/tips/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/admin/tips/page.mdx rename to www/apps/book/app/learn/fundamentals/admin/tips/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/admin/ui-routes/page.mdx b/www/apps/book/app/learn/fundamentals/admin/ui-routes/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/admin/ui-routes/page.mdx rename to www/apps/book/app/learn/fundamentals/admin/ui-routes/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/admin/widgets/page.mdx b/www/apps/book/app/learn/fundamentals/admin/widgets/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/admin/widgets/page.mdx rename to www/apps/book/app/learn/fundamentals/admin/widgets/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/api-routes/additional-data/page.mdx b/www/apps/book/app/learn/fundamentals/api-routes/additional-data/page.mdx similarity index 98% rename from www/apps/book/app/learn/advanced-development/api-routes/additional-data/page.mdx rename to www/apps/book/app/learn/fundamentals/api-routes/additional-data/page.mdx index e275fe20ae750..86d9c4cf0b651 100644 --- a/www/apps/book/app/learn/advanced-development/api-routes/additional-data/page.mdx +++ b/www/apps/book/app/learn/fundamentals/api-routes/additional-data/page.mdx @@ -130,7 +130,7 @@ The `additional_data` is then passed to hooks in the `createProductsWorkflow` us -Learn about workflow hooks in [this guide](../../workflows/workflow-hooks/page.mdx). +Learn about workflow hooks in [this guide](../../../fundamentals/workflows/workflow-hooks/page.mdx). diff --git a/www/apps/book/app/learn/advanced-development/api-routes/cors/page.mdx b/www/apps/book/app/learn/fundamentals/api-routes/cors/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/api-routes/cors/page.mdx rename to www/apps/book/app/learn/fundamentals/api-routes/cors/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/api-routes/errors/page.mdx b/www/apps/book/app/learn/fundamentals/api-routes/errors/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/api-routes/errors/page.mdx rename to www/apps/book/app/learn/fundamentals/api-routes/errors/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/api-routes/http-methods/page.mdx b/www/apps/book/app/learn/fundamentals/api-routes/http-methods/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/api-routes/http-methods/page.mdx rename to www/apps/book/app/learn/fundamentals/api-routes/http-methods/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/api-routes/middlewares/page.mdx b/www/apps/book/app/learn/fundamentals/api-routes/middlewares/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/api-routes/middlewares/page.mdx rename to www/apps/book/app/learn/fundamentals/api-routes/middlewares/page.mdx diff --git a/www/apps/book/app/learn/basics/api-routes/page.mdx b/www/apps/book/app/learn/fundamentals/api-routes/page.mdx similarity index 100% rename from www/apps/book/app/learn/basics/api-routes/page.mdx rename to www/apps/book/app/learn/fundamentals/api-routes/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/api-routes/parameters/page.mdx b/www/apps/book/app/learn/fundamentals/api-routes/parameters/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/api-routes/parameters/page.mdx rename to www/apps/book/app/learn/fundamentals/api-routes/parameters/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/api-routes/protected-routes/page.mdx b/www/apps/book/app/learn/fundamentals/api-routes/protected-routes/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/api-routes/protected-routes/page.mdx rename to www/apps/book/app/learn/fundamentals/api-routes/protected-routes/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/api-routes/responses/page.mdx b/www/apps/book/app/learn/fundamentals/api-routes/responses/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/api-routes/responses/page.mdx rename to www/apps/book/app/learn/fundamentals/api-routes/responses/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/api-routes/validation/page.mdx b/www/apps/book/app/learn/fundamentals/api-routes/validation/page.mdx similarity index 99% rename from www/apps/book/app/learn/advanced-development/api-routes/validation/page.mdx rename to www/apps/book/app/learn/fundamentals/api-routes/validation/page.mdx index d31df8df1b759..ca6203b2a09c7 100644 --- a/www/apps/book/app/learn/advanced-development/api-routes/validation/page.mdx +++ b/www/apps/book/app/learn/fundamentals/api-routes/validation/page.mdx @@ -208,7 +208,7 @@ export default defineMiddlewares({ The `validateAndTransformQuery` accepts two parameters: - The first one is the Zod schema to validate the query parameters against. -- The second one is an object of options for retrieving data using Query, which you can learn more about in [this chapter](../../module-links/query/page.mdx). +- The second one is an object of options for retrieving data using Query, which you can learn more about in [this chapter](../../../fundamentals/module-links/query/page.mdx). #### How the Validation Works diff --git a/www/apps/book/app/learn/advanced-development/custom-cli-scripts/page.mdx b/www/apps/book/app/learn/fundamentals/custom-cli-scripts/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/custom-cli-scripts/page.mdx rename to www/apps/book/app/learn/fundamentals/custom-cli-scripts/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/custom-cli-scripts/seed-data/page.mdx b/www/apps/book/app/learn/fundamentals/custom-cli-scripts/seed-data/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/custom-cli-scripts/seed-data/page.mdx rename to www/apps/book/app/learn/fundamentals/custom-cli-scripts/seed-data/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/data-models/check-constraints/page.mdx b/www/apps/book/app/learn/fundamentals/data-models/check-constraints/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/data-models/check-constraints/page.mdx rename to www/apps/book/app/learn/fundamentals/data-models/check-constraints/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/data-models/configure-properties/page.mdx b/www/apps/book/app/learn/fundamentals/data-models/configure-properties/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/data-models/configure-properties/page.mdx rename to www/apps/book/app/learn/fundamentals/data-models/configure-properties/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/data-models/default-properties/page.mdx b/www/apps/book/app/learn/fundamentals/data-models/default-properties/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/data-models/default-properties/page.mdx rename to www/apps/book/app/learn/fundamentals/data-models/default-properties/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/data-models/index/page.mdx b/www/apps/book/app/learn/fundamentals/data-models/index/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/data-models/index/page.mdx rename to www/apps/book/app/learn/fundamentals/data-models/index/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/data-models/infer-type/page.mdx b/www/apps/book/app/learn/fundamentals/data-models/infer-type/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/data-models/infer-type/page.mdx rename to www/apps/book/app/learn/fundamentals/data-models/infer-type/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/data-models/manage-relationships/page.mdx b/www/apps/book/app/learn/fundamentals/data-models/manage-relationships/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/data-models/manage-relationships/page.mdx rename to www/apps/book/app/learn/fundamentals/data-models/manage-relationships/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/data-models/page.mdx b/www/apps/book/app/learn/fundamentals/data-models/page.mdx similarity index 57% rename from www/apps/book/app/learn/advanced-development/data-models/page.mdx rename to www/apps/book/app/learn/fundamentals/data-models/page.mdx index 501244bdc6a48..8c7e6a6569ad1 100644 --- a/www/apps/book/app/learn/advanced-development/data-models/page.mdx +++ b/www/apps/book/app/learn/fundamentals/data-models/page.mdx @@ -4,9 +4,9 @@ export const metadata = { # {metadata.title} -In the next chapters, you'll learn more about defining data models. +Data models are created and managed in a module. To learn how to create a data model in a custom module, refer to the [Modules chapter](../modules/page.mdx). -You'll learn about: +In the next chapters, you'll learn about defining data models in more details. You'll learn about: - The different property types available. - How to set a property as a primary key. diff --git a/www/apps/book/app/learn/advanced-development/data-models/primary-key/page.mdx b/www/apps/book/app/learn/fundamentals/data-models/primary-key/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/data-models/primary-key/page.mdx rename to www/apps/book/app/learn/fundamentals/data-models/primary-key/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/data-models/property-types/page.mdx b/www/apps/book/app/learn/fundamentals/data-models/property-types/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/data-models/property-types/page.mdx rename to www/apps/book/app/learn/fundamentals/data-models/property-types/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/data-models/relationships/page.mdx b/www/apps/book/app/learn/fundamentals/data-models/relationships/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/data-models/relationships/page.mdx rename to www/apps/book/app/learn/fundamentals/data-models/relationships/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/data-models/searchable-property/page.mdx b/www/apps/book/app/learn/fundamentals/data-models/searchable-property/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/data-models/searchable-property/page.mdx rename to www/apps/book/app/learn/fundamentals/data-models/searchable-property/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/data-models/write-migration/page.mdx b/www/apps/book/app/learn/fundamentals/data-models/write-migration/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/data-models/write-migration/page.mdx rename to www/apps/book/app/learn/fundamentals/data-models/write-migration/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/environment-variables/page.mdx b/www/apps/book/app/learn/fundamentals/environment-variables/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/environment-variables/page.mdx rename to www/apps/book/app/learn/fundamentals/environment-variables/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/events-and-subscribers/data-payload/page.mdx b/www/apps/book/app/learn/fundamentals/events-and-subscribers/data-payload/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/events-and-subscribers/data-payload/page.mdx rename to www/apps/book/app/learn/fundamentals/events-and-subscribers/data-payload/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/events-and-subscribers/emit-event/page.mdx b/www/apps/book/app/learn/fundamentals/events-and-subscribers/emit-event/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/events-and-subscribers/emit-event/page.mdx rename to www/apps/book/app/learn/fundamentals/events-and-subscribers/emit-event/page.mdx diff --git a/www/apps/book/app/learn/basics/events-and-subscribers/page.mdx b/www/apps/book/app/learn/fundamentals/events-and-subscribers/page.mdx similarity index 92% rename from www/apps/book/app/learn/basics/events-and-subscribers/page.mdx rename to www/apps/book/app/learn/fundamentals/events-and-subscribers/page.mdx index 61e08861a8e71..89457a41d9c3b 100644 --- a/www/apps/book/app/learn/basics/events-and-subscribers/page.mdx +++ b/www/apps/book/app/learn/fundamentals/events-and-subscribers/page.mdx @@ -20,7 +20,7 @@ Subscribers are useful to perform actions that aren't integral to the original f -If the action you're performing is integral to the main flow of the core commerce feature, use [workflow hooks](../../advanced-development/workflows/workflow-hooks/page.mdx) instead. +If the action you're performing is integral to the main flow of the core commerce feature, use [workflow hooks](../workflows/workflow-hooks/page.mdx) instead. @@ -105,4 +105,4 @@ Medusa provides two Event Modules out of the box: - [Local Event Module](!resources!/architectural-modules/event/local), used by default. It's useful for development, as you don't need additional setup to use it. - [Redis Event Module](!resources!/architectural-modules/event/redis), which is useful in production. It uses [Redis](https://redis.io/) to implement Medusa's pub/sub events system. -Medusa's [architecture](../../advanced-development/architecture/overview/page.mdx) also allows you to build a custom Event Module that uses a different service or logic to implement the pub/sub system. Learn how to build an Event Module in [this guide](!resources!/architectural-modules/event/create). +Medusa's [architecture](../../introduction/architecture/page.mdx) also allows you to build a custom Event Module that uses a different service or logic to implement the pub/sub system. Learn how to build an Event Module in [this guide](!resources!/architectural-modules/event/create). diff --git a/www/apps/book/app/learn/basics/medusa-container/page.mdx b/www/apps/book/app/learn/fundamentals/medusa-container/page.mdx similarity index 78% rename from www/apps/book/app/learn/basics/medusa-container/page.mdx rename to www/apps/book/app/learn/fundamentals/medusa-container/page.mdx index e1c883efe2d0a..27828531ac418 100644 --- a/www/apps/book/app/learn/basics/medusa-container/page.mdx +++ b/www/apps/book/app/learn/fundamentals/medusa-container/page.mdx @@ -14,7 +14,7 @@ In other platforms, if you have a resource A (for example, a class) that depends Medusa simplifies this process by giving you access to the container, with the tools or resources already registered, at all times in your customizations. When you reach a point in your code where you need a tool, you resolve it from the container and use it. -For example, consider you're creating an API route that retrieves products based on filters using [Query](../../advanced-development/module-links/query/page.mdx), a tool that fetches data across the application. In the API route's function, you can resolve Query from the container passed to the API route and use it: +For example, consider you're creating an API route that retrieves products based on filters using [Query](../../fundamentals/module-links/query/page.mdx), a tool that fetches data across the application. In the API route's function, you can resolve Query from the container passed to the API route and use it: export const highlights = [ ["8", "resolve", "A method that resolves resources from the container."], @@ -53,7 +53,7 @@ The API route accepts as a first parameter a request object that has a `scope` p -You can learn more about how Query works in [this chapter](../../advanced-development/module-links/query/page.mdx). +You can learn more about how Query works in [this chapter](../../fundamentals/module-links/query/page.mdx). @@ -71,7 +71,7 @@ This section gives quick examples of how to resolve resources from the Medusa co ### Subscriber -A [subscriber](../events-and-subscribers/page.mdx) function, which is executed when an event is emitted, accepts as a parameter an object with a `container` property, whose value is the Medusa container. Use its `resolve` method to resolve a resource by its registration key: +A [subscriber](../../fundamentals/events-and-subscribers/page.mdx) function, which is executed when an event is emitted, accepts as a parameter an object with a `container` property, whose value is the Medusa container. Use its `resolve` method to resolve a resource by its registration key: export const subscriberHighlights = [ ["6", "container", "Receive the Medusa container as a parameter"], @@ -106,7 +106,7 @@ export const config: SubscriberConfig = { ### Scheduled Job -A [scheduled job](../scheduled-jobs/page.mdx) function, which is executed at a specified interval, accepts the Medusa container as a parameter. Use its `resolve` method to resolve a resource by its registration key: +A [scheduled job](../../fundamentals/scheduled-jobs/page.mdx) function, which is executed at a specified interval, accepts the Medusa container as a parameter. Use its `resolve` method to resolve a resource by its registration key: export const scheduledJobHighlights = [ ["5", "container", "Receive the Medusa container as a parameter"], @@ -144,7 +144,7 @@ export const config = { ### Workflow Step -A [step in a workflow](../workflows/page.mdx), which is a special function where you build durable execution logic across multiple modules, accepts in its second parameter a `container` property, whose value is the Medusa container. Use its `resolve` method to resolve a resource by its registration key: +A [step in a workflow](../../fundamentals/workflows/page.mdx), which is a special function where you build durable execution logic across multiple modules, accepts in its second parameter a `container` property, whose value is the Medusa container. Use its `resolve` method to resolve a resource by its registration key: export const workflowStepsHighlight = [ ["7", "container", "Receive the Medusa container as a parameter"], @@ -175,6 +175,6 @@ const step1 = createStep("step-1", async (_, { container }) => { ### Module Services and Loaders -A [module](../modules/page.mdx), which is a package of functionalities for a single feature or domain, has its own container, so it can't resolve resources from the Medusa container. +A [module](../../fundamentals/modules/page.mdx), which is a package of functionalities for a single feature or domain, has its own container, so it can't resolve resources from the Medusa container. -Learn more about the module's container in [this chapter](../../advanced-development/modules/container/page.mdx). +Learn more about the module's container in [this chapter](../../fundamentals/modules/container/page.mdx). diff --git a/www/apps/book/app/learn/advanced-development/module-links/custom-columns/page.mdx b/www/apps/book/app/learn/fundamentals/module-links/custom-columns/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/module-links/custom-columns/page.mdx rename to www/apps/book/app/learn/fundamentals/module-links/custom-columns/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/module-links/directions/page.mdx b/www/apps/book/app/learn/fundamentals/module-links/directions/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/module-links/directions/page.mdx rename to www/apps/book/app/learn/fundamentals/module-links/directions/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/module-links/page.mdx b/www/apps/book/app/learn/fundamentals/module-links/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/module-links/page.mdx rename to www/apps/book/app/learn/fundamentals/module-links/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/module-links/query/page.mdx b/www/apps/book/app/learn/fundamentals/module-links/query/page.mdx similarity index 98% rename from www/apps/book/app/learn/advanced-development/module-links/query/page.mdx rename to www/apps/book/app/learn/fundamentals/module-links/query/page.mdx index 140239e614534..df971ce06e13f 100644 --- a/www/apps/book/app/learn/advanced-development/module-links/query/page.mdx +++ b/www/apps/book/app/learn/fundamentals/module-links/query/page.mdx @@ -288,7 +288,7 @@ The `order` property is an object whose keys are property names, and values are For API routes that retrieve a single or list of resources, Medusa provides a `validateAndTransformQuery` middleware that: -- Validates accepted query parameters, as explained in [this documentation](../../api-routes/validation/page.mdx). +- Validates accepted query parameters, as explained in [this documentation](../../../fundamentals/api-routes/validation/page.mdx). - Parses configurations that are received as query parameters to be passed to Query. Using this middleware allows you to have default configurations for retrieved fields and relations or pagination, while allowing clients to customize them per request. @@ -331,7 +331,7 @@ export default defineMiddlewares({ The `validateAndTransformQuery` accepts two parameters: -1. A Zod validation schema for the query parameters, which you can learn more about in the [API Route Validation documentation](../../api-routes/validation/page.mdx). Medusa has a `createFindParams` utility that generates a Zod schema that accepts four query parameters: +1. A Zod validation schema for the query parameters, which you can learn more about in the [API Route Validation documentation](../../../fundamentals/api-routes/validation/page.mdx). Medusa has a `createFindParams` utility that generates a Zod schema that accepts four query parameters: 1. `fields`: The fields and relations to retrieve in the returned resources. 2. `offset`: The number of items to skip before retrieving the returned items. 3. `limit`: The maximum number of items to return. diff --git a/www/apps/book/app/learn/advanced-development/module-links/remote-link/page.mdx b/www/apps/book/app/learn/fundamentals/module-links/remote-link/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/module-links/remote-link/page.mdx rename to www/apps/book/app/learn/fundamentals/module-links/remote-link/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/architecture/architectural-modules/page.mdx b/www/apps/book/app/learn/fundamentals/modules/architectural-modules/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/architecture/architectural-modules/page.mdx rename to www/apps/book/app/learn/fundamentals/modules/architectural-modules/page.mdx diff --git a/www/apps/book/app/learn/basics/commerce-modules/page.mdx b/www/apps/book/app/learn/fundamentals/modules/commerce-modules/page.mdx similarity index 70% rename from www/apps/book/app/learn/basics/commerce-modules/page.mdx rename to www/apps/book/app/learn/fundamentals/modules/commerce-modules/page.mdx index 4c4922b5d04ec..1862f1514fc84 100644 --- a/www/apps/book/app/learn/basics/commerce-modules/page.mdx +++ b/www/apps/book/app/learn/fundamentals/modules/commerce-modules/page.mdx @@ -8,7 +8,7 @@ In this chapter, you'll learn about Medusa's commerce modules. ## What is a Commerce Module? -Commerce modules are built-in [modules](../modules/page.mdx) of Medusa that provide core commerce logic specific to domains like Products, Orders, Customers, Fulfillment, and much more. +Commerce modules are built-in [modules](../page.mdx) of Medusa that provide core commerce logic specific to domains like Products, Orders, Customers, Fulfillment, and much more. Medusa's commerce modules are used to form Medusa's default [workflows](!resources!/medusa-workflows-reference) and [APIs](!api!/store). For example, when you call the add to cart endpoint. the add to cart workflow runs which uses the Product Module to check if the product exists, the Inventory Module to ensure the product is available in the inventory, and the Cart Module to finally add the product to the cart. @@ -28,9 +28,9 @@ Refer to [this reference](!resources!/commerce-modules) for a full list of comme ## Use Commerce Modules in Custom Flows -Similar to your [custom modules](../modules/page.mdx), the Medusa application registers a commerce module's service in the [container](../medusa-container/page.mdx). So, you can resolve it in your custom flows. This is useful as you build unique requirements extending core commerce features. +Similar to your [custom modules](../page.mdx), the Medusa application registers a commerce module's service in the [container](../../medusa-container/page.mdx). So, you can resolve it in your custom flows. This is useful as you build unique requirements extending core commerce features. -For example, consider you have a [workflow](../workflows/page.mdx) (a special function that performs a task in a series of steps with rollback mechanism) that needs a step to retrieve the total number of products. You can create a step in the workflow that resolves the Product Module's service from the container to use its methods: +For example, consider you have a [workflow](../../../fundamentals/workflows/page.mdx) (a special function that performs a task in a series of steps with rollback mechanism) that needs a step to retrieve the total number of products. You can create a step in the workflow that resolves the Product Module's service from the container to use its methods: export const highlights = [ ["6", `"product"`, "Resolve the Product Module's service from the container."], diff --git a/www/apps/book/app/learn/advanced-development/modules/container/page.mdx b/www/apps/book/app/learn/fundamentals/modules/container/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/modules/container/page.mdx rename to www/apps/book/app/learn/fundamentals/modules/container/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/modules/db-operations/page.mdx b/www/apps/book/app/learn/fundamentals/modules/db-operations/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/modules/db-operations/page.mdx rename to www/apps/book/app/learn/fundamentals/modules/db-operations/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/modules/isolation/page.mdx b/www/apps/book/app/learn/fundamentals/modules/isolation/page.mdx similarity index 94% rename from www/apps/book/app/learn/advanced-development/modules/isolation/page.mdx rename to www/apps/book/app/learn/fundamentals/modules/isolation/page.mdx index 46cc9cfc9fb22..f4601d1792f3d 100644 --- a/www/apps/book/app/learn/advanced-development/modules/isolation/page.mdx +++ b/www/apps/book/app/learn/fundamentals/modules/isolation/page.mdx @@ -9,7 +9,7 @@ In this chapter, you'll learn how modules are isolated, and what that means for - Modules can't access resources, such as services or data models, from other modules. -- Use Medusa's linking concepts, as explained in the [Module Links chapters](../../module-links/page.mdx), to extend a module's data models and retrieve data across modules. +- Use Medusa's linking concepts, as explained in the [Module Links chapters](../../../fundamentals/module-links/page.mdx), to extend a module's data models and retrieve data across modules. @@ -33,7 +33,7 @@ Some of the module isolation's benefits include: ## How to Extend Data Model of Another Module? -To extend the data model of another module, such as the `product` data model of the Product Module, use Medusa's linking concepts as explained in the [Module Links chapters](../../module-links/page.mdx). +To extend the data model of another module, such as the `product` data model of the Product Module, use Medusa's linking concepts as explained in the [Module Links chapters](../../../fundamentals/module-links/page.mdx). --- diff --git a/www/apps/book/app/learn/basics/loaders/page.mdx b/www/apps/book/app/learn/fundamentals/modules/loaders/page.mdx similarity index 90% rename from www/apps/book/app/learn/basics/loaders/page.mdx rename to www/apps/book/app/learn/fundamentals/modules/loaders/page.mdx index a4c060160907f..609ff9862f871 100644 --- a/www/apps/book/app/learn/basics/loaders/page.mdx +++ b/www/apps/book/app/learn/fundamentals/modules/loaders/page.mdx @@ -12,13 +12,13 @@ In this chapter, you’ll learn about loaders and how to use them. When building a commerce application, you'll often need to execute an action the first time the application starts. For example, if your application needs to connect to databases other than Medusa's PostgreSQL database, you might need to establish a connection on application startup. -In Medusa, you can execute an action when the application starts using a loader. A loader is a function exported by a [module](../modules/page.mdx), which is a package of business logic for a single domain. When the Medusa application starts, it executes all loaders exported by configured modules. +In Medusa, you can execute an action when the application starts using a loader. A loader is a function exported by a [module](../page.mdx), which is a package of business logic for a single domain. When the Medusa application starts, it executes all loaders exported by configured modules. -Loaders are useful to register custom resources, such as database connections, in the [module's container](../../advanced-development/modules/container/page.mdx), which is similar to the [Medusa container](../medusa-container/page.mdx) but includes only [resources available to the module](!resources!/medusa-container-resources#module-container-resources). Modules are isolated, so they can't access resources outside of them, such as a service in another module. +Loaders are useful to register custom resources, such as database connections, in the [module's container](../container/page.mdx), which is similar to the [Medusa container](../../medusa-container/page.mdx) but includes only [resources available to the module](!resources!/medusa-container-resources#module-container-resources). Modules are isolated, so they can't access resources outside of them, such as a service in another module. -Medusa isolates modules to ensure that they're re-usable across applications, aren't tightly coupled to other resources, and don't have implications when integrated into the Medusa application. Learn more about why modules are isolated in [this chapter](../../advanced-development/modules/isolation/page.mdx), and check out [this reference for the list of resources in the module's container](!resources!/medusa-container-resources#module-container-resources). +Medusa isolates modules to ensure that they're re-usable across applications, aren't tightly coupled to other resources, and don't have implications when integrated into the Medusa application. Learn more about why modules are isolated in [this chapter](../isolation/page.mdx), and check out [this reference for the list of resources in the module's container](!resources!/medusa-container-resources#module-container-resources). @@ -36,7 +36,7 @@ For example, consider you have a `hello` module, you can create a loader at `src -Learn how to create a module in [this chapter](../modules/page.mdx). +Learn how to create a module in [this chapter](../page.mdx). @@ -84,7 +84,7 @@ The second parameter of the `Module` function accepts a `loaders` property whose ### Test the Loader -Assuming your module is [added to Medusa's configuration](../modules/page.mdx#4-add-module-to-medusas-configurations), you can test the loader by starting the Medusa application: +Assuming your module is [added to Medusa's configuration](../page.mdx#4-add-module-to-medusas-configurations), you can test the loader by starting the Medusa application: ```bash npm2yarn npm run dev diff --git a/www/apps/book/app/learn/basics/modules-directory-structure/page.mdx b/www/apps/book/app/learn/fundamentals/modules/modules-directory-structure/page.mdx similarity index 91% rename from www/apps/book/app/learn/basics/modules-directory-structure/page.mdx rename to www/apps/book/app/learn/fundamentals/modules/modules-directory-structure/page.mdx index 4f89f30a80251..c49a998a5b900 100644 --- a/www/apps/book/app/learn/basics/modules-directory-structure/page.mdx +++ b/www/apps/book/app/learn/fundamentals/modules/modules-directory-structure/page.mdx @@ -10,13 +10,13 @@ In this document, you'll learn about the expected files and directories in your ## index.ts -The `index.ts` file in the root of your module's directory is the only required file. It must export the module's definition as explained in a [previous chapter](../modules/page.mdx). +The `index.ts` file in the root of your module's directory is the only required file. It must export the module's definition as explained in a [previous chapter](../page.mdx). --- ## service.ts -A module must have a main service. It's created in the `service.ts` file at the root of your module directory as explained in a [previous chapter](../modules/page.mdx). +A module must have a main service. It's created in the `service.ts` file at the root of your module directory as explained in a [previous chapter](../page.mdx). --- diff --git a/www/apps/book/app/learn/advanced-development/modules/multiple-services/page.mdx b/www/apps/book/app/learn/fundamentals/modules/multiple-services/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/modules/multiple-services/page.mdx rename to www/apps/book/app/learn/fundamentals/modules/multiple-services/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/modules/options/page.mdx b/www/apps/book/app/learn/fundamentals/modules/options/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/modules/options/page.mdx rename to www/apps/book/app/learn/fundamentals/modules/options/page.mdx diff --git a/www/apps/book/app/learn/basics/modules/page.mdx b/www/apps/book/app/learn/fundamentals/modules/page.mdx similarity index 93% rename from www/apps/book/app/learn/basics/modules/page.mdx rename to www/apps/book/app/learn/fundamentals/modules/page.mdx index 47933135b4fff..2ff7fe97b079d 100644 --- a/www/apps/book/app/learn/basics/modules/page.mdx +++ b/www/apps/book/app/learn/fundamentals/modules/page.mdx @@ -20,7 +20,7 @@ As you learn more about Medusa, you will see that modules are central to customi ## How to Create a Module? -In a module, you define data models that represent new tables in the database, and you manage these models in a class called a service. Then, the Medusa application registers the module's service in the [Medusa container](../medusa-container/page.mdx) so that you can build commerce flows and features around the functionalities provided by the module. +In a module, you define data models that represent new tables in the database, and you manage these models in a class called a service. Then, the Medusa application registers the module's service in the [Medusa container](../../fundamentals/medusa-container/page.mdx) so that you can build commerce flows and features around the functionalities provided by the module. In this section, you'll build a Blog Module that has a `Post` data model and a service to manage that data model, you'll expose an API endpoint to create a blog post. @@ -53,7 +53,7 @@ You define the data model using the `define` method of the `model` utility impor -Learn about other property types in [this chapter](../../advanced-development/data-models/property-types/page.mdx). +Learn about other property types in [this chapter](../../fundamentals/data-models/property-types/page.mdx). @@ -61,7 +61,7 @@ The code snippet above defines a `Post` data model with `id` and `title` propert ### 2. Create Service -You perform database operations on your data models in a service, which is a class exported by the module and acts like an interface to its functionalities. Medusa registers the service in its [container](../medusa-container/page.mdx), allowing you to resolve and use it when building custom commerce flows. +You perform database operations on your data models in a service, which is a class exported by the module and acts like an interface to its functionalities. Medusa registers the service in its [container](../../fundamentals/medusa-container/page.mdx), allowing you to resolve and use it when building custom commerce flows. You define a service in a `service.ts` or `service.js` file at the root of your module's directory. So, to create the Blog Module's service, create the file `src/modules/blog/service.ts` with the following content: @@ -205,11 +205,11 @@ This creates the `post` table in the database. Since the module's main service is registered in the Medusa container, you can resolve it in other customizations to use its methods. -To test out the Blog Module, you'll add the functionality to create a post in a [workflow](../workflows/page.mdx), which is a special function that performs a task in a series of steps with rollback logic. Then, you'll expose an [API route](../api-routes/page.mdx) that creates a blog post by executing the workflow. +To test out the Blog Module, you'll add the functionality to create a post in a [workflow](../../fundamentals/workflows/page.mdx), which is a special function that performs a task in a series of steps with rollback logic. Then, you'll expose an [API route](../api-routes/page.mdx) that creates a blog post by executing the workflow. -By building a commerce feature in a workflow, you can execute it in other customizations while ensuring data consistency across systems. If an error occurs during execution, every step has its own rollback logic to undo its actions. Workflows have other special features which you can learn about in [this chapter](../workflows/page.mdx). +By building a commerce feature in a workflow, you can execute it in other customizations while ensuring data consistency across systems. If an error occurs during execution, every step has its own rollback logic to undo its actions. Workflows have other special features which you can learn about in [this chapter](../../fundamentals/workflows/page.mdx). @@ -326,4 +326,4 @@ This will create a post and return it in the response: } ``` -You can also execute the workflow from a [subscriber](../events-and-subscribers/page.mdx) when an event occurs, or from a [scheduled job](../scheduled-jobs/page.mdx) to run it at a specified interval. +You can also execute the workflow from a [subscriber](../../fundamentals/events-and-subscribers/page.mdx) when an event occurs, or from a [scheduled job](../../fundamentals/scheduled-jobs/page.mdx) to run it at a specified interval. diff --git a/www/apps/book/app/learn/advanced-development/modules/service-constraints/page.mdx b/www/apps/book/app/learn/fundamentals/modules/service-constraints/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/modules/service-constraints/page.mdx rename to www/apps/book/app/learn/fundamentals/modules/service-constraints/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/modules/service-factory/page.mdx b/www/apps/book/app/learn/fundamentals/modules/service-factory/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/modules/service-factory/page.mdx rename to www/apps/book/app/learn/fundamentals/modules/service-factory/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/scheduled-jobs/execution-number/page.mdx b/www/apps/book/app/learn/fundamentals/scheduled-jobs/execution-number/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/scheduled-jobs/execution-number/page.mdx rename to www/apps/book/app/learn/fundamentals/scheduled-jobs/execution-number/page.mdx diff --git a/www/apps/book/app/learn/basics/scheduled-jobs/page.mdx b/www/apps/book/app/learn/fundamentals/scheduled-jobs/page.mdx similarity index 98% rename from www/apps/book/app/learn/basics/scheduled-jobs/page.mdx rename to www/apps/book/app/learn/fundamentals/scheduled-jobs/page.mdx index 21119d5386584..71e80857d0f8a 100644 --- a/www/apps/book/app/learn/basics/scheduled-jobs/page.mdx +++ b/www/apps/book/app/learn/fundamentals/scheduled-jobs/page.mdx @@ -17,7 +17,7 @@ Medusa removes this overhead by supporting this feature natively with scheduled - You want the action to execute at a specified schedule while the Medusa application **isn't** running. Instead, use the operating system's equivalent of a cron job. -- You want to execute the action once when the application loads. Use [loaders](../loaders/page.mdx) instead. +- You want to execute the action once when the application loads. Use [loaders](../modules/loaders/page.mdx) instead. - You want to execute the action if an event occurs. Use [subscribers](../events-and-subscribers/page.mdx) instead. diff --git a/www/apps/book/app/learn/advanced-development/workflows/access-workflow-errors/page.mdx b/www/apps/book/app/learn/fundamentals/workflows/access-workflow-errors/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/workflows/access-workflow-errors/page.mdx rename to www/apps/book/app/learn/fundamentals/workflows/access-workflow-errors/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/workflows/add-workflow-hook/page.mdx b/www/apps/book/app/learn/fundamentals/workflows/add-workflow-hook/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/workflows/add-workflow-hook/page.mdx rename to www/apps/book/app/learn/fundamentals/workflows/add-workflow-hook/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/workflows/compensation-function/page.mdx b/www/apps/book/app/learn/fundamentals/workflows/compensation-function/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/workflows/compensation-function/page.mdx rename to www/apps/book/app/learn/fundamentals/workflows/compensation-function/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/workflows/conditions/page.mdx b/www/apps/book/app/learn/fundamentals/workflows/conditions/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/workflows/conditions/page.mdx rename to www/apps/book/app/learn/fundamentals/workflows/conditions/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/workflows/constructor-constraints/page.mdx b/www/apps/book/app/learn/fundamentals/workflows/constructor-constraints/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/workflows/constructor-constraints/page.mdx rename to www/apps/book/app/learn/fundamentals/workflows/constructor-constraints/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/workflows/execute-another-workflow/page.mdx b/www/apps/book/app/learn/fundamentals/workflows/execute-another-workflow/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/workflows/execute-another-workflow/page.mdx rename to www/apps/book/app/learn/fundamentals/workflows/execute-another-workflow/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/workflows/long-running-workflow/page.mdx b/www/apps/book/app/learn/fundamentals/workflows/long-running-workflow/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/workflows/long-running-workflow/page.mdx rename to www/apps/book/app/learn/fundamentals/workflows/long-running-workflow/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/workflows/multiple-step-usage/page.mdx b/www/apps/book/app/learn/fundamentals/workflows/multiple-step-usage/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/workflows/multiple-step-usage/page.mdx rename to www/apps/book/app/learn/fundamentals/workflows/multiple-step-usage/page.mdx diff --git a/www/apps/book/app/learn/basics/workflows/page.mdx b/www/apps/book/app/learn/fundamentals/workflows/page.mdx similarity index 98% rename from www/apps/book/app/learn/basics/workflows/page.mdx rename to www/apps/book/app/learn/fundamentals/workflows/page.mdx index a551712044070..b22aa309a3c6d 100644 --- a/www/apps/book/app/learn/basics/workflows/page.mdx +++ b/www/apps/book/app/learn/fundamentals/workflows/page.mdx @@ -22,7 +22,7 @@ However, unlike regular functions, workflows: - Support defining roll-back logic for each step, so that you can handle errors gracefully and your data remain consistent across systems. - Perform long actions asynchronously, giving you control over when a step starts and finishes. -You implement all custom flows within workflows, then execute them from [API routes](../api-routes/page.mdx), [subscribers](../events-and-subscribers/page.mdx), and [scheduled jobs](../scheduled-jobs/page.mdx). +You implement all custom flows within workflows, then execute them from [API routes](../api-routes/page.mdx), [subscribers](../../fundamentals/events-and-subscribers/page.mdx), and [scheduled jobs](../../fundamentals/scheduled-jobs/page.mdx). --- diff --git a/www/apps/book/app/learn/advanced-development/workflows/parallel-steps/page.mdx b/www/apps/book/app/learn/fundamentals/workflows/parallel-steps/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/workflows/parallel-steps/page.mdx rename to www/apps/book/app/learn/fundamentals/workflows/parallel-steps/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/workflows/retry-failed-steps/page.mdx b/www/apps/book/app/learn/fundamentals/workflows/retry-failed-steps/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/workflows/retry-failed-steps/page.mdx rename to www/apps/book/app/learn/fundamentals/workflows/retry-failed-steps/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/workflows/variable-manipulation/page.mdx b/www/apps/book/app/learn/fundamentals/workflows/variable-manipulation/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/workflows/variable-manipulation/page.mdx rename to www/apps/book/app/learn/fundamentals/workflows/variable-manipulation/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/workflows/workflow-hooks/page.mdx b/www/apps/book/app/learn/fundamentals/workflows/workflow-hooks/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/workflows/workflow-hooks/page.mdx rename to www/apps/book/app/learn/fundamentals/workflows/workflow-hooks/page.mdx diff --git a/www/apps/book/app/learn/advanced-development/workflows/workflow-timeout/page.mdx b/www/apps/book/app/learn/fundamentals/workflows/workflow-timeout/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/workflows/workflow-timeout/page.mdx rename to www/apps/book/app/learn/fundamentals/workflows/workflow-timeout/page.mdx diff --git a/www/apps/book/app/learn/installation/page.mdx b/www/apps/book/app/learn/installation/page.mdx index 6976ebe1cfbf7..fb0c7c3f21cc3 100644 --- a/www/apps/book/app/learn/installation/page.mdx +++ b/www/apps/book/app/learn/installation/page.mdx @@ -103,6 +103,32 @@ Replace `admin@medusajs.com` and `supersecret` with the user's email and passwor You can then use the user's credentials to log into the Medusa Admin application. +--- + +## Project Files + +Your Medusa application's project will have the following files and directories: + +![A diagram of the directories overview](https://res.cloudinary.com/dza7lstvk/image/upload/v1732803813/Medusa%20Book/medusa-dir-overview_v7ks0j.jpg) + +### src + +This directory is the central place for your custom development. It includes the following sub-directories: + +- `admin`: Holds your admin dashboard's custom [widgets](../fundamentals/admin/widgets/page.mdx) and [UI routes](../fundamentals/admin/ui-routes/page.mdx). +- `api`: Holds your custom [API routes](../fundamentals/api-routes/page.mdx) that are added as endpoints in your Medusa application. +- `jobs`: Holds your [scheduled jobs](../fundamentals/scheduled-jobs/page.mdx) that run at a specified interval during your Medusa application's runtime. +- `links`: Holds you [module links](../fundamentals/module-links/page.mdx) that build associations between data models of different modules. +- `modules`: Holds your custom [modules](../fundamentals/modules/page.mdx) that implement custom business logic. +- `scripts`: Holds your custom [scripts](../fundamentals/custom-cli-scripts/page.mdx) to be executed using Medusa's CLI tool. +- `subscribers`: Holds your [event listeners](../fundamentals/events-and-subscribers/page.mdx) that are executed asynchronously whenever an event is emitted. +- `workflows`: Holds your custom [flows](../fundamentals/workflows/page.mdx) that can be executed from anywhere in your application. + +### medusa-config.ts + +This file holds your [Medusa configurations](!resources!/references/medusa-config), such as your PostgreSQL database configurations. + + --- ## Configure Medusa Application @@ -115,4 +141,4 @@ If you run into issues with configurations, such as CORS configurations, or need ## Next Steps -In the next documentation pages, you'll start customizing your Medusa application, learn about the project's directory structure, and learn about different basic concepts. +In the next chapters, you'll learn about the architecture of your Medusa application, then learn how to customize your application to build custom features. diff --git a/www/apps/book/app/learn/advanced-development/architecture/overview/page.mdx b/www/apps/book/app/learn/introduction/architecture/page.mdx similarity index 100% rename from www/apps/book/app/learn/advanced-development/architecture/overview/page.mdx rename to www/apps/book/app/learn/introduction/architecture/page.mdx diff --git a/www/apps/book/app/learn/more-resources/cheatsheet/page.mdx b/www/apps/book/app/learn/more-resources/cheatsheet/page.mdx deleted file mode 100644 index d269c9d8a52b2..0000000000000 --- a/www/apps/book/app/learn/more-resources/cheatsheet/page.mdx +++ /dev/null @@ -1,160 +0,0 @@ -import { Table } from "docs-ui" - -export const metadata = { - title: `${pageNumber} Cheat sheet`, -} - -# {metadata.title} - -This chapter provides a cheat sheet for Medusa's resources on when to use or not use them. - - - - - Name - Use if - Don't use if - - - - - API Routes - - - - You're exposing custom functionality to be used in the admin dashboard or an external application, such as a storefront. - - - - - \- - - - - - Modules - - - - You're implementing a custom commerce feature. For example, you're implementing digital products. - - You want to extend data models in other commerce modules, such as adding a field or a relation to the Product model. - - You want to re-use your custom commerce functionalities across Medusa applications or use them in other environments, such as Edge functions and Next.js apps. - - - - - \- - - - - - Module Links - - - - You want to create a relation between data models from different modules. - - - - - - You want to create a relationship between data models in the same module. Use data model relationships instead. - - - - - Data Models - - - - You want to store data related to your customization in the database. - - - - - - You want to store simple key-value pairs related to a Medusa data model. Instead, use the `metadata` field that models have, which is an object of custom key-value pairs. - - - - - Data Model Relationships - - - - You want to create a relation between data models in the same module. - - - - - - You want to create a relationship between data models in different modules. Use module links instead. - - - - - Loaders - - - - You're performing an action at application start-up. - - You're establishing a one-time connection with an external system. - - - - - - You want to perform an action continuously or at a set time pattern in the application. Use scheduled jobs instead. - - - - - Subscribers - - - - You want to perform an action everytime a specific event is emitted in the Medusa application. - - - - - \- - - - - - Scheduled Jobs - - - - You're executing an action at a specified time interval during application runtime. - - The action must be executed automatically. - - - - - - You want the action to execute at a specified time interval while the Medusa application **isn't** running. Instead, use the operating system's equivalent of a cron job. - - You want to execute the action once. Use loaders instead. - - You want to execute the action if an event occurs. Use subscribers instead. - - - - - Workflows - - - - You're defining a flow with interactions across multiple systems and services. - - You're defining flows to be used across different resources. For example, if you want to invoke the flow manually through an API Router, but also want to automate its running through a scheduled job. - - You want to define how the series of actions are rolled-back when an error occurs. - - - - - \- - - - - - Middlewares - - - - You want to protect API routes by a custom condition. - - You're modifying the request body. - - - - - \- - - - - -
\ No newline at end of file diff --git a/www/apps/book/components/Homepage/CodeTabs/index.tsx b/www/apps/book/components/Homepage/CodeTabs/index.tsx index e7c00da4cf3e8..375a7e0c7938b 100644 --- a/www/apps/book/components/Homepage/CodeTabs/index.tsx +++ b/www/apps/book/components/Homepage/CodeTabs/index.tsx @@ -24,7 +24,7 @@ const HomepageCodeTabs = () => { "Expose custom features with REST API routes, then consume them from your client applications.", link: { title: "API Routes", - link: "/learn/basics/api-routes", + link: "/learn/fundamentals/api-routes", }, }, code: { @@ -64,7 +64,7 @@ const HomepageCodeTabs = () => { "Build flows as a series of steps, with retry mechanisms and tracking of each steps' status.", link: { title: "Workflows", - link: "/learn/basics/workflows", + link: "/learn/fundamentals/workflows", }, }, code: { @@ -105,7 +105,7 @@ const HomepageCodeTabs = () => { "Create data models that represent tables in the database using Medusa's Data Model Language.", link: { title: "DML", - link: "/learn/basics/modules#1-create-data-model", + link: "/learn/fundamentals/modules#1-create-data-model", }, }, code: { @@ -141,7 +141,7 @@ const HomepageCodeTabs = () => { "Build custom modules with commerce or architectural features and use them in API routes or workflows.", link: { title: "Modules", - link: "/learn/basics/modules", + link: "/learn/fundamentals/modules", }, }, code: { @@ -193,7 +193,7 @@ export async function POST( "Add custom properties to Medusa's data models using module links to build custom use cases.", link: { title: "Module Links", - link: "/learn/advanced-development/module-links", + link: "/learn/fundamentals/module-links", }, }, code: { @@ -223,7 +223,7 @@ export default defineLink( "Handle events emitted by the Medusa application to perform custom actions.", link: { title: "Subscribers", - link: "/learn/basics/events-and-subscribers", + link: "/learn/fundamentals/events-and-subscribers", }, }, code: { @@ -271,8 +271,8 @@ export const config: SubscriberConfig = { content: "Inject widgets into predefined zones in the Medusa Admin, or add new pages.", link: { - title: "Admin Customizations", - link: "/learn/basics/admin-customizations", + title: "Admin Widgets", + link: "/learn/fundamentals/admin/widgets", }, }, code: { diff --git a/www/apps/book/components/Homepage/LinksSection/index.tsx b/www/apps/book/components/Homepage/LinksSection/index.tsx index dc0dce5f561e3..49ef155b88fac 100644 --- a/www/apps/book/components/Homepage/LinksSection/index.tsx +++ b/www/apps/book/components/Homepage/LinksSection/index.tsx @@ -24,11 +24,11 @@ const HomepageLinksSection = () => { title: "Admin Development", links: [ { - href: "/learn/basics/admin-customizations", + href: "/learn/fundamentals/admin/widgets", text: "Build a UI Widget", }, { - href: "/learn/advanced-development/admin/ui-routes", + href: "/learn/fundamentals/admin/ui-routes", text: "Add a UI Route", }, { diff --git a/www/apps/book/generated/edit-dates.mjs b/www/apps/book/generated/edit-dates.mjs index 106bd650c190a..de0b8b671288e 100644 --- a/www/apps/book/generated/edit-dates.mjs +++ b/www/apps/book/generated/edit-dates.mjs @@ -1,121 +1,112 @@ export const generatedEditDates = { - "app/learn/basics/scheduled-jobs/page.mdx": "2024-11-29T07:47:23.809Z", - "app/learn/basics/workflows/page.mdx": "2024-11-29T08:00:47.637Z", + "app/learn/fundamentals/scheduled-jobs/page.mdx": "2024-12-09T10:51:40.570Z", + "app/learn/fundamentals/workflows/page.mdx": "2024-12-09T10:52:19.379Z", "app/learn/deployment/page.mdx": "2024-11-25T14:32:44.949Z", "app/learn/page.mdx": "2024-11-28T14:17:53.023Z", - "app/learn/basics/commerce-modules/page.mdx": "2024-11-28T15:50:01.284Z", - "app/learn/advanced-development/workflows/retry-failed-steps/page.mdx": "2024-09-30T08:43:53.130Z", - "app/learn/advanced-development/workflows/workflow-hooks/page.mdx": "2024-09-30T08:43:53.131Z", - "app/learn/cheatsheet/page.mdx": "2024-07-11T13:53:40+03:00", + "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", "app/learn/debugging-and-testing/logging/page.mdx": "2024-09-30T08:43:53.135Z", "app/learn/more-resources/page.mdx": "2024-07-04T17:26:03+03:00", "app/learn/storefront-development/page.mdx": "2024-09-11T10:58:59.290Z", "app/learn/storefront-development/nextjs-starter/page.mdx": "2024-07-04T17:26:03+03:00", - "app/learn/basics/page.mdx": "2024-09-03T07:11:06.879Z", - "app/learn/basics/admin-customizations/page.mdx": "2024-10-07T12:41:39.218Z", - "app/learn/advanced-development/workflows/workflow-timeout/page.mdx": "2024-09-30T08:43:53.131Z", - "app/learn/advanced-development/workflows/parallel-steps/page.mdx": "2024-09-30T08:43:53.130Z", - "app/learn/advanced-development/page.mdx": "2024-07-04T17:26:03+03:00", - "app/learn/first-customizations/page.mdx": "2024-09-11T10:48:42.374Z", + "app/learn/fundamentals/page.mdx": "2024-07-04T17:26:03+03:00", + "app/learn/fundamentals/admin-customizations/page.mdx": "2024-10-07T12:41:39.218Z", + "app/learn/fundamentals/workflows/workflow-timeout/page.mdx": "2024-10-21T13:30:21.372Z", + "app/learn/fundamentals/workflows/parallel-steps/page.mdx": "2024-10-21T13:30:21.372Z", "app/learn/debugging-and-testing/page.mdx": "2024-05-03T17:36:38+03:00", - "app/learn/basics/medusa-container/page.mdx": "2024-11-28T14:28:30.248Z", - "app/learn/basics/project-directories-files/page.mdx": "2024-11-28T14:27:01.290Z", - "app/learn/basics/api-routes/page.mdx": "2024-11-28T15:44:30.413Z", - "app/learn/basics/modules-directory-structure/page.mdx": "2024-10-03T13:03:35.957Z", - "app/learn/advanced-development/workflows/access-workflow-errors/page.mdx": "2024-09-18T12:54:04.695Z", - "app/learn/basics/events-and-subscribers/page.mdx": "2024-11-29T07:44:23.499Z", - "app/learn/advanced-development/modules/container/page.mdx": "2024-11-21T08:59:18.707Z", - "app/learn/advanced-development/workflows/execute-another-workflow/page.mdx": "2024-09-30T08:43:53.129Z", - "app/learn/basics/loaders/page.mdx": "2024-11-29T07:36:00.800Z", - "app/learn/advanced-development/admin/widgets/page.mdx": "2024-11-29T07:59:37.919Z", - "app/learn/advanced-development/data-models/page.mdx": "2024-09-19T07:26:43.535Z", - "app/learn/advanced-development/modules/remote-link/page.mdx": "2024-09-30T08:43:53.127Z", - "app/learn/advanced-development/api-routes/protected-routes/page.mdx": "2024-09-30T08:43:53.121Z", - "app/learn/advanced-development/workflows/add-workflow-hook/page.mdx": "2024-09-30T08:43:53.128Z", - "app/learn/advanced-development/events-and-subscribers/data-payload/page.mdx": "2024-07-16T17:12:05+01:00", - "app/learn/advanced-development/data-models/default-properties/page.mdx": "2024-09-19T07:32:06.118Z", - "app/learn/advanced-development/workflows/advanced-example/page.mdx": "2024-09-11T10:46:59.975Z", - "app/learn/advanced-development/events-and-subscribers/emit-event/page.mdx": "2024-11-11T15:17:58.045Z", - "app/learn/advanced-development/workflows/conditions/page.mdx": "2024-09-30T08:43:53.128Z", - "app/learn/advanced-development/modules/module-link-directions/page.mdx": "2024-07-24T09:16:01+02:00", - "app/learn/advanced-development/admin/page.mdx": "2024-10-07T12:39:13.178Z", - "app/learn/advanced-development/workflows/long-running-workflow/page.mdx": "2024-09-30T08:43:53.129Z", - "app/learn/advanced-development/workflows/constructor-constraints/page.mdx": "2024-11-14T16:13:19.234Z", - "app/learn/advanced-development/data-models/write-migration/page.mdx": "2024-07-15T17:46:10+02:00", - "app/learn/advanced-development/data-models/manage-relationships/page.mdx": "2024-09-10T11:39:51.167Z", - "app/learn/advanced-development/modules/remote-query/page.mdx": "2024-07-21T21:20:24+02:00", - "app/learn/advanced-development/modules/options/page.mdx": "2024-10-16T08:49:27.162Z", - "app/learn/advanced-development/data-models/relationships/page.mdx": "2024-12-04T10:52:32.992Z", - "app/learn/advanced-development/workflows/compensation-function/page.mdx": "2024-11-28T14:05:29.691Z", - "app/learn/advanced-development/modules/service-factory/page.mdx": "2024-09-30T08:43:53.127Z", - "app/learn/advanced-development/data-models/primary-key/page.mdx": "2024-09-30T08:43:53.123Z", - "app/learn/advanced-development/modules/module-links/page.mdx": "2024-09-30T08:43:53.126Z", - "app/learn/advanced-development/data-models/searchable-property/page.mdx": "2024-09-30T08:43:53.125Z", - "app/learn/advanced-development/scheduled-jobs/execution-number/page.mdx": "2024-07-02T09:41:15+00:00", - "app/learn/advanced-development/api-routes/parameters/page.mdx": "2024-11-12T13:35:09.393Z", - "app/learn/advanced-development/api-routes/http-methods/page.mdx": "2024-09-11T10:43:33.169Z", - "app/learn/advanced-development/admin/tips/page.mdx": "2024-10-07T12:50:36.335Z", - "app/learn/advanced-development/api-routes/cors/page.mdx": "2024-09-30T08:43:53.121Z", - "app/learn/advanced-development/admin/ui-routes/page.mdx": "2024-11-29T08:10:52.377Z", - "app/learn/advanced-development/api-routes/middlewares/page.mdx": "2024-09-11T10:45:31.861Z", - "app/learn/advanced-development/modules/isolation/page.mdx": "2024-07-04T17:26:03+03:00", - "app/learn/advanced-development/data-models/configure-properties/page.mdx": "2024-09-30T08:43:53.122Z", - "app/learn/advanced-development/data-models/index/page.mdx": "2024-09-30T08:43:53.122Z", - "app/learn/advanced-development/custom-cli-scripts/page.mdx": "2024-09-30T08:43:53.122Z", - "app/learn/advanced-development/data-models/property-types/page.mdx": "2024-09-30T08:43:53.124Z", + "app/learn/fundamentals/medusa-container/page.mdx": "2024-12-09T11:02:38.225Z", + "app/learn/fundamentals/api-routes/page.mdx": "2024-12-04T11:02:57.134Z", + "app/learn/fundamentals/modules/modules-directory-structure/page.mdx": "2024-12-09T10:32:46.839Z", + "app/learn/fundamentals/workflows/access-workflow-errors/page.mdx": "2024-10-21T13:30:21.371Z", + "app/learn/fundamentals/events-and-subscribers/page.mdx": "2024-12-09T10:48:09.285Z", + "app/learn/fundamentals/modules/container/page.mdx": "2024-11-21T09:22:27.898Z", + "app/learn/fundamentals/workflows/execute-another-workflow/page.mdx": "2024-10-23T07:08:55.900Z", + "app/learn/fundamentals/modules/loaders/page.mdx": "2024-12-09T10:32:29.221Z", + "app/learn/fundamentals/admin/widgets/page.mdx": "2024-12-04T11:02:57.133Z", + "app/learn/fundamentals/data-models/page.mdx": "2024-12-09T11:34:51.065Z", + "app/learn/fundamentals/modules/remote-link/page.mdx": "2024-09-30T08:43:53.127Z", + "app/learn/fundamentals/api-routes/protected-routes/page.mdx": "2024-11-13T10:44:04.225Z", + "app/learn/fundamentals/workflows/add-workflow-hook/page.mdx": "2024-10-21T13:30:21.371Z", + "app/learn/fundamentals/events-and-subscribers/data-payload/page.mdx": "2024-10-21T13:30:21.369Z", + "app/learn/fundamentals/data-models/default-properties/page.mdx": "2024-10-21T13:30:21.368Z", + "app/learn/fundamentals/workflows/advanced-example/page.mdx": "2024-09-11T10:46:59.975Z", + "app/learn/fundamentals/events-and-subscribers/emit-event/page.mdx": "2024-11-25T16:19:32.168Z", + "app/learn/fundamentals/workflows/conditions/page.mdx": "2024-10-21T13:30:21.371Z", + "app/learn/fundamentals/modules/module-link-directions/page.mdx": "2024-07-24T09:16:01+02:00", + "app/learn/fundamentals/admin/page.mdx": "2024-10-23T07:08:55.898Z", + "app/learn/fundamentals/workflows/long-running-workflow/page.mdx": "2024-12-04T07:37:59.822Z", + "app/learn/fundamentals/workflows/constructor-constraints/page.mdx": "2024-11-25T16:19:32.168Z", + "app/learn/fundamentals/data-models/write-migration/page.mdx": "2024-11-11T15:27:59.794Z", + "app/learn/fundamentals/data-models/manage-relationships/page.mdx": "2024-10-28T04:22:21.328Z", + "app/learn/fundamentals/modules/remote-query/page.mdx": "2024-07-21T21:20:24+02:00", + "app/learn/fundamentals/modules/options/page.mdx": "2024-11-19T16:37:47.253Z", + "app/learn/fundamentals/data-models/relationships/page.mdx": "2024-12-06T14:34:50.384Z", + "app/learn/fundamentals/workflows/compensation-function/page.mdx": "2024-12-06T14:34:50.384Z", + "app/learn/fundamentals/modules/service-factory/page.mdx": "2024-10-21T13:30:21.371Z", + "app/learn/fundamentals/data-models/primary-key/page.mdx": "2024-10-21T13:30:21.368Z", + "app/learn/fundamentals/modules/module-links/page.mdx": "2024-09-30T08:43:53.126Z", + "app/learn/fundamentals/data-models/searchable-property/page.mdx": "2024-10-21T13:30:21.369Z", + "app/learn/fundamentals/scheduled-jobs/execution-number/page.mdx": "2024-10-21T13:30:21.371Z", + "app/learn/fundamentals/api-routes/parameters/page.mdx": "2024-11-19T16:37:47.251Z", + "app/learn/fundamentals/api-routes/http-methods/page.mdx": "2024-10-21T13:30:21.367Z", + "app/learn/fundamentals/admin/tips/page.mdx": "2024-11-19T16:43:01.662Z", + "app/learn/fundamentals/api-routes/cors/page.mdx": "2024-10-21T13:30:21.366Z", + "app/learn/fundamentals/admin/ui-routes/page.mdx": "2024-12-04T11:02:57.133Z", + "app/learn/fundamentals/api-routes/middlewares/page.mdx": "2024-10-21T13:30:21.367Z", + "app/learn/fundamentals/modules/isolation/page.mdx": "2024-12-09T11:02:38.087Z", + "app/learn/fundamentals/data-models/configure-properties/page.mdx": "2024-10-21T13:30:21.368Z", + "app/learn/fundamentals/data-models/index/page.mdx": "2024-10-21T13:30:21.368Z", + "app/learn/fundamentals/custom-cli-scripts/page.mdx": "2024-10-23T07:08:55.898Z", + "app/learn/fundamentals/data-models/property-types/page.mdx": "2024-10-28T04:22:27.540Z", "app/learn/debugging-and-testing/testing-tools/integration-tests/api-routes/page.mdx": "2024-09-30T08:43:53.136Z", "app/learn/debugging-and-testing/testing-tools/integration-tests/page.mdx": "2024-09-10T11:39:51.170Z", "app/learn/debugging-and-testing/testing-tools/integration-tests/workflows/page.mdx": "2024-09-30T08:43:53.139Z", "app/learn/debugging-and-testing/testing-tools/page.mdx": "2024-09-30T08:43:53.139Z", "app/learn/debugging-and-testing/testing-tools/unit-tests/module-example/page.mdx": "2024-09-02T11:04:27.232Z", "app/learn/debugging-and-testing/testing-tools/unit-tests/page.mdx": "2024-09-02T11:03:26.997Z", - "app/learn/advanced-development/modules/service-constraints/page.mdx": "2024-09-30T08:43:53.127Z", - "app/learn/advanced-development/api-routes/page.mdx": "2024-09-04T09:36:33.961Z", - "app/learn/advanced-development/api-routes/responses/page.mdx": "2024-09-11T10:44:37.016Z", - "app/learn/advanced-development/api-routes/validation/page.mdx": "2024-11-12T13:32:32.484Z", - "app/learn/advanced-development/api-routes/errors/page.mdx": "2024-09-30T08:43:53.121Z", - "app/learn/advanced-development/admin/constraints/page.mdx": "2024-09-10T11:39:51.165Z", + "app/learn/fundamentals/modules/service-constraints/page.mdx": "2024-11-19T16:37:47.253Z", + "app/learn/fundamentals/api-routes/responses/page.mdx": "2024-10-21T13:30:21.367Z", + "app/learn/fundamentals/api-routes/validation/page.mdx": "2024-12-09T11:02:38.397Z", + "app/learn/fundamentals/api-routes/errors/page.mdx": "2024-10-21T13:30:21.367Z", + "app/learn/fundamentals/admin/constraints/page.mdx": "2024-10-21T13:30:21.366Z", "app/learn/debugging-and-testing/testing-tools/modules-tests/module-example/page.mdx": "2024-10-16T08:50:03.061Z", "app/learn/debugging-and-testing/testing-tools/modules-tests/page.mdx": "2024-10-16T08:50:23.232Z", - "app/learn/advanced-development/module-links/custom-columns/page.mdx": "2024-11-19T15:05:59.471Z", - "app/learn/advanced-development/module-links/directions/page.mdx": "2024-09-16T15:37:51.441Z", - "app/learn/advanced-development/module-links/page.mdx": "2024-09-16T15:36:48.190Z", - "app/learn/advanced-development/module-links/query/page.mdx": "2024-11-19T15:25:01.149Z", - "app/learn/advanced-development/module-links/remote-link/page.mdx": "2024-09-16T12:42:27.581Z", - "app/learn/advanced-development/modules/db-operations/page.mdx": "2024-09-16T14:38:29.150Z", - "app/learn/advanced-development/modules/multiple-services/page.mdx": "2024-09-16T14:41:32.975Z", - "app/learn/advanced-development/modules/page.mdx": "2024-09-16T14:33:48.217Z", + "app/learn/fundamentals/module-links/custom-columns/page.mdx": "2024-11-20T14:32:09.764Z", + "app/learn/fundamentals/module-links/directions/page.mdx": "2024-10-21T13:30:21.369Z", + "app/learn/fundamentals/module-links/page.mdx": "2024-10-28T04:22:27.541Z", + "app/learn/fundamentals/module-links/query/page.mdx": "2024-12-09T10:38:41.169Z", + "app/learn/fundamentals/module-links/remote-link/page.mdx": "2024-10-28T04:22:21.328Z", + "app/learn/fundamentals/modules/db-operations/page.mdx": "2024-12-04T11:02:57.134Z", + "app/learn/fundamentals/modules/multiple-services/page.mdx": "2024-10-21T13:30:21.370Z", + "app/learn/fundamentals/modules/page.mdx": "2024-12-09T11:02:37.696Z", "app/learn/debugging-and-testing/instrumentation/page.mdx": "2024-09-17T08:53:15.910Z", - "app/learn/advanced-development/api-routes/additional-data/page.mdx": "2024-09-30T08:43:53.120Z", - "app/learn/advanced-development/workflows/page.mdx": "2024-09-18T08:00:57.364Z", - "app/learn/advanced-development/workflows/variable-manipulation/page.mdx": "2024-11-14T16:11:24.538Z", - "app/learn/customization/custom-features/api-route/page.mdx": "2024-11-28T13:12:10.521Z", - "app/learn/customization/custom-features/module/page.mdx": "2024-11-28T09:25:29.098Z", - "app/learn/customization/custom-features/workflow/page.mdx": "2024-12-06T14:34:53.354Z", - "app/learn/customization/extend-features/extend-create-product/page.mdx": "2024-12-05T09:26:15.796Z", - "app/learn/customization/custom-features/page.mdx": "2024-11-28T08:21:55.207Z", - "app/learn/customization/customize-admin/page.mdx": "2024-12-06T07:21:02.303Z", - "app/learn/customization/customize-admin/route/page.mdx": "2024-12-06T08:29:57.834Z", - "app/learn/customization/customize-admin/widget/page.mdx": "2024-12-06T08:15:11.426Z", - "app/learn/customization/extend-features/define-link/page.mdx": "2024-12-04T17:15:16.004Z", - "app/learn/customization/extend-features/page.mdx": "2024-09-12T12:38:57.394Z", - "app/learn/customization/extend-features/query-linked-records/page.mdx": "2024-12-05T10:36:32.357Z", - "app/learn/customization/integrate-systems/handle-event/page.mdx": "2024-12-06T14:34:53.355Z", - "app/learn/customization/integrate-systems/page.mdx": "2024-12-06T14:34:53.355Z", - "app/learn/customization/integrate-systems/schedule-task/page.mdx": "2024-12-06T14:34:53.355Z", - "app/learn/customization/integrate-systems/service/page.mdx": "2024-12-06T14:34:53.356Z", + "app/learn/fundamentals/api-routes/additional-data/page.mdx": "2024-12-09T10:46:28.589Z", + "app/learn/fundamentals/workflows/variable-manipulation/page.mdx": "2024-11-19T16:43:01.663Z", + "app/learn/customization/custom-features/api-route/page.mdx": "2024-12-09T10:39:30.046Z", + "app/learn/customization/custom-features/module/page.mdx": "2024-12-09T11:02:39.826Z", + "app/learn/customization/custom-features/workflow/page.mdx": "2024-12-09T10:46:47.051Z", + "app/learn/customization/extend-features/extend-create-product/page.mdx": "2024-12-09T11:02:39.423Z", + "app/learn/customization/custom-features/page.mdx": "2024-12-09T10:46:28.593Z", + "app/learn/customization/customize-admin/page.mdx": "2024-12-09T11:02:38.801Z", + "app/learn/customization/customize-admin/route/page.mdx": "2024-12-09T11:02:38.969Z", + "app/learn/customization/customize-admin/widget/page.mdx": "2024-12-09T11:02:39.108Z", + "app/learn/customization/extend-features/define-link/page.mdx": "2024-12-09T11:02:39.346Z", + "app/learn/customization/extend-features/page.mdx": "2024-12-09T11:02:39.244Z", + "app/learn/customization/extend-features/query-linked-records/page.mdx": "2024-12-09T11:02:39.519Z", + "app/learn/customization/integrate-systems/handle-event/page.mdx": "2024-12-09T11:02:39.744Z", + "app/learn/customization/integrate-systems/page.mdx": "2024-12-09T10:40:08.528Z", + "app/learn/customization/integrate-systems/schedule-task/page.mdx": "2024-12-09T10:52:19.379Z", + "app/learn/customization/integrate-systems/service/page.mdx": "2024-12-09T11:02:39.594Z", "app/learn/customization/next-steps/page.mdx": "2024-12-06T14:34:53.356Z", - "app/learn/customization/page.mdx": "2024-09-12T11:16:18.504Z", - "app/learn/more-resources/cheatsheet/page.mdx": "2024-07-11T16:11:26.480Z", - "app/learn/architecture/architectural-modules/page.mdx": "2024-09-23T12:51:04.520Z", - "app/learn/architecture/overview/page.mdx": "2024-09-23T12:55:01.339Z", - "app/learn/advanced-development/data-models/infer-type/page.mdx": "2024-09-30T08:43:53.123Z", - "app/learn/advanced-development/custom-cli-scripts/seed-data/page.mdx": "2024-10-03T11:11:07.181Z", - "app/learn/basics/modules/page.mdx": "2024-11-28T15:41:58.354Z", - "app/learn/advanced-development/environment-variables/page.mdx": "2024-10-25T14:59:07.831Z", - "app/learn/build/page.mdx": "2024-11-11T11:08:41.832Z", + "app/learn/fundamentals/modules/architectural-modules/page.mdx": "2024-10-21T13:30:21.367Z", + "app/learn/introduction/architecture/page.mdx": "2024-10-21T13:30:21.368Z", + "app/learn/fundamentals/data-models/infer-type/page.mdx": "2024-10-21T13:30:21.368Z", + "app/learn/fundamentals/custom-cli-scripts/seed-data/page.mdx": "2024-10-21T13:30:21.368Z", + "app/learn/fundamentals/environment-variables/page.mdx": "2024-12-09T11:00:57.428Z", + "app/learn/build/page.mdx": "2024-12-09T11:05:17.383Z", "app/learn/deployment/general/page.mdx": "2024-11-25T14:33:50.439Z", - "app/learn/advanced-development/workflows/multiple-step-usage/page.mdx": "2024-11-12T11:11:49.191Z", - "app/learn/installation/page.mdx": "2024-11-28T14:18:21.905Z", - "app/learn/advanced-development/data-models/check-constraints/page.mdx": "2024-12-04T10:39:01.764Z" + "app/learn/fundamentals/workflows/multiple-step-usage/page.mdx": "2024-11-25T16:19:32.169Z", + "app/learn/installation/page.mdx": "2024-12-09T11:22:27.919Z", + "app/learn/fundamentals/data-models/check-constraints/page.mdx": "2024-12-06T14:34:50.384Z" } \ No newline at end of file diff --git a/www/apps/book/next.config.mjs b/www/apps/book/next.config.mjs index aa49639579e80..a91473df28eda 100644 --- a/www/apps/book/next.config.mjs +++ b/www/apps/book/next.config.mjs @@ -10,6 +10,7 @@ import { } from "remark-rehype-plugins" import { sidebar } from "./sidebar.mjs" import path from "path" +import redirects from "./utils/redirects.mjs" const withMDX = mdx({ extension: /\.mdx?$/, @@ -165,41 +166,7 @@ const nextConfig = { ], } }, - async redirects() { - return [ - { - source: "/v2/:path*", - destination: "/:path*", - permanent: true, - }, - { - source: "/recipes/:path*", - destination: "/resources/recipes", - permanent: true, - }, - { - source: "/plugins/:path*", - destination: "/v1/plugins/:path*", - permanent: true, - }, - { - source: "/medusa-react/:path*", - destination: "/v1/medusa-react/:path*", - permanent: true, - }, - { - source: "/learn/customization/extend-models/:path*", - destination: "/learn/customization/extend-features/:path*", - permanent: true, - }, - { - source: "/learn/customization/extend-features/create-links", - destination: - "/learn/customization/extend-features/extend-create-product", - permanent: true, - }, - ] - }, + redirects, } export default withMDX(nextConfig) diff --git a/www/apps/book/sidebar.mjs b/www/apps/book/sidebar.mjs index b764aa8f2d628..e188f3a7eef54 100644 --- a/www/apps/book/sidebar.mjs +++ b/www/apps/book/sidebar.mjs @@ -16,80 +16,14 @@ export const sidebar = numberSidebarItems( }, { type: "link", - path: "/learn/first-customizations", - title: "Your First Customizations", - chapterTitle: "First Customization", - }, - ], - }, - { - type: "link", - path: "/learn/basics", - title: "The Basics", - chapterTitle: "Basics", - children: [ - { - type: "link", - path: "/learn/basics/project-directories-files", - title: "Project Conventions", - }, - { - type: "link", - path: "/learn/basics/medusa-container", - title: "Medusa Container", - }, - { - type: "link", - path: "/learn/basics/modules", - title: "Modules", - }, - { - type: "link", - path: "/learn/basics/api-routes", - title: "API Routes", - }, - { - type: "link", - path: "/learn/basics/commerce-modules", - title: "Commerce Modules", - }, - { - type: "link", - path: "/learn/basics/modules-directory-structure", - title: "Modules Directory Structure", - }, - { - type: "link", - path: "/learn/basics/loaders", - title: "Loaders", - }, - { - type: "link", - path: "/learn/basics/events-and-subscribers", - title: "Events and Subscribers", - }, - { - type: "link", - path: "/learn/basics/scheduled-jobs", - title: "Scheduled Jobs", - }, - { - type: "link", - path: "/learn/basics/workflows", - title: "Workflows", - }, - { - type: "link", - path: "/learn/basics/admin-customizations", - title: "Admin Customizations", + title: "Architecture", + path: "/learn/introduction/architecture", }, ], }, { - type: "link", - path: "/learn/customization", - title: "Custom Development", - chapterTitle: "Customization", + type: "category", + title: "Customize", children: [ { type: "link", @@ -182,348 +116,361 @@ export const sidebar = numberSidebarItems( ], }, { - type: "link", - path: "/learn/advanced-development", - title: "Advanced Development", - chapterTitle: "Advanced", + type: "category", + title: "Fundamentals", children: [ { type: "link", - title: "Architecture", - path: "/learn/advanced-development/architecture/overview", - children: [ - { - type: "link", - path: "/learn/advanced-development/architecture/architectural-modules", - title: "Architectural Modules", - }, - ], + path: "/learn/fundamentals/medusa-container", + title: "Medusa Container", }, { type: "link", - title: "API Routes", - path: "/learn/advanced-development/api-routes", + path: "/learn/fundamentals/modules", + title: "Modules", children: [ { type: "link", - path: "/learn/advanced-development/api-routes/http-methods", - title: "HTTP Methods", + path: "/learn/fundamentals/modules/modules-directory-structure", + title: "Modules Directory Structure", }, { type: "link", - path: "/learn/advanced-development/api-routes/parameters", - title: "Parameters", + path: "/learn/fundamentals/modules/loaders", + title: "Loaders", }, { type: "link", - path: "/learn/advanced-development/api-routes/responses", - title: "Response", - }, - { - type: "link", - path: "/learn/advanced-development/api-routes/middlewares", - title: "Middlewares", - }, - { - type: "link", - path: "/learn/advanced-development/api-routes/validation", - title: "Validation", - }, - { - type: "link", - path: "/learn/advanced-development/api-routes/protected-routes", - title: "Protected Routes", - }, - { - type: "link", - path: "/learn/advanced-development/api-routes/errors", - title: "Errors", - }, - { - type: "link", - path: "/learn/advanced-development/api-routes/cors", - title: "Handling CORS", - }, - { - type: "link", - path: "/learn/advanced-development/api-routes/additional-data", - title: "Additional Data", - }, - ], - }, - { - type: "link", - path: "/learn/advanced-development/modules", - title: "Modules", - children: [ - { - type: "link", - path: "/learn/advanced-development/modules/isolation", + path: "/learn/fundamentals/modules/isolation", title: "Module Isolation", }, { type: "link", - path: "/learn/advanced-development/modules/container", + path: "/learn/fundamentals/modules/container", title: "Module Container", }, { type: "link", - path: "/learn/advanced-development/modules/options", + path: "/learn/fundamentals/modules/options", title: "Module Options", }, { type: "link", - path: "/learn/advanced-development/modules/service-factory", + path: "/learn/fundamentals/modules/service-factory", title: "Service Factory", }, { type: "link", - path: "/learn/advanced-development/modules/service-constraints", + path: "/learn/fundamentals/modules/service-constraints", title: "Service Constraints", }, { type: "link", - path: "/learn/advanced-development/modules/db-operations", + path: "/learn/fundamentals/modules/db-operations", title: "Database Operations", }, { type: "link", - path: "/learn/advanced-development/modules/multiple-services", + path: "/learn/fundamentals/modules/multiple-services", title: "Multiple Services", }, + { + type: "link", + path: "/learn/fundamentals/modules/commerce-modules", + title: "Commerce Modules", + }, + { + type: "link", + path: "/learn/fundamentals/modules/architectural-modules", + title: "Architectural Modules", + }, ], }, { type: "link", - path: "/learn/advanced-development/module-links", + path: "/learn/fundamentals/module-links", title: "Module Links", children: [ { type: "link", - path: "/learn/advanced-development/module-links/directions", + path: "/learn/fundamentals/module-links/directions", title: "Module Link Direction", }, { type: "link", - path: "/learn/advanced-development/module-links/remote-link", + path: "/learn/fundamentals/module-links/remote-link", title: "Remote Link", }, { type: "link", - path: "/learn/advanced-development/module-links/query", + path: "/learn/fundamentals/module-links/query", title: "Query", }, { type: "link", - path: "/learn/advanced-development/module-links/custom-columns", + path: "/learn/fundamentals/module-links/custom-columns", title: "Custom Columns", }, ], }, { type: "link", - path: "/learn/advanced-development/data-models", + path: "/learn/fundamentals/data-models", title: "Data Models", children: [ { type: "link", - path: "/learn/advanced-development/data-models/infer-type", + path: "/learn/fundamentals/data-models/infer-type", title: "Infer Type", }, { type: "link", - path: "/learn/advanced-development/data-models/property-types", + path: "/learn/fundamentals/data-models/property-types", title: "Property Types", }, { type: "link", - path: "/learn/advanced-development/data-models/primary-key", + path: "/learn/fundamentals/data-models/primary-key", title: "Primary Key", }, { type: "link", - path: "/learn/advanced-development/data-models/default-properties", + path: "/learn/fundamentals/data-models/default-properties", title: "Default Properties", }, { type: "link", - path: "/learn/advanced-development/data-models/configure-properties", + path: "/learn/fundamentals/data-models/configure-properties", title: "Configure Properties", }, { type: "link", - path: "/learn/advanced-development/data-models/relationships", + path: "/learn/fundamentals/data-models/relationships", title: "Relationships", }, { type: "link", - path: "/learn/advanced-development/data-models/manage-relationships", + path: "/learn/fundamentals/data-models/manage-relationships", title: "Manage Relationships", }, { type: "link", - path: "/learn/advanced-development/data-models/index", + path: "/learn/fundamentals/data-models/index", title: "Define Index", }, { type: "link", - path: "/learn/advanced-development/data-models/check-constraints", + path: "/learn/fundamentals/data-models/check-constraints", title: "Check Constraints", }, { type: "link", - path: "/learn/advanced-development/data-models/searchable-property", + path: "/learn/fundamentals/data-models/searchable-property", title: "Searchable Property", }, { type: "link", - path: "/learn/advanced-development/data-models/write-migration", + path: "/learn/fundamentals/data-models/write-migration", title: "Write Migration", }, ], }, { - type: "sub-category", - title: "Events and Subscribers", + type: "link", + title: "API Routes", + path: "/learn/fundamentals/api-routes", children: [ { type: "link", - path: "/learn/advanced-development/events-and-subscribers/data-payload", - title: "Events Data Payload", + path: "/learn/fundamentals/api-routes/http-methods", + title: "HTTP Methods", }, { type: "link", - path: "/learn/advanced-development/events-and-subscribers/emit-event", - title: "Emit Event", + path: "/learn/fundamentals/api-routes/parameters", + title: "Parameters", }, - ], - }, - { - type: "sub-category", - title: "Scheduled Jobs", - children: [ { type: "link", - path: "/learn/advanced-development/scheduled-jobs/execution-number", - title: "Execution Number", + path: "/learn/fundamentals/api-routes/responses", + title: "Response", + }, + { + type: "link", + path: "/learn/fundamentals/api-routes/middlewares", + title: "Middlewares", + }, + { + type: "link", + path: "/learn/fundamentals/api-routes/validation", + title: "Validation", + }, + { + type: "link", + path: "/learn/fundamentals/api-routes/protected-routes", + title: "Protected Routes", + }, + { + type: "link", + path: "/learn/fundamentals/api-routes/errors", + title: "Errors", + }, + { + type: "link", + path: "/learn/fundamentals/api-routes/cors", + title: "Handling CORS", + }, + { + type: "link", + path: "/learn/fundamentals/api-routes/additional-data", + title: "Additional Data", }, ], }, { type: "link", - path: "/learn/advanced-development/workflows", + path: "/learn/fundamentals/workflows", title: "Workflows", children: [ { type: "link", - path: "/learn/advanced-development/workflows/variable-manipulation", + path: "/learn/fundamentals/workflows/variable-manipulation", title: "Transform Variables", }, { type: "link", - path: "/learn/advanced-development/workflows/conditions", + path: "/learn/fundamentals/workflows/conditions", title: "When-Then Conditions", }, { type: "link", - path: "/learn/advanced-development/workflows/constructor-constraints", + path: "/learn/fundamentals/workflows/constructor-constraints", title: "Constructor Constraints", }, { type: "link", - path: "/learn/advanced-development/workflows/compensation-function", + path: "/learn/fundamentals/workflows/compensation-function", title: "Compensation Function", }, { type: "link", - path: "/learn/advanced-development/workflows/workflow-hooks", + path: "/learn/fundamentals/workflows/workflow-hooks", title: "Workflow Hooks", }, { type: "link", - path: "/learn/advanced-development/workflows/add-workflow-hook", + path: "/learn/fundamentals/workflows/add-workflow-hook", title: "Expose a Hook", }, { type: "link", - path: "/learn/advanced-development/workflows/access-workflow-errors", + path: "/learn/fundamentals/workflows/access-workflow-errors", title: "Access Workflow Errors", }, { type: "link", - path: "/learn/advanced-development/workflows/retry-failed-steps", + path: "/learn/fundamentals/workflows/retry-failed-steps", title: "Retry Failed Steps", }, { type: "link", - path: "/learn/advanced-development/workflows/parallel-steps", + path: "/learn/fundamentals/workflows/parallel-steps", title: "Run Steps in Parallel", }, { type: "link", - path: "/learn/advanced-development/workflows/workflow-timeout", + path: "/learn/fundamentals/workflows/workflow-timeout", title: "Workflow Timeout", }, { type: "link", - path: "/learn/advanced-development/workflows/long-running-workflow", + path: "/learn/fundamentals/workflows/long-running-workflow", title: "Long-Running Workflow", }, { type: "link", - path: "/learn/advanced-development/workflows/execute-another-workflow", + path: "/learn/fundamentals/workflows/execute-another-workflow", title: "Execute Another Workflow", }, { type: "link", - path: "/learn/advanced-development/workflows/multiple-step-usage", + path: "/learn/fundamentals/workflows/multiple-step-usage", title: "Multiple Step Usage", }, ], }, { type: "link", - path: "/learn/advanced-development/custom-cli-scripts", - title: "Custom CLI Scripts", + path: "/learn/fundamentals/events-and-subscribers", + title: "Events and Subscribers", children: [ { type: "link", - path: "/learn/advanced-development/custom-cli-scripts/seed-data", - title: "Seed Data", + path: "/learn/fundamentals/events-and-subscribers/data-payload", + title: "Events Data Payload", + }, + { + type: "link", + path: "/learn/fundamentals/events-and-subscribers/emit-event", + title: "Emit Event", + }, + ], + }, + { + type: "link", + path: "/learn/fundamentals/scheduled-jobs", + title: "Scheduled Jobs", + children: [ + { + type: "link", + path: "/learn/fundamentals/scheduled-jobs/execution-number", + title: "Execution Number", }, ], }, { type: "link", - path: "/learn/advanced-development/admin", + path: "/learn/fundamentals/admin", title: "Admin Development", children: [ { type: "link", - path: "/learn/advanced-development/admin/widgets", + path: "/learn/fundamentals/admin/widgets", title: "Admin Widgets", }, { type: "link", - path: "/learn/advanced-development/admin/ui-routes", + path: "/learn/fundamentals/admin/ui-routes", title: "Admin UI Routes", }, { type: "link", - path: "/learn/advanced-development/admin/constraints", + path: "/learn/fundamentals/admin/constraints", title: "Constraints", }, { type: "link", - path: "/learn/advanced-development/admin/tips", + path: "/learn/fundamentals/admin/tips", title: "Tips", }, ], }, + { + type: "link", + path: "/learn/fundamentals/custom-cli-scripts", + title: "Custom CLI Scripts", + children: [ + { + type: "link", + path: "/learn/fundamentals/custom-cli-scripts/seed-data", + title: "Seed Data", + }, + ], + }, { type: "link", title: "Environment Variables", - path: "/learn/advanced-development/environment-variables", + path: "/learn/fundamentals/environment-variables", }, ], }, @@ -614,13 +561,6 @@ export const sidebar = numberSidebarItems( type: "link", path: "/learn/more-resources", title: "More Resources", - children: [ - { - type: "link", - path: "/learn/more-resources/cheatsheet", - title: "Cheat Sheet", - }, - ], }, ]) ) diff --git a/www/apps/book/utils/number-sidebar-items.mjs b/www/apps/book/utils/number-sidebar-items.mjs index e341e09387a7e..d6e5b4aab1697 100644 --- a/www/apps/book/utils/number-sidebar-items.mjs +++ b/www/apps/book/utils/number-sidebar-items.mjs @@ -16,6 +16,7 @@ export default function numberSidebarItems(sidebarItems, numbering = [1]) { sidebarItems.forEach((item, index) => { if (item.type === "separator") { ;(parentItem?.children || numberedItems).push(item) + return } // append current number to the item's title @@ -27,13 +28,17 @@ export default function numberSidebarItems(sidebarItems, numbering = [1]) { if (isTopItems) { // Add chapter category - numberedItems.push({ - type: "category", - title: item.chapterTitle, - children: [], - loaded: true, - initialOpen: false, - }) + numberedItems.push( + item.type === "category" + ? item + : { + type: "category", + title: item.chapterTitle, + children: [], + loaded: true, + initialOpen: false, + } + ) parentItem = numberedItems[numberedItems.length - 1] } @@ -42,19 +47,12 @@ export default function numberSidebarItems(sidebarItems, numbering = [1]) { item.children = numberSidebarItems(item.children, [...numbering, 1]) } - ;(parentItem?.children || numberedItems).push(item) + if (item.type !== "category" || !isTopItems) { + ;(parentItem?.children || numberedItems).push(item) + } numbering[numbering.length - 1]++ }) return numberedItems } - -function padNumber(number) { - number = number.toString() - if (number.length < 2) { - number = `0` + number - } - - return number -} diff --git a/www/apps/book/utils/redirects.mjs b/www/apps/book/utils/redirects.mjs new file mode 100644 index 0000000000000..53416e6c68897 --- /dev/null +++ b/www/apps/book/utils/redirects.mjs @@ -0,0 +1,109 @@ +/** + * @returns {Promise} + */ +const redirects = async () => { + return [ + { + source: "/v2/:path*", + destination: "/:path*", + permanent: true, + }, + { + source: "/recipes/:path*", + destination: "/resources/recipes", + permanent: true, + }, + { + source: "/plugins/:path*", + destination: "/v1/plugins/:path*", + permanent: true, + }, + { + source: "/medusa-react/:path*", + destination: "/v1/medusa-react/:path*", + permanent: true, + }, + { + source: "/learn/customization/extend-models/:path*", + destination: "/learn/customization/extend-features/:path*", + permanent: true, + }, + { + source: "/learn/advanced-development/architecture/overview", + destination: "/learn/introduction/architecture", + permanent: true, + }, + { + source: "/learn/first-customizations", + destination: "/learn/customization", + permanent: true, + }, + { + source: "/learn/basics/medusa-container", + destination: "/learn/fundamentals/medusa-container", + permanent: true, + }, + { + source: "/learn/basics/modules", + destination: "/learn/fundamentals/modules", + permanent: true, + }, + { + source: "/learn/basics/modules-directory-structure", + destination: "/learn/fundamentals/modules/modules-directory-structure", + permanent: true, + }, + { + source: "/learn/basics/loaders", + destination: "/learn/fundamentals/modules/loaders", + permanent: true, + }, + { + source: "/learn/basics/commerce-modules", + destination: "/learn/fundamentals/modules/commerce-modules", + permanent: true, + }, + { + source: "/learn/advanced-development/architecture/architectural-modules", + destination: "/learn/fundamentals/modules/architectural-modules", + permanent: true, + }, + { + source: "/learn/basics/api-routes", + destination: "/learn/fundamentals/api-routes", + permanent: true, + }, + { + source: "/learn/basics/workflows", + destination: "/learn/fundamentals/workflows", + permanent: true, + }, + { + source: "/learn/basics/events-and-subscribers", + destination: "/learn/fundamentals/events-and-subscribers", + permanent: true, + }, + { + source: "/learn/basics/scheduled-jobs", + destination: "/learn/fundamentals/scheduled-jobs", + permanent: true, + }, + { + source: "/learn/basics/project-directories-files", + destination: "/learn/installation#project-files", + permanent: true, + }, + { + source: "/learn/basics/admin-customizations", + destination: "/learn/fundamentals/admin/widgets", + permanent: true, + }, + { + source: "/learn/advanced-development/:path*", + destination: "/learn/fundamentals/:path*", + permanent: true, + }, + ] +} + +export default redirects diff --git a/www/apps/resources/app/admin-components/components/forms/page.mdx b/www/apps/resources/app/admin-components/components/forms/page.mdx index 64a24647a5b89..7689ba6ba01a3 100644 --- a/www/apps/resources/app/admin-components/components/forms/page.mdx +++ b/www/apps/resources/app/admin-components/components/forms/page.mdx @@ -175,7 +175,7 @@ You create the `CreateForm` component. For now, it uses `useForm` from `react-ho You also define a `handleSubmit` function to perform an action when the form is submitted. -You can replace the content of the function with sending a request to Medusa's routes. Refer to [this guide](!docs!/learn/advanced-development/admin/tips#send-requests-to-api-routes) for more details on how to do that. +You can replace the content of the function with sending a request to Medusa's routes. Refer to [this guide](!docs!/learn/fundamentals/admin/tips#send-requests-to-api-routes) for more details on how to do that. ### Render Components @@ -454,7 +454,7 @@ You create the `EditForm` component. For now, it uses `useForm` from `react-hook You also define a `handleSubmit` function to perform an action when the form is submitted. -You can replace the content of the function with sending a request to Medusa's routes. Refer to [this guide](!docs!/learn/advanced-development/admin/tips#send-requests-to-api-routes) for more details on how to do that. +You can replace the content of the function with sending a request to Medusa's routes. Refer to [this guide](!docs!/learn/fundamentals/admin/tips#send-requests-to-api-routes) for more details on how to do that. ### Render Components diff --git a/www/apps/resources/app/commerce-modules/auth/create-actor-type/page.mdx b/www/apps/resources/app/commerce-modules/auth/create-actor-type/page.mdx index 2642c3d55fb11..978e51adebd4a 100644 --- a/www/apps/resources/app/commerce-modules/auth/create-actor-type/page.mdx +++ b/www/apps/resources/app/commerce-modules/auth/create-actor-type/page.mdx @@ -12,7 +12,7 @@ Before creating an actor type, you must have a module with a data model represen -Learn how to create a module in [this guide](!docs!/learn/basics/modules). +Learn how to create a module in [this guide](!docs!/learn/fundamentals/modules). diff --git a/www/apps/resources/app/commerce-modules/cart/extend/page.mdx b/www/apps/resources/app/commerce-modules/cart/extend/page.mdx index d9ccafc782795..4f1e117252cc3 100644 --- a/www/apps/resources/app/commerce-modules/cart/extend/page.mdx +++ b/www/apps/resources/app/commerce-modules/cart/extend/page.mdx @@ -22,7 +22,7 @@ Consider you have a Hello Module defined in the `/src/modules/hello` directory. -If you don't have a module, follow [this guide](!docs!/learn/basics/modules) to create one. +If you don't have a module, follow [this guide](!docs!/learn/fundamentals/modules) to create one. @@ -43,7 +43,7 @@ This creates a `Custom` data model that has the `id` and `custom_name` propertie -Learn more about data models in [this guide](!docs!/learn/basics/modules#1-create-data-model). +Learn more about data models in [this guide](!docs!/learn/fundamentals/modules#1-create-data-model). @@ -55,7 +55,7 @@ Next, you'll define a module link between the `Custom` and `Cart` data model. A -Learn more about module links in [this guide](!docs!/learn/advanced-development/module-links). +Learn more about module links in [this guide](!docs!/learn/fundamentals/module-links). @@ -82,7 +82,7 @@ This defines a link between the `Cart` and `Custom` data models. Using this link items={[ { text: "Module must be registered in medusa-config.ts", - link: "!docs!/learn/basics/modules#4-add-module-to-configurations" + link: "!docs!/learn/fundamentals/modules#4-add-module-to-configurations" } ]} /> @@ -115,7 +115,7 @@ To do that, you'll consume the [cartCreated](/references/medusa-workflows/create -Learn more about workflow hooks in [this guide](!docs!/learn/advanced-development/workflows/workflow-hooks). +Learn more about workflow hooks in [this guide](!docs!/learn/fundamentals/workflows/workflow-hooks). @@ -150,7 +150,7 @@ In the snippet above, you add a validation rule indicating that `custom_name` is -Learn more about additional data validation in [this guide](!docs!/learn/advanced-development/api-routes/additional-data). +Learn more about additional data validation in [this guide](!docs!/learn/fundamentals/api-routes/additional-data). @@ -202,7 +202,7 @@ In the compensation function that undoes the step's actions in case of an error, -Learn more about compensation functions in [this guide](!docs!/learn/advanced-development/workflows/compensation-function). +Learn more about compensation functions in [this guide](!docs!/learn/fundamentals/workflows/compensation-function). @@ -260,9 +260,9 @@ The workflow accepts as an input the created cart and the `additional_data` para In the workflow, you: -1. Use the `transform` utility to get the value of `custom_name` based on whether it's set in `additional_data`. Learn more about why you can't use conditional operators in a workflow without using `transform` in [this guide](!docs!/learn/advanced-development/workflows/conditions#why-if-conditions-arent-allowed-in-workflows). +1. Use the `transform` utility to get the value of `custom_name` based on whether it's set in `additional_data`. Learn more about why you can't use conditional operators in a workflow without using `transform` in [this guide](!docs!/learn/fundamentals/workflows/conditions#why-if-conditions-arent-allowed-in-workflows). 2. Create the `Custom` record using the `createCustomStep`. -3. Use the `when-then` utility to link the cart to the `Custom` record if it was created. Learn more about why you can't use if-then conditions in a workflow without using `when-then` in [this guide](!docs!/learn/advanced-development/workflows/conditions#why-if-conditions-arent-allowed-in-workflows). +3. Use the `when-then` utility to link the cart to the `Custom` record if it was created. Learn more about why you can't use if-then conditions in a workflow without using `when-then` in [this guide](!docs!/learn/fundamentals/workflows/conditions#why-if-conditions-arent-allowed-in-workflows). You'll next call the workflow in the hook handler. @@ -355,7 +355,7 @@ Among the returned `cart` object, you'll find a `custom` property which holds th ### Retrieve using Query -You can also retrieve the `Custom` record linked to a cart in your code using [Query](!docs!/learn/advanced-development/module-links/query). +You can also retrieve the `Custom` record linked to a cart in your code using [Query](!docs!/learn/fundamentals/module-links/query). For example: @@ -369,7 +369,7 @@ const { data: [cart] } = await query.graph({ }) ``` -Learn more about how to use Query in [this guide](!docs!/learn/advanced-development/module-links/query). +Learn more about how to use Query in [this guide](!docs!/learn/fundamentals/module-links/query). --- diff --git a/www/apps/resources/app/commerce-modules/customer/extend/page.mdx b/www/apps/resources/app/commerce-modules/customer/extend/page.mdx index 352c3882100b9..d94fdb6ee5202 100644 --- a/www/apps/resources/app/commerce-modules/customer/extend/page.mdx +++ b/www/apps/resources/app/commerce-modules/customer/extend/page.mdx @@ -28,7 +28,7 @@ Consider you have a Hello Module defined in the `/src/modules/hello` directory. -If you don't have a module, follow [this guide](!docs!/learn/basics/modules) to create one. +If you don't have a module, follow [this guide](!docs!/learn/fundamentals/modules) to create one. @@ -49,7 +49,7 @@ This creates a `Custom` data model that has the `id` and `custom_name` propertie -Learn more about data models in [this guide](!docs!/learn/basics/modules#1-create-data-model). +Learn more about data models in [this guide](!docs!/learn/fundamentals/modules#1-create-data-model). @@ -61,7 +61,7 @@ Next, you'll define a module link between the `Custom` and `Customer` data model -Learn more about module links in [this guide](!docs!/learn/advanced-development/module-links). +Learn more about module links in [this guide](!docs!/learn/fundamentals/module-links). @@ -88,7 +88,7 @@ This defines a link between the `Customer` and `Custom` data models. Using this items={[ { text: "Module must be registered in medusa-config.ts", - link: "!docs!/learn/basics/modules#4-add-module-to-configurations" + link: "!docs!/learn/fundamentals/modules#4-add-module-to-configurations" } ]} /> @@ -121,7 +121,7 @@ To do that, you'll consume the [customersCreated](/resources/references/medusa-w -Learn more about workflow hooks in [this guide](!docs!/learn/advanced-development/workflows/workflow-hooks). +Learn more about workflow hooks in [this guide](!docs!/learn/fundamentals/workflows/workflow-hooks). @@ -156,7 +156,7 @@ In the snippet above, you add a validation rule indicating that `custom_name` is -Learn more about additional data validation in [this guide](!docs!/learn/advanced-development/api-routes/additional-data). +Learn more about additional data validation in [this guide](!docs!/learn/fundamentals/api-routes/additional-data). @@ -208,7 +208,7 @@ In the compensation function that undoes the step's actions in case of an error, -Learn more about compensation functions in [this guide](!docs!/learn/advanced-development/workflows/compensation-function). +Learn more about compensation functions in [this guide](!docs!/learn/fundamentals/workflows/compensation-function). @@ -266,9 +266,9 @@ The workflow accepts as an input the created customer and the `additional_data` In the workflow, you: -1. Use the `transform` utility to get the value of `custom_name` based on whether it's set in `additional_data`. Learn more about why you can't use conditional operators in a workflow without using `transform` in [this guide](!docs!/learn/advanced-development/workflows/conditions#why-if-conditions-arent-allowed-in-workflows). +1. Use the `transform` utility to get the value of `custom_name` based on whether it's set in `additional_data`. Learn more about why you can't use conditional operators in a workflow without using `transform` in [this guide](!docs!/learn/fundamentals/workflows/conditions#why-if-conditions-arent-allowed-in-workflows). 2. Create the `Custom` record using the `createCustomStep`. -3. Use the `when-then` utility to link the customer to the `Custom` record if it was created. Learn more about why you can't use if-then conditions in a workflow without using `when-then` in [this guide](!docs!/learn/advanced-development/workflows/conditions#why-if-conditions-arent-allowed-in-workflows). +3. Use the `when-then` utility to link the customer to the `Custom` record if it was created. Learn more about why you can't use if-then conditions in a workflow without using `when-then` in [this guide](!docs!/learn/fundamentals/workflows/conditions#why-if-conditions-arent-allowed-in-workflows). You'll next execute the workflow in the hook handler. @@ -367,7 +367,7 @@ Among the returned `customer` object, you'll find a `custom` property which hold ### Retrieve using Query -You can also retrieve the `Custom` record linked to a customer in your code using [Query](!docs!/learn/advanced-development/module-links/query). +You can also retrieve the `Custom` record linked to a customer in your code using [Query](!docs!/learn/fundamentals/module-links/query). For example: @@ -381,7 +381,7 @@ const { data: [customer] } = await query.graph({ }) ``` -Learn more about how to use Query in [this guide](!docs!/learn/advanced-development/module-links/query). +Learn more about how to use Query in [this guide](!docs!/learn/fundamentals/module-links/query). --- diff --git a/www/apps/resources/app/commerce-modules/payment/payment-flow/page.mdx b/www/apps/resources/app/commerce-modules/payment/payment-flow/page.mdx index 10742536de320..68d6c460d8d40 100644 --- a/www/apps/resources/app/commerce-modules/payment/payment-flow/page.mdx +++ b/www/apps/resources/app/commerce-modules/payment/payment-flow/page.mdx @@ -66,7 +66,7 @@ remoteLink.create({ -Learn more about the remote link in [this documentation](!docs!/learn/advanced-development/module-links/remote-link). +Learn more about the remote link in [this documentation](!docs!/learn/fundamentals/module-links/remote-link). diff --git a/www/apps/resources/app/commerce-modules/product/extend/page.mdx b/www/apps/resources/app/commerce-modules/product/extend/page.mdx index decd74503559e..ba9c52021d4d0 100644 --- a/www/apps/resources/app/commerce-modules/product/extend/page.mdx +++ b/www/apps/resources/app/commerce-modules/product/extend/page.mdx @@ -28,7 +28,7 @@ Consider you have a Hello Module defined in the `/src/modules/hello` directory. -If you don't have a module, follow [this guide](!docs!/learn/basics/modules) to create one. +If you don't have a module, follow [this guide](!docs!/learn/fundamentals/modules) to create one. @@ -49,7 +49,7 @@ This creates a `Custom` data model that has the `id` and `custom_name` propertie -Learn more about data models in [this guide](!docs!/learn/basics/modules#1-create-data-model). +Learn more about data models in [this guide](!docs!/learn/fundamentals/modules#1-create-data-model). @@ -61,7 +61,7 @@ Next, you'll define a module link between the `Custom` and `Product` data model. -Learn more about module links in [this guide](!docs!/learn/advanced-development/module-links). +Learn more about module links in [this guide](!docs!/learn/fundamentals/module-links). @@ -88,7 +88,7 @@ This defines a link between the `Product` and `Custom` data models. Using this l items={[ { text: "Module must be registered in medusa-config.js", - link: "!docs!/learn/basics/modules#4-add-module-to-configurations" + link: "!docs!/learn/fundamentals/modules#4-add-module-to-configurations" } ]} /> @@ -121,7 +121,7 @@ To do that, you'll consume the [productsCreated](/references/medusa-workflows/cr -Learn more about workflow hooks in [this guide](!docs!/learn/advanced-development/workflows/workflow-hooks). +Learn more about workflow hooks in [this guide](!docs!/learn/fundamentals/workflows/workflow-hooks). @@ -156,7 +156,7 @@ In the snippet above, you add a validation rule indicating that `custom_name` is -Learn more about additional data validation in [this guide](!docs!/learn/advanced-development/api-routes/additional-data). +Learn more about additional data validation in [this guide](!docs!/learn/fundamentals/api-routes/additional-data). @@ -208,7 +208,7 @@ In the compensation function that undoes the step's actions in case of an error, -Learn more about compensation functions in [this guide](!docs!/learn/advanced-development/workflows/compensation-function). +Learn more about compensation functions in [this guide](!docs!/learn/fundamentals/workflows/compensation-function). @@ -266,9 +266,9 @@ The workflow accepts as an input the created product and the `additional_data` p In the workflow, you: -1. Use the `transform` utility to get the value of `custom_name` based on whether it's set in `additional_data`. Learn more about why you can't use conditional operators in a workflow without using `transform` in [this guide](!docs!/learn/advanced-development/workflows/conditions#why-if-conditions-arent-allowed-in-workflows). +1. Use the `transform` utility to get the value of `custom_name` based on whether it's set in `additional_data`. Learn more about why you can't use conditional operators in a workflow without using `transform` in [this guide](!docs!/learn/fundamentals/workflows/conditions#why-if-conditions-arent-allowed-in-workflows). 2. Create the `Custom` record using the `createCustomStep`. -3. Use the `when-then` utility to link the product to the `Custom` record if it was created. Learn more about why you can't use if-then conditions in a workflow without using `when-then` in [this guide](!docs!/learn/advanced-development/workflows/conditions#why-if-conditions-arent-allowed-in-workflows). +3. Use the `when-then` utility to link the product to the `Custom` record if it was created. Learn more about why you can't use if-then conditions in a workflow without using `when-then` in [this guide](!docs!/learn/fundamentals/workflows/conditions#why-if-conditions-arent-allowed-in-workflows). You'll next execute the workflow in the hook handler. @@ -373,7 +373,7 @@ Among the returned `product` object, you'll find a `custom` property which holds ### Retrieve using Query -You can also retrieve the `Custom` record linked to a product in your code using [Query](!docs!/learn/advanced-development/module-links/query). +You can also retrieve the `Custom` record linked to a product in your code using [Query](!docs!/learn/fundamentals/module-links/query). For example: @@ -387,7 +387,7 @@ const { data: [product] } = await query.graph({ }) ``` -Learn more about how to use Query in [this guide](!docs!/learn/advanced-development/module-links/query). +Learn more about how to use Query in [this guide](!docs!/learn/fundamentals/module-links/query). --- diff --git a/www/apps/resources/app/commerce-modules/product/guides/price-with-taxes/page.mdx b/www/apps/resources/app/commerce-modules/product/guides/price-with-taxes/page.mdx index 60c2d9701613d..f22897512be5c 100644 --- a/www/apps/resources/app/commerce-modules/product/guides/price-with-taxes/page.mdx +++ b/www/apps/resources/app/commerce-modules/product/guides/price-with-taxes/page.mdx @@ -14,7 +14,7 @@ In this document, you'll learn how to calculate a product variant's price with t You'll need the following resources for the taxes calculation: -1. [Query](!docs!/learn/advanced-development/module-links/query) to retrieve the product's variants' prices for a context. Learn more about that in [this guide](../price/page.mdx). +1. [Query](!docs!/learn/fundamentals/module-links/query) to retrieve the product's variants' prices for a context. Learn more about that in [this guide](../price/page.mdx). 2. The Tax Module's main service to get the tax lines for each product. ```ts diff --git a/www/apps/resources/app/commerce-modules/product/guides/price/page.mdx b/www/apps/resources/app/commerce-modules/product/guides/price/page.mdx index 78e2a80bf7fb5..b154b233685c6 100644 --- a/www/apps/resources/app/commerce-modules/product/guides/price/page.mdx +++ b/www/apps/resources/app/commerce-modules/product/guides/price/page.mdx @@ -8,7 +8,7 @@ export const metadata = { # {metadata.title} -In this document, you'll learn how to retrieve product variant prices in the Medusa application using [Query](!docs!/learn/advanced-development/module-links/query). +In this document, you'll learn how to retrieve product variant prices in the Medusa application using [Query](!docs!/learn/fundamentals/module-links/query). diff --git a/www/apps/resources/app/commerce-modules/promotion/extend/page.mdx b/www/apps/resources/app/commerce-modules/promotion/extend/page.mdx index cb7e5f4b00324..0486882101ef6 100644 --- a/www/apps/resources/app/commerce-modules/promotion/extend/page.mdx +++ b/www/apps/resources/app/commerce-modules/promotion/extend/page.mdx @@ -28,7 +28,7 @@ Consider you have a Hello Module defined in the `/src/modules/hello` directory. -If you don't have a module, follow [this guide](!docs!/learn/basics/modules) to create one. +If you don't have a module, follow [this guide](!docs!/learn/fundamentals/modules) to create one. @@ -49,7 +49,7 @@ This creates a `Custom` data model that has the `id` and `custom_name` propertie -Learn more about data models in [this guide](!docs!/learn/basics/modules#1-create-data-model). +Learn more about data models in [this guide](!docs!/learn/fundamentals/modules#1-create-data-model). @@ -61,7 +61,7 @@ Next, you'll define a module link between the `Custom` and `Promotion` data mode -Learn more about module links in [this guide](!docs!/learn/advanced-development/module-links). +Learn more about module links in [this guide](!docs!/learn/fundamentals/module-links). @@ -88,7 +88,7 @@ This defines a link between the `Promotion` and `Custom` data models. Using this items={[ { text: "Module must be registered in medusa-config.js", - link: "!docs!/learn/basics/modules#4-add-module-to-configurations" + link: "!docs!/learn/fundamentals/modules#4-add-module-to-configurations" } ]} /> @@ -121,7 +121,7 @@ To do that, you'll consume the [promotionsCreated](/references/medusa-workflows/ -Learn more about workflow hooks in [this guide](!docs!/learn/advanced-development/workflows/workflow-hooks). +Learn more about workflow hooks in [this guide](!docs!/learn/fundamentals/workflows/workflow-hooks). @@ -156,7 +156,7 @@ In the snippet above, you add a validation rule indicating that `custom_name` is -Learn more about additional data validation in [this guide](!docs!/learn/advanced-development/api-routes/additional-data). +Learn more about additional data validation in [this guide](!docs!/learn/fundamentals/api-routes/additional-data). @@ -208,7 +208,7 @@ In the compensation function that undoes the step's actions in case of an error, -Learn more about compensation functions in [this guide](!docs!/learn/advanced-development/workflows/compensation-function). +Learn more about compensation functions in [this guide](!docs!/learn/fundamentals/workflows/compensation-function). @@ -266,9 +266,9 @@ The workflow accepts as an input the created promotion and the `additional_data` In the workflow, you: -1. Use the `transform` utility to get the value of `custom_name` based on whether it's set in `additional_data`. Learn more about why you can't use conditional operators in a workflow without using `transform` in [this guide](!docs!/learn/advanced-development/workflows/conditions#why-if-conditions-arent-allowed-in-workflows). +1. Use the `transform` utility to get the value of `custom_name` based on whether it's set in `additional_data`. Learn more about why you can't use conditional operators in a workflow without using `transform` in [this guide](!docs!/learn/fundamentals/workflows/conditions#why-if-conditions-arent-allowed-in-workflows). 2. Create the `Custom` record using the `createCustomStep`. -3. Use the `when-then` utility to link the promotion to the `Custom` record if it was created. Learn more about why you can't use if-then conditions in a workflow without using `when-then` in [this guide](!docs!/learn/advanced-development/workflows/conditions#why-if-conditions-arent-allowed-in-workflows). +3. Use the `when-then` utility to link the promotion to the `Custom` record if it was created. Learn more about why you can't use if-then conditions in a workflow without using `when-then` in [this guide](!docs!/learn/fundamentals/workflows/conditions#why-if-conditions-arent-allowed-in-workflows). You'll next execute the workflow in the hook handler. @@ -379,7 +379,7 @@ Among the returned `promotion` object, you'll find a `custom` property which hol ### Retrieve using Query -You can also retrieve the `Custom` record linked to a promotion in your code using [Query](!docs!/learn/advanced-development/module-links/query). +You can also retrieve the `Custom` record linked to a promotion in your code using [Query](!docs!/learn/fundamentals/module-links/query). For example: @@ -393,7 +393,7 @@ const { data: [promotion] } = await query.graph({ }) ``` -Learn more about how to use Query in [this guide](!docs!/learn/advanced-development/module-links/query). +Learn more about how to use Query in [this guide](!docs!/learn/fundamentals/module-links/query). --- diff --git a/www/apps/resources/app/examples/page.mdx b/www/apps/resources/app/examples/page.mdx index d82e19ff17db6..3c5d490524daa 100644 --- a/www/apps/resources/app/examples/page.mdx +++ b/www/apps/resources/app/examples/page.mdx @@ -36,7 +36,7 @@ export const GET = ( This creates a `GET` API route at `/hello-world`. -Learn more in [this documentation](!docs!/learn/basics/api-routes). +Learn more in [this documentation](!docs!/learn/fundamentals/api-routes). ### Resolve Resources in API Route @@ -65,7 +65,7 @@ export const GET = async ( This resolves the Product Module's main service. -Learn more in [this documentation](!docs!/learn/basics/medusa-container). +Learn more in [this documentation](!docs!/learn/fundamentals/medusa-container). ### Use Path Parameters @@ -93,7 +93,7 @@ export const GET = async ( } ``` -Learn more about path parameters in [this documentation](!docs!/learn/advanced-development/api-routes/parameters#path-parameters). +Learn more about path parameters in [this documentation](!docs!/learn/fundamentals/api-routes/parameters#path-parameters). ### Use Query Parameters @@ -119,7 +119,7 @@ export const GET = async ( } ``` -Learn more about query parameters in [this documentation](!docs!/learn/advanced-development/api-routes/parameters#query-parameters). +Learn more about query parameters in [this documentation](!docs!/learn/fundamentals/api-routes/parameters#query-parameters). ### Use Body Parameters @@ -150,7 +150,7 @@ export const POST = async ( } ``` -Learn more about request body parameters in [this documentation](!docs!/learn/advanced-development/api-routes/parameters#request-body-parameters). +Learn more about request body parameters in [this documentation](!docs!/learn/fundamentals/api-routes/parameters#request-body-parameters). ### Set Response Code @@ -169,7 +169,7 @@ export const GET = async ( } ``` -Learn more about setting the response code in [this documentation](!docs!/learn/advanced-development/api-routes/responses#set-response-status-code). +Learn more about setting the response code in [this documentation](!docs!/learn/fundamentals/api-routes/responses#set-response-status-code). ### Execute a Workflow in an API Route @@ -197,7 +197,7 @@ export async function GET( } ``` -Learn more in [this documentation](!docs!/learn/basics/workflows#3-execute-the-workflow). +Learn more in [this documentation](!docs!/learn/fundamentals/workflows#3-execute-the-workflow). ### Change Response Content Type @@ -235,7 +235,7 @@ export const GET = async ( This changes the response type to return an event stream. -Learn more in [this documentation](!docs!/learn/advanced-development/api-routes/responses#change-response-content-type). +Learn more in [this documentation](!docs!/learn/fundamentals/api-routes/responses#change-response-content-type). ### Create Middleware @@ -285,7 +285,7 @@ export default defineMiddlewares({ }) ``` -Learn more about middlewares in [this documentation](!docs!/learn/advanced-development/api-routes/middlewares). +Learn more about middlewares in [this documentation](!docs!/learn/fundamentals/api-routes/middlewares). ### Restrict HTTP Methods in Middleware @@ -370,7 +370,7 @@ export const POST = async ( } ``` -Learn more about request body validation in [this documentation](!docs!/learn/advanced-development/api-routes/validation). +Learn more about request body validation in [this documentation](!docs!/learn/fundamentals/api-routes/validation). ### Pass Additional Data to API Route @@ -403,7 +403,7 @@ export default defineMiddlewares({ -Learn more about additional data in [this documentation](!docs!/learn/advanced-development/api-routes/additional-data). +Learn more about additional data in [this documentation](!docs!/learn/fundamentals/api-routes/additional-data). @@ -430,7 +430,7 @@ createProductsWorkflow.hooks.productsCreated( -Learn more about workflow hooks in [this documentation](!docs!/learn/advanced-development/workflows/workflow-hooks). +Learn more about workflow hooks in [this documentation](!docs!/learn/fundamentals/workflows/workflow-hooks). @@ -461,7 +461,7 @@ export default defineMiddlewares({ }) ``` -Learn more in [this documentation](!docs!/learn/advanced-development/api-routes/protected-routes). +Learn more in [this documentation](!docs!/learn/fundamentals/api-routes/protected-routes). ### Restrict an API Route to Logged-In Customers @@ -487,7 +487,7 @@ export default defineMiddlewares({ }) ``` -Learn more in [this documentation](!docs!/learn/advanced-development/api-routes/protected-routes). +Learn more in [this documentation](!docs!/learn/fundamentals/api-routes/protected-routes). ### Retrieve Logged-In Admin User @@ -522,7 +522,7 @@ export const GET = async ( } ``` -Learn more in [this documentation](!docs!/learn/advanced-development/api-routes/protected-routes#retrieve-logged-in-admin-users-details). +Learn more in [this documentation](!docs!/learn/fundamentals/api-routes/protected-routes#retrieve-logged-in-admin-users-details). ### Retrieve Logged-In Customer @@ -560,7 +560,7 @@ export const GET = async ( } ``` -Learn more in [this documentation](!docs!/learn/advanced-development/api-routes/protected-routes#retrieve-logged-in-customers-details). +Learn more in [this documentation](!docs!/learn/fundamentals/api-routes/protected-routes#retrieve-logged-in-customers-details). ### Throw Errors in API Route @@ -585,7 +585,7 @@ export const GET = async ( } ``` -Learn more in [this documentation](!docs!/learn/advanced-development/api-routes/errors). +Learn more in [this documentation](!docs!/learn/fundamentals/api-routes/errors). ### Override Error Handler of API Routes @@ -614,7 +614,7 @@ export default defineMiddlewares({ }) ``` -Learn more in [this documentation](!docs!/learn/advanced-development/api-routes/errors#override-error-handler), +Learn more in [this documentation](!docs!/learn/fundamentals/api-routes/errors#override-error-handler), ### Setting up CORS for Custom API Routes @@ -707,7 +707,7 @@ A module is a package of reusable commerce or architectural functionalities. The -Find this example explained in details in [this documentation](!docs!/learn/basics/modules). +Find this example explained in details in [this documentation](!docs!/learn/fundamentals/modules). @@ -843,7 +843,7 @@ class HelloModuleService extends MedusaService({ export default HelloModuleService ``` -Learn more in [this documentation](!docs!/learn/advanced-development/modules/multiple-services). +Learn more in [this documentation](!docs!/learn/fundamentals/modules/multiple-services). ### Accept Module Options @@ -895,7 +895,7 @@ export default class HelloModuleService extends MedusaService({ } ``` -Learn more in [this documentation](!docs!/learn/advanced-development/modules/options). +Learn more in [this documentation](!docs!/learn/fundamentals/modules/options). ### Integrate Third-Party System in Module @@ -974,7 +974,7 @@ npx medusa db:generate helloModuleService npx medusa db:migrate ``` -Learn more in [this documentation](!docs!/learn/basics/modules#1-create-data-model). +Learn more in [this documentation](!docs!/learn/fundamentals/modules#1-create-data-model). ### Data Model Property Types @@ -1061,7 +1061,7 @@ const MyCustom = model.define("my_custom", { }) ``` -Learn more in [this documentation](!docs!/learn/advanced-development/data-models/property-types). +Learn more in [this documentation](!docs!/learn/fundamentals/data-models/property-types). ### Set Primary Key @@ -1104,7 +1104,7 @@ const MyCustom = model.define("my_custom", { export default MyCustom ``` -Learn more in [this documentation](!docs!/learn/advanced-development/data-models/primary-key). +Learn more in [this documentation](!docs!/learn/fundamentals/data-models/primary-key). ### Default Property Value @@ -1126,7 +1126,7 @@ const MyCustom = model.define("my_custom", { export default MyCustom ``` -Learn more in [this documentation](!docs!/learn/advanced-development/data-models/configure-properties). +Learn more in [this documentation](!docs!/learn/fundamentals/data-models/configure-properties). ### Nullable Property @@ -1143,7 +1143,7 @@ const MyCustom = model.define("my_custom", { export default MyCustom ``` -Learn more in [this documentation](!docs!/learn/advanced-development/data-models/configure-properties#nullable-property). +Learn more in [this documentation](!docs!/learn/fundamentals/data-models/configure-properties#nullable-property). ### Unique Property @@ -1160,7 +1160,7 @@ const User = model.define("user", { export default User ``` -Learn more in [this documentation](!docs!/learn/advanced-development/data-models/configure-properties#unique-property). +Learn more in [this documentation](!docs!/learn/fundamentals/data-models/configure-properties#unique-property). ### Define Database Index on Property @@ -1179,7 +1179,7 @@ const MyCustom = model.define("my_custom", { export default MyCustom ``` -Learn more in [this documentation](!docs!/learn/advanced-development/data-models/index#define-database-index-on-property). +Learn more in [this documentation](!docs!/learn/fundamentals/data-models/index#define-database-index-on-property). ### Define Composite Index on Data Model @@ -1206,7 +1206,7 @@ const MyCustom = model.define("my_custom", { export default MyCustom ``` -Learn more in [this documentation](!docs!/learn/advanced-development/data-models/index#define-database-index-on-data-model). +Learn more in [this documentation](!docs!/learn/fundamentals/data-models/index#define-database-index-on-data-model). ### Make a Property Searchable @@ -1237,7 +1237,7 @@ const myCustoms = await helloModuleService.listMyCustoms({ }) ``` -Learn more in [this documentation](!docs!/learn/advanced-development/data-models/searchable-property). +Learn more in [this documentation](!docs!/learn/fundamentals/data-models/searchable-property). ### Create One-to-One Relationship @@ -1259,7 +1259,7 @@ const Email = model.define("email", { }) ``` -Learn more in [this documentation](!docs!/learn/advanced-development/data-models/relationships#one-to-one-relationship). +Learn more in [this documentation](!docs!/learn/fundamentals/data-models/relationships#one-to-one-relationship). ### Create One-to-Many Relationship @@ -1281,7 +1281,7 @@ const Product = model.define("product", { }) ``` -Learn more in [this documentation](!docs!/learn/advanced-development/data-models/relationships#one-to-many-relationship). +Learn more in [this documentation](!docs!/learn/fundamentals/data-models/relationships#one-to-many-relationship). ### Create Many-to-Many Relationship @@ -1305,7 +1305,7 @@ const Product = model.define("product", { }) ``` -Learn more in [this documentation](!docs!/learn/advanced-development/data-models/relationships#many-to-many-relationship). +Learn more in [this documentation](!docs!/learn/fundamentals/data-models/relationships#many-to-many-relationship). ### Configure Cascades of Data Model @@ -1326,7 +1326,7 @@ const Store = model.define("store", { This configures the delete cascade on the `Store` data model so that, when a store is delete, its products are also deleted. -Learn more in [this documentation](!docs!/learn/advanced-development/data-models/relationships#cascades). +Learn more in [this documentation](!docs!/learn/fundamentals/data-models/relationships#cascades). ### Manage One-to-One Relationship @@ -1373,7 +1373,7 @@ const user = await helloModuleService.updateUsers({ }) ``` -Learn more in [this documentation](!docs!/learn/advanced-development/data-models/manage-relationships#manage-one-to-one-relationship). +Learn more in [this documentation](!docs!/learn/fundamentals/data-models/manage-relationships#manage-one-to-one-relationship). ### Manage One-to-Many Relationship @@ -1402,7 +1402,7 @@ const product = await helloModuleService.updateProducts({ }) ``` -Learn more in [this documentation](!docs!/learn/advanced-development/data-models/manage-relationships#manage-one-to-many-relationship) +Learn more in [this documentation](!docs!/learn/fundamentals/data-models/manage-relationships#manage-one-to-many-relationship) ### Manage Many-to-Many Relationship @@ -1443,7 +1443,7 @@ const updatedProduct = await helloModuleService.updateProducts({ }) ``` -Learn more in [this documentation](!docs!/learn/advanced-development/data-models/manage-relationships#manage-many-to-many-relationship). +Learn more in [this documentation](!docs!/learn/fundamentals/data-models/manage-relationships#manage-many-to-many-relationship). ### Retrieve Related Records @@ -1464,7 +1464,7 @@ const product = await helloModuleService.retrieveProducts( ) ``` -Learn more in [this documentation](!docs!/learn/advanced-development/data-models/manage-relationships#retrieve-records-of-relation). +Learn more in [this documentation](!docs!/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation). --- @@ -1495,7 +1495,7 @@ The `HelloModuleService` will now have data-management methods for `MyCustom`. Refer to [this reference](../service-factory-reference/page.mdx) for details on the generated methods. -Learn more about the service factory in [this documentation](!docs!/learn/advanced-development/modules/service-factory). +Learn more about the service factory in [this documentation](!docs!/learn/fundamentals/modules/service-factory). ### Resolve Resources in the Service @@ -1557,7 +1557,7 @@ export default class HelloModuleService { -Learn more in [this documentation](!docs!/learn/advanced-development/modules/container). +Learn more in [this documentation](!docs!/learn/fundamentals/modules/container). ### Access Module Options in Service @@ -1589,7 +1589,7 @@ export default class HelloModuleService extends MedusaService({ } ``` -Learn more in [this documentation](!docs!/learn/advanced-development/modules/options). +Learn more in [this documentation](!docs!/learn/fundamentals/modules/options). ### Run Database Query in Service @@ -1625,7 +1625,7 @@ class HelloModuleService { } ``` -Learn more in [this documentation](!docs!/learn/advanced-development/modules/db-operations#run-queries) +Learn more in [this documentation](!docs!/learn/fundamentals/modules/db-operations#run-queries) ### Execute Database Operations in Transactions @@ -1682,7 +1682,7 @@ class HelloModuleService { } ``` -Learn more in [this documentation](!docs!/learn/advanced-development/modules/db-operations#execute-operations-in-transactions). +Learn more in [this documentation](!docs!/learn/fundamentals/modules/db-operations#execute-operations-in-transactions). --- @@ -1713,7 +1713,7 @@ export default defineLink( npx medusa db:migrate ``` -Learn more in [this documentation](!docs!/learn/advanced-development/module-links). +Learn more in [this documentation](!docs!/learn/fundamentals/module-links). ### Define a List Link @@ -1733,7 +1733,7 @@ export default defineLink( ) ``` -Learn more about list links in [this documentation](!docs!/learn/advanced-development/module-links#define-a-list-link). +Learn more about list links in [this documentation](!docs!/learn/fundamentals/module-links#define-a-list-link). ### Set Delete Cascade on Link Definition @@ -1753,7 +1753,7 @@ export default defineLink( ) ``` -Learn more in [this documentation](!docs!/learn/advanced-development/module-links#define-a-list-link). +Learn more in [this documentation](!docs!/learn/fundamentals/module-links#define-a-list-link). ### Add Custom Columns to Module Link @@ -1813,7 +1813,7 @@ const { data } = await query.graph({ }) ``` -Learn more in [this documentation](!docs!/learn/advanced-development/module-links/custom-columns). +Learn more in [this documentation](!docs!/learn/fundamentals/module-links/custom-columns). ### Create Link Between Records @@ -1835,7 +1835,7 @@ await remoteLink.create({ }) ``` -Learn more in [this documentation](!docs!/learn/advanced-development/module-links/remote-link#create-link). +Learn more in [this documentation](!docs!/learn/fundamentals/module-links/remote-link#create-link). ### Dismiss Link Between Records @@ -1857,7 +1857,7 @@ await remoteLink.dismiss({ }) ``` -Learn more in [this documentation](!docs!/learn/advanced-development/module-links/remote-link#dismiss-link). +Learn more in [this documentation](!docs!/learn/fundamentals/module-links/remote-link#dismiss-link). ### Cascade Delete Linked Records @@ -1877,7 +1877,7 @@ await remoteLink.delete({ }) ``` -Learn more in [this documentation](!docs!/learn/advanced-development/module-links/remote-link#cascade-delete-linked-records). +Learn more in [this documentation](!docs!/learn/fundamentals/module-links/remote-link#cascade-delete-linked-records). ### Restore Linked Records @@ -1897,7 +1897,7 @@ await remoteLink.restore({ }) ``` -Learn more in [this documentation](!docs!/learn/advanced-development/module-links/remote-link#restore-linked-records). +Learn more in [this documentation](!docs!/learn/fundamentals/module-links/remote-link#restore-linked-records). --- @@ -1933,7 +1933,7 @@ export const GET = async ( } ``` -Learn more in [this documentation](!docs!/learn/advanced-development/module-links/query). +Learn more in [this documentation](!docs!/learn/fundamentals/module-links/query). ### Retrieve Linked Records of Data Model @@ -1967,7 +1967,7 @@ export const GET = async ( } ``` -Learn more in [this documentation](!docs!/learn/advanced-development/module-links/query#retrieve-linked-records). +Learn more in [this documentation](!docs!/learn/fundamentals/module-links/query#retrieve-linked-records). ### Apply Filters to Retrieved Records @@ -2003,7 +2003,7 @@ export const GET = async ( } ``` -Learn more in [this documentation](!docs!/learn/advanced-development/module-links/query#apply-filters). +Learn more in [this documentation](!docs!/learn/fundamentals/module-links/query#apply-filters). ### Apply Pagination and Sort Records @@ -2048,7 +2048,7 @@ export const GET = async ( } ``` -Learn more in [this documentation](!docs!/learn/advanced-development/module-links/query#sort-records). +Learn more in [this documentation](!docs!/learn/fundamentals/module-links/query#sort-records). --- @@ -2115,7 +2115,7 @@ const myWorkflow = createWorkflow( export default myWorkflow ``` -Learn more in [this documentation](!docs!/learn/basics/workflows). +Learn more in [this documentation](!docs!/learn/fundamentals/workflows). ### Execute a Workflow @@ -2211,7 +2211,7 @@ Learn more in [this documentation](!docs!/learn/basics/workflows). -Learn more in [this documentation](!docs!/learn/basics/workflows#3-execute-the-workflow). +Learn more in [this documentation](!docs!/learn/fundamentals/workflows#3-execute-the-workflow). ### Step with a Compensation Function @@ -2238,7 +2238,7 @@ const step1 = createStep( ) ``` -Learn more in [this documentation](!docs!/learn/advanced-development/workflows/compensation-function). +Learn more in [this documentation](!docs!/learn/fundamentals/workflows/compensation-function). ### Manipulate Variables in Workflow @@ -2268,7 +2268,7 @@ const myWorkflow = createWorkflow( ) ``` -Learn more in [this documentation](!docs!/learn/advanced-development/workflows/variable-manipulation) +Learn more in [this documentation](!docs!/learn/fundamentals/workflows/variable-manipulation) ### Using Conditions in Workflow @@ -2336,7 +2336,7 @@ const workflow = createWorkflow( ) ``` -Learn more in [this documentation](!docs!/learn/advanced-development/workflows/execute-another-workflow). +Learn more in [this documentation](!docs!/learn/fundamentals/workflows/execute-another-workflow). ### Consume a Workflow Hook @@ -2357,7 +2357,7 @@ createProductsWorkflow.hooks.productsCreated( This executes a custom step at the hook's designated point in the workflow. -Learn more in [this documentation](!docs!/learn/advanced-development/workflows/workflow-hooks). +Learn more in [this documentation](!docs!/learn/fundamentals/workflows/workflow-hooks). ### Expose a Hook @@ -2388,7 +2388,7 @@ export const myWorkflow = createWorkflow( ) ``` -Learn more in [this documentation](!book!/learn/advanced-development/workflows/add-workflow-hook). +Learn more in [this documentation](!book!/learn/fundamentals/workflows/add-workflow-hook). ### Retry Steps @@ -2412,7 +2412,7 @@ export const step1 = createStep( ) ``` -Learn more in [this documentation](!docs!/learn/advanced-development/workflows/retry-failed-steps). +Learn more in [this documentation](!docs!/learn/fundamentals/workflows/retry-failed-steps). ### Run Steps in Parallel @@ -2453,7 +2453,7 @@ const myWorkflow = createWorkflow( ) ``` -Learn more in [this documentation](!docs!/learn/advanced-development/workflows/parallel-steps). +Learn more in [this documentation](!docs!/learn/fundamentals/workflows/parallel-steps). ### Configure Workflow Timeout @@ -2481,7 +2481,7 @@ const myWorkflow = createWorkflow({ export default myWorkflow ``` -Learn more in [this documentation](!docs!/learn/advanced-development/workflows/workflow-timeout). +Learn more in [this documentation](!docs!/learn/fundamentals/workflows/workflow-timeout). ### Configure Step Timeout @@ -2499,7 +2499,7 @@ const step1 = createStep( ) ``` -Learn more in [this documentation](!docs!/learn/advanced-development/workflows/workflow-timeout#configure-step-timeout). +Learn more in [this documentation](!docs!/learn/fundamentals/workflows/workflow-timeout#configure-step-timeout). ### Long-Running Workflow @@ -2519,7 +2519,7 @@ const step2 = createStep( ) ``` -Learn more in [this documentation](!docs!/learn/advanced-development/workflows/long-running-workflow). +Learn more in [this documentation](!docs!/learn/fundamentals/workflows/long-running-workflow). ### Change Step Status in Long-Running Workflow @@ -2588,7 +2588,7 @@ await workflowEngineService.setStepFailure({ }) ``` -Learn more in [this documentation](!docs!/learn/advanced-development/workflows/long-running-workflow). +Learn more in [this documentation](!docs!/learn/fundamentals/workflows/long-running-workflow). ### Access Long-Running Workflow's Result @@ -2634,7 +2634,7 @@ export async function GET(req: MedusaRequest, res: MedusaResponse) { } ``` -Learn more in [this documentation](!docs!/learn/advanced-development/workflows/long-running-workflow#access-long-running-workflow-status-and-result). +Learn more in [this documentation](!docs!/learn/fundamentals/workflows/long-running-workflow#access-long-running-workflow-status-and-result). --- @@ -2664,7 +2664,7 @@ export const config: SubscriberConfig = { } ``` -Learn more in [this documentation](!docs!/learn/basics/events-and-subscribers). +Learn more in [this documentation](!docs!/learn/fundamentals/events-and-subscribers). ### Resolve Resources in Subscriber @@ -2694,7 +2694,7 @@ export const config: SubscriberConfig = { } ``` -Learn more in [this documentation](!docs!/learn/basics/events-and-subscribers#resolve-resources). +Learn more in [this documentation](!docs!/learn/fundamentals/events-and-subscribers#resolve-resources). ### Send a Notification to Reset Password @@ -2779,7 +2779,7 @@ export const config: SubscriberConfig = { } ``` -Learn more in [this documentation](!docs!/learn/basics/workflows#3-execute-the-workflow) +Learn more in [this documentation](!docs!/learn/fundamentals/workflows#3-execute-the-workflow) --- @@ -2805,7 +2805,7 @@ export const config = { } ``` -Learn more in [this documentation](!docs!/learn/basics/scheduled-jobs). +Learn more in [this documentation](!docs!/learn/fundamentals/scheduled-jobs). ### Resolve Resources in Scheduled Job @@ -2834,7 +2834,7 @@ export const config = { } ``` -Learn more in [this documentation](!docs!/learn/basics/scheduled-jobs#resolve-resources) +Learn more in [this documentation](!docs!/learn/fundamentals/scheduled-jobs#resolve-resources) ### Specify a Job's Execution Number @@ -2853,7 +2853,7 @@ export const config = { } ``` -Learn more in [this documentation](!docs!/learn/advanced-development/scheduled-jobs/execution-number). +Learn more in [this documentation](!docs!/learn/fundamentals/scheduled-jobs/execution-number). ### Execute a Workflow in a Scheduled Job @@ -2882,7 +2882,7 @@ export const config = { } ``` -Learn more in [this documentation](!docs!/learn/basics/workflows#3-execute-the-workflow) +Learn more in [this documentation](!docs!/learn/fundamentals/workflows#3-execute-the-workflow) --- @@ -2904,7 +2904,7 @@ export default async function helloWorldLoader() { } ``` -Learn more in [this documentation](!docs!/learn/basics/loaders). +Learn more in [this documentation](!docs!/learn/fundamentals/modules/loaders). ### Resolve Resources in Loader @@ -2927,7 +2927,7 @@ export default async function helloWorldLoader({ } ``` -Learn more in [this documentation](!docs!/learn/advanced-development/modules/container). +Learn more in [this documentation](!docs!/learn/fundamentals/modules/container). ### Access Module Options @@ -2954,7 +2954,7 @@ export default async function helloWorldLoader({ } ``` -Learn more in [this documentation](!docs!/learn/advanced-development/modules/options). +Learn more in [this documentation](!docs!/learn/fundamentals/modules/options). ### Register Resources in the Module's Container @@ -3019,7 +3019,7 @@ export const config = defineWidgetConfig({ export default ProductWidget ``` -Learn more about widgets in [this documentation](!docs!/learn/advanced-development/admin/widgets). +Learn more about widgets in [this documentation](!docs!/learn/fundamentals/admin/widgets). ### Receive Details Props in Widgets @@ -3056,7 +3056,7 @@ export const config = defineWidgetConfig({ export default ProductWidget ``` -Learn more in [this documentation](!docs!/learn/advanced-development/admin/widgets#detail-widget-props). +Learn more in [this documentation](!docs!/learn/fundamentals/admin/widgets#detail-widget-props). ### Create a UI Route @@ -3089,7 +3089,7 @@ export default CustomPage This adds a new page at `localhost:9000/app/custom`. -Learn more in [this documentation](!docs!/learn/advanced-development/admin/ui-routes). +Learn more in [this documentation](!docs!/learn/fundamentals/admin/ui-routes). ### Create Settings Page @@ -3120,7 +3120,7 @@ export default CustomSettingPage This adds a setting page at `localhost:9000/app/settings/custom`. -Learn more in [this documentation](!docs!/learn/advanced-development/admin/ui-routes#create-settings-page) +Learn more in [this documentation](!docs!/learn/fundamentals/admin/ui-routes#create-settings-page) ### Accept Path Parameters in UI Routes @@ -3149,7 +3149,7 @@ export default CustomPage This creates a UI route at `localhost:9000/app/custom/:id`, where `:id` is a path parameter. -Learn more in [this documentation](!docs!/learn/advanced-development/admin/ui-routes#path-parameters) +Learn more in [this documentation](!docs!/learn/fundamentals/admin/ui-routes#path-parameters) ### Send Request to API Route @@ -3196,7 +3196,7 @@ export const config = defineWidgetConfig({ export default ProductWidget ``` -Learn more in [this documentation](!docs!/learn/advanced-development/admin/tips#send-requests-to-api-routes) +Learn more in [this documentation](!docs!/learn/fundamentals/admin/tips#send-requests-to-api-routes) ### Add Link to Another Page @@ -3224,7 +3224,7 @@ export const config = defineWidgetConfig({ export default ProductWidget ``` -Learn more in [this documentation](!docs!/learn/advanced-development/admin/tips#routing-functionalities). +Learn more in [this documentation](!docs!/learn/fundamentals/admin/tips#routing-functionalities). --- @@ -3750,7 +3750,7 @@ Learn more in [this documentation](../commerce-modules/payment/payment-flow/page ### Get Variant's Prices for Region and Currency -To get prices of a product variant for a region and currency using [Query](!docs!/learn/advanced-development/module-links/query): +To get prices of a product variant for a region and currency using [Query](!docs!/learn/fundamentals/module-links/query): ```ts import { QueryContext } from "@medusajs/framework/utils" @@ -3782,7 +3782,7 @@ Learn more in [this documentation](../commerce-modules/product/guides/price/page ### Get All Variant's Prices -To get all prices of a product variant using [Query](!docs!/learn/advanced-development/module-links/query): +To get all prices of a product variant using [Query](!docs!/learn/fundamentals/module-links/query): ```ts const { data: products } = await query.graph({ @@ -3804,7 +3804,7 @@ Learn more in [this documentation](../commerce-modules/product/guides/price/page ### Get Variant Prices with Taxes -To get a variant's prices with taxes using [Query](!docs!/learn/advanced-development/module-links/query) and the [Tax Module](../commerce-modules/tax/page.mdx) +To get a variant's prices with taxes using [Query](!docs!/learn/fundamentals/module-links/query) and the [Tax Module](../commerce-modules/tax/page.mdx) ```ts import { diff --git a/www/apps/resources/app/integrations/guides/resend/page.mdx b/www/apps/resources/app/integrations/guides/resend/page.mdx index 954ec61f1ffcd..836437089bfd1 100644 --- a/www/apps/resources/app/integrations/guides/resend/page.mdx +++ b/www/apps/resources/app/integrations/guides/resend/page.mdx @@ -81,7 +81,7 @@ Afterwards, the installation process will start, which will install the Medusa a -The Medusa application is composed of a headless Node.js server and an admin dashboard. The storefront is installed or custom-built separately and connects to the Medusa application through its REST endpoints, called [API routes](!docs!/learn/basics/api-routes). Learn more about Medusa's architecture in [this documentation](!docs!/learn/advanced-development/architecture/overview). +The Medusa application is composed of a headless Node.js server and an admin dashboard. The storefront is installed or custom-built separately and connects to the Medusa application through its REST endpoints, called [API routes](!docs!/learn/fundamentals/api-routes). Learn more about Medusa's architecture in [this documentation](!docs!/learn/introduction/architecture). @@ -154,7 +154,7 @@ Medusa's Notification Module delegates sending notifications to other modules, c -Learn more about modules in [this documentation](!docs!/learn/basics/modules). +Learn more about modules in [this documentation](!docs!/learn/fundamentals/modules). @@ -248,7 +248,7 @@ class ResendNotificationProviderService extends AbstractNotificationProviderServ A module's service accepts two parameters: -1. Dependencies resolved from the [Module's container](!docs!/learn/advanced-development/modules/container), which is the module's local registry that the Medusa application adds framework tools to. In this service, you resolve the [Logger utility](!docs!/learn/debugging-and-testing/logging) from the module's container. +1. Dependencies resolved from the [Module's container](!docs!/learn/fundamentals/modules/container), which is the module's local registry that the Medusa application adds framework tools to. In this service, you resolve the [Logger utility](!docs!/learn/debugging-and-testing/logging) from the module's container. 2. The module's options that are passed to the module in Medusa's configuration as you'll see in a later section. Using the API key passed in the module's options, you initialize the Resend client. You also set the `options` and `logger` properties. @@ -627,7 +627,7 @@ Instead, you'll create a subscriber that listens to the `order.placed` event and -Learn more about Medusa's event system in [this documentation](!docs!/learn/basics/events-and-subscribers). +Learn more about Medusa's event system in [this documentation](!docs!/learn/fundamentals/events-and-subscribers). @@ -639,7 +639,7 @@ A workflow is a series of queries and actions, called steps, that complete a tas -Learn more about workflows in [this documentation](!docs!/learn/basics/workflows) +Learn more about workflows in [this documentation](!docs!/learn/fundamentals/workflows) @@ -669,7 +669,7 @@ You define the `sendNotificationStep` using the `createStep` function that accep - A string indicating the step's unique name. - The step's function definition as a second parameter. It accepts the step's input as a first parameter, and an object of options as a second. -The `container` property in the second parameter is an instance of the [Medusa container](!docs!/learn/basics/medusa-container), which is a registry of framework and commerce tools, such a module's service, that you can resolve to utilize their functionalities. +The `container` property in the second parameter is an instance of the [Medusa container](!docs!/learn/fundamentals/medusa-container), which is a registry of framework and commerce tools, such a module's service, that you can resolve to utilize their functionalities. @@ -741,7 +741,7 @@ You create a workflow using the `createWorkflow` function imported from `@medusa It accepts as a second parameter a constructor function, which is the workflow's implementation. The workflow has the following steps: -1. `useQueryGraphStep`, which is a step implemented by Medusa that uses [Query](!docs!/learn/advanced-development/module-links/query), a tool that allows you to retrieve data across modules. You use it to retrieve the order's details. +1. `useQueryGraphStep`, which is a step implemented by Medusa that uses [Query](!docs!/learn/fundamentals/module-links/query), a tool that allows you to retrieve data across modules. You use it to retrieve the order's details. 2. `sendNotificationStep` which is the step you implemented. You pass it an array with one object, which is the notification's details having following properties: - `to`: The address to send the email to. You pass the customer's email that is stored in the order. - `channel`: The channel to send the notification through, which is `email`. Since you specified `email` in the Resend Module Provider's `channel` option, the Notification Module will delegate the sending to the Resend Module Provider's service. @@ -750,7 +750,7 @@ It accepts as a second parameter a constructor function, which is the workflow's -A workflow's constructor function has some constraints in implementation. Learn more about them in [this documentation](!docs!/learn/advanced-development/workflows/constructor-constraints). +A workflow's constructor function has some constraints in implementation. Learn more about them in [this documentation](!docs!/learn/fundamentals/workflows/constructor-constraints). @@ -802,7 +802,7 @@ A subscriber file exports: - An asynchronous function that's executed whenever the associated event is emitted, which is the `order.placed` event. - A configuration object with an `event` property indicating the event the subscriber is listening to. -The subscriber function accepts the event's details as a first paramter which has a `data` property that holds the data payload of the event. For example, Medusa emits the `order.placed` event with the order's ID in the data payload. The function also accepts as a second parameter the [Medusa container](!docs!/learn/basics/medusa-container). +The subscriber function accepts the event's details as a first paramter which has a `data` property that holds the data payload of the event. For example, Medusa emits the `order.placed` event with the order's ID in the data payload. The function also accepts as a second parameter the [Medusa container](!docs!/learn/fundamentals/medusa-container). In the function, you execute the `sendOrderConfirmationWorkflow` by invoking it, passing it the `container`, then using its `run` method. The `run` method accepts an object having an `input` property, which is the input to pass to the workflow. You pass the ID of the placed order as received in the event's data payload. diff --git a/www/apps/resources/app/integrations/guides/sanity/page.mdx b/www/apps/resources/app/integrations/guides/sanity/page.mdx index 53cf6b9f49ff5..9b67050485a30 100644 --- a/www/apps/resources/app/integrations/guides/sanity/page.mdx +++ b/www/apps/resources/app/integrations/guides/sanity/page.mdx @@ -82,7 +82,7 @@ Afterwards, the installation process will start, which will install the Medusa a -The Medusa application is composed of a headless Node.js server and an admin dashboard. The storefront is installed or custom-built separately and connects to the Medusa application through its REST endpoints, called [API routes](!docs!/learn/basics/api-routes). Learn more about Medusa's architecture in [this documentation](!docs!/learn/advanced-development/architecture/overview). +The Medusa application is composed of a headless Node.js server and an admin dashboard. The storefront is installed or custom-built separately and connects to the Medusa application through its REST endpoints, called [API routes](!docs!/learn/fundamentals/api-routes). Learn more about Medusa's architecture in [this documentation](!docs!/learn/introduction/architecture). @@ -138,7 +138,7 @@ In this step, you'll create a Sanity Module that provides the interface to conne -Learn more about modules in [this documentation](!docs!/learn/basics/modules). +Learn more about modules in [this documentation](!docs!/learn/fundamentals/modules). @@ -150,11 +150,11 @@ A module is created under the `src/modules` directory of your Medusa application You define a module's functionalities in a service. A service is a TypeScript or JavaScript class that the module exports. In the service's methods, you can connect to the database, which is useful if your module defines tables in the database, or connect to a third-party service. -Medusa registers the module's service in the [Medusa container](!docs!/learn/basics/medusa-container), allowing you to easily resolve the service from other customizations and use its methods. +Medusa registers the module's service in the [Medusa container](!docs!/learn/fundamentals/medusa-container), allowing you to easily resolve the service from other customizations and use its methods. -The Medusa application registers resources, such as a module's service or the [logging tool](!docs!/learn/debugging-and-testing/logging), in the Medusa container so that you can resolve them from other customizations, as you'll see in later sections. Learn more about it in [this documentation](!docs!/learn/basics/medusa-container). +The Medusa application registers resources, such as a module's service or the [logging tool](!docs!/learn/debugging-and-testing/logging), in the Medusa container so that you can resolve them from other customizations, as you'll see in later sections. Learn more about it in [this documentation](!docs!/learn/fundamentals/medusa-container). @@ -258,7 +258,7 @@ class SanityModuleService { The service's constructor accepts two parameters: -1. Resources to resolve from the Module's container. A module has a different container than the Medusa application, which you can learn more about it in [this documentation](!docs!/learn/advanced-development/modules/container). +1. Resources to resolve from the Module's container. A module has a different container than the Medusa application, which you can learn more about it in [this documentation](!docs!/learn/fundamentals/modules/container). 2. The options passed to the module. In the constructor, you create a Sanity client using the `createClient` function imported from `@sanity/client`. You pass it the options that the module receives. @@ -603,7 +603,7 @@ In the next steps, you'll create a link between the Product and Sanity modules t Since a product has a document in Sanity, you want to build an association between the [Product](../../../commerce-modules/product/page.mdx) and Sanity modules so that when you retrieve a product, you also retrieve its associated Sanity document. -However, modules are [isolated](!docs!/learn/advanced-development/modules/isolation) to ensure they're re-usable and don't have side effects when integrated into the Medusa application. So, to build associations between modules, you define [module links](!docs!/learn/advanced-development/module-links). +However, modules are [isolated](!docs!/learn/fundamentals/modules/isolation) to ensure they're re-usable and don't have side effects when integrated into the Medusa application. So, to build associations between modules, you define [module links](!docs!/learn/fundamentals/module-links). A Module Link associates two modules' data models while maintaining module isolation. A data model can be a table in the database or a virtual model from an external systems. @@ -657,7 +657,7 @@ Within a workflow's steps, you resolve modules to use their service's functional -Learn more about workflows in [this documentation](!docs!/learn/basics/workflows) +Learn more about workflows in [this documentation](!docs!/learn/fundamentals/workflows) @@ -743,7 +743,7 @@ You define the `syncStep` using the `createStep` function, which accepts two par The step function accepts the step's input as a first parameter, and an object of options as a second. The object of options has a `container` property, which is an instance of the Medusa container that you can use to resolve resources. -In the step, you resolve from the Medusa container Sanity Module's service and [Query](!docs!/learn/advanced-development/module-links/query), which is a tool that allows you to retrieve data across modules and links. +In the step, you resolve from the Medusa container Sanity Module's service and [Query](!docs!/learn/fundamentals/module-links/query), which is a tool that allows you to retrieve data across modules and links. You use Query's `graph` method to retrieve products, filtering them by their IDs and applying pagination configurations. The `graph` method accepts a `fields` property in its object parameter, which indicates the product data model's fields and relations to retrieve. @@ -816,7 +816,7 @@ If no errors occur, the step returns an instance of `StepResponse`, which must b -Learn more about compensation functions in [this documentation](!docs!/learn/advanced-development/workflows/compensation-function). +Learn more about compensation functions in [this documentation](!docs!/learn/fundamentals/workflows/compensation-function). @@ -895,7 +895,7 @@ The `retentionTime` property indicates how long should the workflow's progress b -A workflow's constructor function has some constraints in implementation. Learn more about them in [this documentation](!docs!/learn/advanced-development/workflows/constructor-constraints). +A workflow's constructor function has some constraints in implementation. Learn more about them in [this documentation](!docs!/learn/fundamentals/workflows/constructor-constraints). @@ -915,7 +915,7 @@ Subscribers are useful when you want to perform an action that isn't an integral -Learn more about events and subscribers in [this documentation](!docs!/learn/basics/events-and-subscribers). You can also find the list of emitted events in [this reference](../../../events-reference/page.mdx). +Learn more about events and subscribers in [this documentation](!docs!/learn/fundamentals/events-and-subscribers). You can also find the list of emitted events in [this reference](../../../events-reference/page.mdx). @@ -1316,7 +1316,7 @@ You can now manage the product's content in Sanity, add more fields, and customi There are cases where you need to trigger the syncing of products manually, such as when an error occurs or you have products from before creating this integration. -The Medusa Admin dashboard is customizable, allowing you to either inject components, called [widgets](!docs!/learn/advanced-development/admin/widgets), into existing pages, or adding new pages, called [UI routes](!docs!/learn/advanced-development/admin/ui-routes). In these customizations, you can send requests to the Medusa application to perform custom operations. +The Medusa Admin dashboard is customizable, allowing you to either inject components, called [widgets](!docs!/learn/fundamentals/admin/widgets), into existing pages, or adding new pages, called [UI routes](!docs!/learn/fundamentals/admin/ui-routes). In these customizations, you can send requests to the Medusa application to perform custom operations. In this step, you'll add a widget to the product's details page. In that page, you'll show whether a product is synced with Sanity, and allow the admin user to trigger syncing it manually. @@ -1326,7 +1326,7 @@ Before you do that, however, you need two new API routes in your Medusa applicat -An API route is a REST API endpoint that exposes commerce features to the admin dashboard or other frontend clients. Learn more about API routes in [this documentation](!docs!/learn/basics/api-routes). +An API route is a REST API endpoint that exposes commerce features to the admin dashboard or other frontend clients. Learn more about API routes in [this documentation](!docs!/learn/fundamentals/api-routes). @@ -1395,7 +1395,7 @@ You'll test out this route in a later section. -Since the API route is added under the `/admin` prefix, only authenticated admin users can access it. Learn more about protected routes in [this documentation](!docs!/learn/advanced-development/api-routes/protected-routes). +Since the API route is added under the `/admin` prefix, only authenticated admin users can access it. Learn more about protected routes in [this documentation](!docs!/learn/fundamentals/api-routes/protected-routes). @@ -1654,7 +1654,7 @@ To render a widget that matches the rest of the admin dashboard's design, you us -Learn more about widgets in [this documentation](/learn/advanced-development/admin/widgets). +Learn more about widgets in [this documentation](/learn/fundamentals/admin/widgets). @@ -1676,7 +1676,7 @@ Earlier in this guide when introducing workflows, you learned that you can track Medusa has a [workflow engine](../../../architectural-modules/workflow-engine/page.mdx) that manages workflow executions, roll-backs, and other functionalities under the hood. -The workflow engine is an [architectural module](!docs!/learn/advanced-development/architecture/architectural-modules), which can be replaced with a [Redis Workflow Engine](../../../architectural-modules/workflow-engine/redis/page.mdx), or a custom one of your choice, allowing you to take ownership of your application's tooling. +The workflow engine is an [architectural module](!docs!/learn/fundamentals/modules/architectural-modules), which can be replaced with a [Redis Workflow Engine](../../../architectural-modules/workflow-engine/redis/page.mdx), or a custom one of your choice, allowing you to take ownership of your application's tooling. In your customizations, you can resolve the workflow engine from the container and manage executions of a workflow, such as retrieve them and check their progress. @@ -1921,7 +1921,7 @@ To display components that match the design of the Medusa Admin, you use compone -Learn more about UI routes in [this documentation](!docs!/learn/advanced-development/admin/ui-routes). +Learn more about UI routes in [this documentation](!docs!/learn/fundamentals/admin/ui-routes). diff --git a/www/apps/resources/app/medusa-cli/commands/exec/page.mdx b/www/apps/resources/app/medusa-cli/commands/exec/page.mdx index ec86d4bac9cbf..985eb3dc2570a 100644 --- a/www/apps/resources/app/medusa-cli/commands/exec/page.mdx +++ b/www/apps/resources/app/medusa-cli/commands/exec/page.mdx @@ -11,7 +11,7 @@ export const metadata = { # {metadata.title} -Run a custom CLI script. Learn more about it in [this guide](!docs!/learn/advanced-development/custom-cli-scripts). +Run a custom CLI script. Learn more about it in [this guide](!docs!/learn/fundamentals/custom-cli-scripts). ```bash npx medusa exec [file] [args...] diff --git a/www/apps/resources/app/medusa-container-resources/page.mdx b/www/apps/resources/app/medusa-container-resources/page.mdx index 30f249d6a7e1c..534c0c81747aa 100644 --- a/www/apps/resources/app/medusa-container-resources/page.mdx +++ b/www/apps/resources/app/medusa-container-resources/page.mdx @@ -14,7 +14,7 @@ The following table has a list of all resources that you can resolve in your cus -Learn more about the Medusa Container in [this documentation](!docs!/learn/basics/medusa-container). +Learn more about the Medusa Container in [this documentation](!docs!/learn/fundamentals/medusa-container). @@ -147,7 +147,7 @@ The following table has a list of all resources that you can resolve in a module -Learn more about the Module Container in [this documentation](!docs!/learn/advanced-development/modules/container). +Learn more about the Module Container in [this documentation](!docs!/learn/fundamentals/modules/container). diff --git a/www/apps/resources/app/recipes/b2b/page.mdx b/www/apps/resources/app/recipes/b2b/page.mdx index 5b06d915a0d21..66ae087b5640f 100644 --- a/www/apps/resources/app/recipes/b2b/page.mdx +++ b/www/apps/resources/app/recipes/b2b/page.mdx @@ -173,13 +173,13 @@ You can create a B2B module that adds necessary data models to represent a B2B c {/* - You can store the product's ID in the external system using the `metadata` property of the `Product` data model in the Product Module. Alternatively, you can create a [data model](!docs!/learn/basics/modules#1-create-data-model) in your module to store data related to the external system. + You can store the product's ID in the external system using the `metadata` property of the `Product` data model in the Product Module. Alternatively, you can create a [data model](!docs!/learn/fundamentals/modules#1-create-data-model) in your module to store data related to the external system. @@ -150,7 +150,7 @@ Workflows can be executed from anywhere. So, taking the workflow described above Workflows guarantee data consistency through their compensation feature. You can provide a compensation function to steps that roll back the actions of that step. Then, if an error occurs in any step, the actions of previous steps are rolled back using their compensation function. -If you’re calling this API route from a frontend client, make sure to set the [CORS middleware](!docs!/learn/advanced-development/api-routes/cors) on it since it’s not under the `/store` or `/admin` route prefixes. +If you’re calling this API route from a frontend client, make sure to set the [CORS middleware](!docs!/learn/fundamentals/api-routes/cors) on it since it’s not under the `/store` or `/admin` route prefixes. ### Further Reads -- [How to Create a Workflow](!docs!/learn/basics/workflows) -- [What is a Compensation Function](!docs!/learn/advanced-development/workflows/compensation-function) -- [How to Create an API route](!docs!/learn/basics/api-routes) +- [How to Create a Workflow](!docs!/learn/fundamentals/workflows) +- [What is a Compensation Function](!docs!/learn/fundamentals/workflows/compensation-function) +- [How to Create an API route](!docs!/learn/fundamentals/api-routes) --- @@ -704,7 +704,7 @@ This returns the list of restaurants in the response. ### Further Reads -- [What is and how to use it](!docs!/learn/advanced-development/module-links/query) +- [What is and how to use it](!docs!/learn/fundamentals/module-links/query) - [How to Retrieve Prices for Product Variants](../../../../commerce-modules/product/guides/price/page.mdx) --- @@ -1561,7 +1561,7 @@ In this step, you’ll create the workflow that handles the different stages of For example, when a restaurant finishes preparing the order’s items, this workflow creates a fulfillment for the order. -This workflow will be a [long-running workflow](!docs!/learn/advanced-development/workflows/long-running-workflow) that runs asynchronously in the background. Its async steps only succeed once an outside action sets its status, allowing the workflow to move to the next step. +This workflow will be a [long-running workflow](!docs!/learn/fundamentals/workflows/long-running-workflow) that runs asynchronously in the background. Its async steps only succeed once an outside action sets its status, allowing the workflow to move to the next step. API routes that perform actions related to the delivery, which you’ll create later, will trigger the workflow to move to the next step. @@ -2082,7 +2082,7 @@ In the next steps, you’ll execute the workflow and see it in action as you add ### Further Reads -- [Long-Running Workflows](!docs!/learn/advanced-development/workflows/long-running-workflow) +- [Long-Running Workflows](!docs!/learn/fundamentals/workflows/long-running-workflow) --- @@ -3478,7 +3478,7 @@ The next steps of this example depend on your use case. This section provides so ### Admin Development -The Medusa Admin is extendable, allowing you to add widgets to existing pages or create new pages. Learn more about it in [this documentation](!docs!/learn/advanced-development/admin). +The Medusa Admin is extendable, allowing you to add widgets to existing pages or create new pages. Learn more about it in [this documentation](!docs!/learn/fundamentals/admin). ### Storefront Development diff --git a/www/apps/resources/app/recipes/marketplace/examples/vendors/page.mdx b/www/apps/resources/app/recipes/marketplace/examples/vendors/page.mdx index eda36bbf40119..37daae80e5bca 100644 --- a/www/apps/resources/app/recipes/marketplace/examples/vendors/page.mdx +++ b/www/apps/resources/app/recipes/marketplace/examples/vendors/page.mdx @@ -120,7 +120,7 @@ class MarketplaceModuleService extends MedusaService({ export default MarketplaceModuleService ``` -The service extends the [service factory](!docs!/learn/advanced-development/modules/service-factory), which provides basic data-management features. +The service extends the [service factory](!docs!/learn/fundamentals/modules/service-factory), which provides basic data-management features. ### Create Module Definition @@ -154,8 +154,8 @@ module.exports = defineConfig({ ### Further Reads -- [How to Create a Module](!docs!/learn/basics/modules) -- [How to Create Data Models](!docs!/learn/basics/modules#1-create-data-model) +- [How to Create a Module](!docs!/learn/fundamentals/modules) +- [How to Create Data Models](!docs!/learn/fundamentals/modules#1-create-data-model) --- @@ -213,7 +213,7 @@ This adds a list link between the `Vendor` and `Order` data models, indicating t ### Further Read -- [How to Define Module Links](!docs!/learn/advanced-development/module-links) +- [How to Define Module Links](!docs!/learn/fundamentals/module-links) --- @@ -350,10 +350,10 @@ You return the created vendor admin. ### Further Read -- [How to Create a Workflow](!docs!/learn/basics/workflows) +- [How to Create a Workflow](!docs!/learn/fundamentals/workflows) - [What is an Actor Type](../../../../commerce-modules/auth/auth-identity-and-actor-types/page.mdx) - [How to Create an Actor Type](../../../../commerce-modules/auth/create-actor-type/page.mdx) -- [What is a Compensation Function](!docs!/learn/advanced-development/workflows/compensation-function) +- [What is a Compensation Function](!docs!/learn/fundamentals/workflows/compensation-function) --- @@ -527,7 +527,7 @@ This route is available because you created the `vendor` actor type previously. -Don't include a trailing slash at the end of the URL. Learn more [here](!docs!/learn/advanced-development/api-routes/middlewares). +Don't include a trailing slash at the end of the URL. Learn more [here](!docs!/learn/fundamentals/api-routes/middlewares). @@ -563,8 +563,8 @@ Use this token in the header of later requests that require authentication. ### Further Reads -- [How to Create an API route](!docs!/learn/basics/api-routes) -- [How to Create a Middleware](!docs!/learn/advanced-development/api-routes/middlewares) +- [How to Create an API route](!docs!/learn/fundamentals/api-routes) +- [How to Create a Middleware](!docs!/learn/fundamentals/api-routes/middlewares) - [Learn more about the /auth route](../../../../commerce-modules/auth/authentication-route/page.mdx) --- @@ -792,8 +792,8 @@ curl 'http://localhost:9000/vendors/products' \ ### Further Reads -- [How to use Query](!docs!/learn/advanced-development/module-links/query) -- [How to use the Remote Link](!docs!/learn/advanced-development/module-links/remote-link) +- [How to use Query](!docs!/learn/fundamentals/module-links/query) +- [How to use the Remote Link](!docs!/learn/fundamentals/module-links/remote-link) --- @@ -1392,7 +1392,7 @@ For example, you can link sales channels to vendors or other settings. -[Learn more about module links](!docs!/learn/advanced-development/module-links). +[Learn more about module links](!docs!/learn/fundamentals/module-links). @@ -1404,6 +1404,6 @@ You can also create a custom storefront. Check out the [Storefront Development]( ### Admin Development -The Medusa Admin is extendable, allowing you to add widgets to existing pages or create new pages. Learn more about it in [this documentation](!docs!/learn/advanced-development/admin). +The Medusa Admin is extendable, allowing you to add widgets to existing pages or create new pages. Learn more about it in [this documentation](!docs!/learn/fundamentals/admin). If your use case requires bigger customizations to the admin, such as showing different products and orders based on the logged-in vendor, use the [admin API routes](!api!/admin) to build a custom admin. diff --git a/www/apps/resources/app/recipes/marketplace/page.mdx b/www/apps/resources/app/recipes/marketplace/page.mdx index 332c426aa0962..ebace6df4f1e2 100644 --- a/www/apps/resources/app/recipes/marketplace/page.mdx +++ b/www/apps/resources/app/recipes/marketplace/page.mdx @@ -35,13 +35,13 @@ You can create a marketplace module that implements data models for vendors, the -This applies to relations between data models of the same module. To retrieve linked records of different modules, use [Query](!docs!/learn/advanced-development/module-links/query). +This applies to relations between data models of the same module. To retrieve linked records of different modules, use [Query](!docs!/learn/fundamentals/module-links/query).
diff --git a/www/apps/resources/app/service-factory-reference/methods/listAndCount/page.mdx b/www/apps/resources/app/service-factory-reference/methods/listAndCount/page.mdx index 33aac00fa951b..b46f5d41a5584 100644 --- a/www/apps/resources/app/service-factory-reference/methods/listAndCount/page.mdx +++ b/www/apps/resources/app/service-factory-reference/methods/listAndCount/page.mdx @@ -54,7 +54,7 @@ The method returns an array with two items: -This applies to relations between data models of the same module. To retrieve linked records of different modules, use [Query](!docs!/learn/advanced-development/module-links/query). +This applies to relations between data models of the same module. To retrieve linked records of different modules, use [Query](!docs!/learn/fundamentals/module-links/query). diff --git a/www/apps/resources/app/service-factory-reference/methods/retrieve/page.mdx b/www/apps/resources/app/service-factory-reference/methods/retrieve/page.mdx index cc09b4c4ac42b..958edf28568fd 100644 --- a/www/apps/resources/app/service-factory-reference/methods/retrieve/page.mdx +++ b/www/apps/resources/app/service-factory-reference/methods/retrieve/page.mdx @@ -30,7 +30,7 @@ The method returns the record as an object. -This applies to relations between data models of the same module. To retrieve linked records of different modules, use [Query](!docs!/learn/advanced-development/module-links/query). +This applies to relations between data models of the same module. To retrieve linked records of different modules, use [Query](!docs!/learn/fundamentals/module-links/query). diff --git a/www/apps/resources/app/service-factory-reference/page.mdx b/www/apps/resources/app/service-factory-reference/page.mdx index c145165551066..d6c9fc88b7399 100644 --- a/www/apps/resources/app/service-factory-reference/page.mdx +++ b/www/apps/resources/app/service-factory-reference/page.mdx @@ -10,7 +10,7 @@ This section of the documentation provides a reference of the methods generated -Learn more about the service factory in [this documentation](!docs!/learn/advanced-development/modules/service-factory). +Learn more about the service factory in [this documentation](!docs!/learn/fundamentals/modules/service-factory). diff --git a/www/apps/resources/app/troubleshooting/medusa-admin/no-widget-route/page.mdx b/www/apps/resources/app/troubleshooting/medusa-admin/no-widget-route/page.mdx index e3d26b715d28a..c4089a1ce8992 100644 --- a/www/apps/resources/app/troubleshooting/medusa-admin/no-widget-route/page.mdx +++ b/www/apps/resources/app/troubleshooting/medusa-admin/no-widget-route/page.mdx @@ -18,7 +18,7 @@ Refer to the [Admin Widget Injection Zones list](../../../admin-widget-injection Widget and UI routes must be defined as arrow functions. Any other type of declaration isn't accepted. -Refer to the [Admin Development Constraints](!docs!/learn/advanced-development/admin/constraints) documentation for more details. +Refer to the [Admin Development Constraints](!docs!/learn/fundamentals/admin/constraints) documentation for more details. --- @@ -34,7 +34,7 @@ export const config = defineWidgetConfig({ Any other usage leads to the widget not being shown. -Refer to the [Admin Development Constraints](!docs!/learn/advanced-development/admin/constraints) documentation for more details. +Refer to the [Admin Development Constraints](!docs!/learn/fundamentals/admin/constraints) documentation for more details. --- diff --git a/www/apps/resources/references/workflows/functions/workflows.createHook/page.mdx b/www/apps/resources/references/workflows/functions/workflows.createHook/page.mdx index a6ae04d5c4517..1723cf2c8c014 100644 --- a/www/apps/resources/references/workflows/functions/workflows.createHook/page.mdx +++ b/www/apps/resources/references/workflows/functions/workflows.createHook/page.mdx @@ -13,7 +13,7 @@ Expose a hook in your workflow where you can inject custom functionality as a st A handler hook can later be registered to consume the hook and perform custom functionality. -Learn more in [this documentation](https://docs.medusajs.com/advanced-development/workflows/add-workflow-hook). +Learn more in [this documentation](https://docs.medusajs.com/fundamentals/workflows/add-workflow-hook). ## Example diff --git a/www/apps/resources/references/workflows/types/workflows.UnwrapWorkflowInputDataType/page.mdx b/www/apps/resources/references/workflows/types/workflows.UnwrapWorkflowInputDataType/page.mdx index 69dfda97b7d60..0eeeac20ae6eb 100644 --- a/www/apps/resources/references/workflows/types/workflows.UnwrapWorkflowInputDataType/page.mdx +++ b/www/apps/resources/references/workflows/types/workflows.UnwrapWorkflowInputDataType/page.mdx @@ -14,4 +14,4 @@ type WorkflowInputData = UnwrapWorkflowInputDataType ## Type Parameters - ReturnType<[StepFunction](../workflows.StepFunction/page.mdx)<TData, TResult>>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"run","type":"``(...`args`: Parameters<ExportedWorkflow<TData, TResult, TDataOverride, TResultOverride>[\"run\"]>) => ReturnType<ExportedWorkflow<TData, TResult, TDataOverride, TResultOverride>[\"run\"]>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"getName","type":"() => `string`","description":"This method retrieves the workflow's name.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"(`config`: `TransactionModelOptions`) => `void`","description":"This method sets the workflow's configurations.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hooks","type":"ConvertHooksToFunctions<THooks>","description":"The workflow's exposed hooks, used to register a handler to consume the hook.\n\nLearn more in [this documentation](https://docs.medusajs.com/advanced-development/workflows/add-workflow-hook#how-to-consume-a-hook).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="UnwrapWorkflowInputDataType"/> + ReturnType<[StepFunction](../workflows.StepFunction/page.mdx)<TData, TResult>>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"run","type":"``(...`args`: Parameters<ExportedWorkflow<TData, TResult, TDataOverride, TResultOverride>[\"run\"]>) => ReturnType<ExportedWorkflow<TData, TResult, TDataOverride, TResultOverride>[\"run\"]>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"getName","type":"() => `string`","description":"This method retrieves the workflow's name.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"(`config`: `TransactionModelOptions`) => `void`","description":"This method sets the workflow's configurations.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hooks","type":"ConvertHooksToFunctions<THooks>","description":"The workflow's exposed hooks, used to register a handler to consume the hook.\n\nLearn more in [this documentation](https://docs.medusajs.com/fundamentals/workflows/add-workflow-hook#how-to-consume-a-hook).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="UnwrapWorkflowInputDataType"/> diff --git a/www/apps/ui/contentlayer.config.ts b/www/apps/ui/contentlayer.config.ts index 191a89015ee04..808c558412863 100644 --- a/www/apps/ui/contentlayer.config.ts +++ b/www/apps/ui/contentlayer.config.ts @@ -1,3 +1,5 @@ +import "dotenv/config" + import { defineDocumentType, makeSource } from "contentlayer/source-files" import { rehypeComponent } from "./src/lib/rehype-component" import rehypeSlug from "rehype-slug" @@ -28,5 +30,11 @@ export default makeSource({ documentTypes: [Doc], mdx: { rehypePlugins: [[rehypeComponent], [rehypeSlug]], + mdxOptions: (options) => { + return { + ...options, + development: process.env.NODE_ENV === "development", + } + }, }, }) diff --git a/www/apps/ui/package.json b/www/apps/ui/package.json index 4a111bf3b471e..7e119311795bc 100644 --- a/www/apps/ui/package.json +++ b/www/apps/ui/package.json @@ -5,7 +5,8 @@ "scripts": { "dev": "next dev", "dev:monorepo": "yarn dev -p 3002", - "build": "yarn copy-colors && next build", + "contentlayer:build": "contentlayer build", + "build": "yarn copy-colors && yarn contentlayer:build && next build", "start": "next start", "start:monorepo": "yarn start -p 3002", "lint": "next lint --fix",