Skip to content

Commit

Permalink
docs: revise main docs outline (#10502)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahednasser authored Dec 9, 2024
1 parent c8cb9b5 commit 0ae98c5
Show file tree
Hide file tree
Showing 141 changed files with 781 additions and 1,148 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docs-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
14 changes: 0 additions & 14 deletions www/apps/book/app/learn/advanced-development/api-routes/page.mdx

This file was deleted.

15 changes: 0 additions & 15 deletions www/apps/book/app/learn/advanced-development/modules/page.mdx

This file was deleted.

15 changes: 0 additions & 15 deletions www/apps/book/app/learn/advanced-development/page.mdx

This file was deleted.

14 changes: 0 additions & 14 deletions www/apps/book/app/learn/advanced-development/workflows/page.mdx

This file was deleted.

64 changes: 0 additions & 64 deletions www/apps/book/app/learn/basics/admin-customizations/page.mdx

This file was deleted.

18 changes: 0 additions & 18 deletions www/apps/book/app/learn/basics/page.mdx

This file was deleted.

26 changes: 0 additions & 26 deletions www/apps/book/app/learn/basics/project-directories-files/page.mdx

This file was deleted.

2 changes: 1 addition & 1 deletion www/apps/book/app/learn/build/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ cp ../../.env .env.production

<Note>

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).

</Note>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ You create an API route in a `route.{ts,js}` file under a sub-directory of the `

<Note>

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).

</Note>

Expand Down Expand Up @@ -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.

<Note title="Tip">

Expand All @@ -85,7 +85,7 @@ Medusa uses [Zod](https://zod.dev/) to create validation schemas. These schemas

<Note>

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).

</Note>

Expand Down Expand Up @@ -123,7 +123,7 @@ A middleware is a function executed before the route handler when a request is s

<Note>

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).

</Note>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ In a module, you create data models and business logic to manage them. In the ne

<Note>

Learn more about modules in [this chapter](../../../basics/modules/page.mdx).
Learn more about modules in [this chapter](../../../fundamentals/modules/page.mdx).

</Note>

Expand All @@ -30,7 +30,7 @@ A data model represents a table in the database. You create data models using Me

<Note>

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).

</Note>

Expand All @@ -56,7 +56,7 @@ You define the data model using the `define` method of the `model` utility impor

<Note title="Tip">

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).

</Note>

Expand All @@ -70,7 +70,7 @@ In this step, you'll create the Brand Module's service that provides methods to

<Note>

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).

</Note>

Expand Down Expand Up @@ -168,7 +168,7 @@ A migration is a TypeScript or JavaScript file that defines database changes mad

<Note>

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).

</Note>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The workflow you'll create in this chapter will use the Brand Module's service t

<Note>

Learn more about workflows in [this chapter](../../../basics/workflows/page.mdx).
Learn more about workflows in [this chapter](../../../fundamentals/workflows/page.mdx).

</Note>

Expand Down Expand Up @@ -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.

Expand All @@ -85,7 +85,7 @@ You define for each step a compensation function that's executed when an error o

<Note>

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).

</Note>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -76,7 +76,7 @@ You return in the response the retrieved brands and the pagination configuration

<Note>

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).

</Note>

Expand Down Expand Up @@ -138,7 +138,7 @@ By applying the above middleware, you can pass pagination configurations to `GET

<Note>

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).

</Note>

Expand Down Expand Up @@ -186,7 +186,7 @@ You'll now add the UI route that shows the paginated list of brands. A UI route

<Note>

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).

</Note>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ You'll now add a widget to the product-details page. A widget is a React compone

<Note>

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).

</Note>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ 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.

In this chapter, you'll define a module link between the `Brand` data model of the Brand Module, and the `Product` data model of the Product Module. In later chapters, you'll manage and retrieve linked product and brand records.

<Note>

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).

</Note>

Expand Down
Loading

0 comments on commit 0ae98c5

Please sign in to comment.