Skip to content

Commit

Permalink
update diagrams and text
Browse files Browse the repository at this point in the history
  • Loading branch information
shahednasser committed Sep 24, 2024
1 parent 7fa98c0 commit 07b62aa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Since modules are interchangeable, you have more control over Medusa’s archite

There are different architectural module types including:

![Diagram illustrating how the modules connect to third-party services](https://res.cloudinary.com/dza7lstvk/image/upload/v1716197340/Medusa%20Book/architectural-modules_bj9bb9.jpg)
![Diagram illustrating how the modules connect to third-party services](https://res.cloudinary.com/dza7lstvk/image/upload/v1727095814/Medusa%20Book/architectural-modules_bj9bb9.jpg)

- Cache Module: Defines the caching mechanism or logic to cache computational results.
- Event Module: Integrates a pub/sub service to handle subscribing to and emitting events.
Expand Down
20 changes: 9 additions & 11 deletions www/apps/book/app/architecture/overview/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ export const metadata = {

In this chapter, you'll learn about the architectural layers in Medusa.

## API Layer
## HTTP, Workflow, and Module Layers

Medusa's server is headless. So, clients, such as storefronts or admin dashboards, send HTTP requests to Medusa's API routes to provide commerce features.
Medusa's server is headless. So, clients, such as storefronts or admin dashboards, send HTTP requests to Medusa's API routes to consume commerce features.

The API routes use the Medusa framework's tools to perform functionalities implemented in Medusa's commerce modules.
The API routes use workflows, powered by Medusa's workflows SDK, to perform functionalities implemented in commerce and architectural modules.

The framework tools include workflows, module links, Query, architectural modules, and more orchestration tools under-the-hood.

![Diagram illustrating the HTTP layer](https://res.cloudinary.com/dza7lstvk/image/upload/v1727094282/http-layer_sroafr.jpg)
![Diagram illustrating the HTTP layer](https://res.cloudinary.com/dza7lstvk/image/upload/v1727175296/Medusa%20Book/http-layer_sroafr.jpg)

---

Expand All @@ -24,11 +22,11 @@ The Medusa application injects into each module a connection to the configured P

Modules use that connection to read and write data to the database.

![Diagram illustrating the database layer](https://res.cloudinary.com/dza7lstvk/image/upload/v1727094431/db-layer_pi7tix.jpg)
![Diagram illustrating the database layer](https://res.cloudinary.com/dza7lstvk/image/upload/v1727175379/Medusa%20Book/db-layer_pi7tix.jpg)

---

## Service Layer
## Service Integrations

Third-party services are integrated through commerce and architectural modules.

Expand All @@ -40,18 +38,18 @@ Commerce modules integrate third-party services relevant for commerce or user-fa

These integrations are used when an HTTP request is sent, or as a result of a scheduled action or an emitted event.

![Diagram illustrating the commerce modules integration to third-party services](https://res.cloudinary.com/dza7lstvk/image/upload/v1727095115/service-commerce_qcbdsl.jpg)
![Diagram illustrating the commerce modules integration to third-party services](https://res.cloudinary.com/dza7lstvk/image/upload/v1727175357/Medusa%20Book/service-commerce_qcbdsl.jpg)

### Architectural Modules

Architectural modules integrate third-party services and systems for architectural features. For example, you integrate Redis as a pub/sub service to send events, or SendGrid to send notifications.

![Diagram illustrating the architectural modules integration to third-party services and systems](https://res.cloudinary.com/dza7lstvk/image/upload/v1727095146/service-arch_ozvryw.jpg)
![Diagram illustrating the architectural modules integration to third-party services and systems](https://res.cloudinary.com/dza7lstvk/image/upload/v1727175342/Medusa%20Book/service-arch_ozvryw.jpg)

---

## Full Diagram of Medusa's Architecture

The following diagram illustrates Medusa's architecture over the three layers.

![Full diagram illustrating Medusa's architecture](https://res.cloudinary.com/dza7lstvk/image/upload/v1727095208/architectural-diagram-full.jpg)
![Full diagram illustrating Medusa's architecture](https://res.cloudinary.com/dza7lstvk/image/upload/v1727174897/Medusa%20Book/architectural-diagram-full.jpg)

0 comments on commit 07b62aa

Please sign in to comment.