Skip to content

Commit

Permalink
docs: added dividers + see also section (medusajs#2899)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahednasser authored Dec 26, 2022
1 parent b0e5769 commit b0ebfd6
Show file tree
Hide file tree
Showing 100 changed files with 1,047 additions and 291 deletions.
24 changes: 21 additions & 3 deletions docs/content/add-plugins/algolia.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

In this document, you’ll learn how to install the [Algolia plugin](https://github.com/medusajs/medusa/tree/master/packages/medusa-plugin-algolia) and use it on both your Medusa Server and your storefront.

---

## Overview

[Algolia](https://www.algolia.com/) is a search engine service that allows developers to integrate advanced search functionalities into their websites including typo tolerance, recommended results, and quick responses.
Expand All @@ -10,6 +12,8 @@ Algolia can be used for a wide range of use cases, including ecommerce websites.

Through Medusa's flexible plugin system, it is possible to add a search engine to your Medusa server and storefront using Algolia with just a few steps.

---

## Prerequisites

### Medusa Components
Expand All @@ -28,6 +32,8 @@ If you don’t install and configure Redis on your Medusa server, the Algolia in

You need to [create an Algolia account](https://www.algolia.com/users/sign_up) before you follow this documentation. Algolia offers a free plan to get started quickly.

---

## Create an Algolia App

The first step is to create an Algolia app for your Medusa server. To create one, open the [Applications page](https://www.algolia.com/account/applications) or, on your dashboard, go to Settings then choose Applications.
Expand All @@ -50,6 +56,8 @@ In the last step, you’ll see a summary of your order. If all looks good, check

![Summary of your application's order with the terms and agreement checkboxes checked](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000019/Medusa%20Docs/Algolia/PTI2Swq_a1qbi5.png)

---

## Retrieve API Keys

To retrieve the API keys that you’ll use in the next sections, go to Settings, then choose API Keys in the Team and Access section.
Expand All @@ -66,6 +74,8 @@ If you have more than one application in your Algolia account, make sure you’r

![Application ID, Search-Only API Key, and Admin API Key can be found in the API Keys page](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000037/Medusa%20Docs/Algolia/i50Irki_jmtyk6.png)

---

## Install the Algolia Plugin

In the directory of your Medusa server, run the following command to install the Algolia plugin:
Expand Down Expand Up @@ -118,6 +128,8 @@ const plugins = [

The `searchableAttributes` are the attributes in a product that are searchable, and `attributesToRetrieve` are the attributes to retrieve for each product result. You’re free to make changes to these attributes as you see fit, but these are the recommended attributes.

---

## Test the Algolia Plugin

Run your Medusa server with the following command:
Expand Down Expand Up @@ -150,6 +162,8 @@ This feature is only available if you have Redis installed and configured with y

:::

---

## Add Search to your Storefront

In this section, you’ll learn how to add the UI on your storefront to allow searching with Algolia. This section has instructions for Medusa’s [Next.js](../starters/nextjs-medusa-starter.mdx) storefront as well as React-based frameworks such as the [Gatsby](../starters/gatsby-medusa-starter.mdx) storefront.
Expand Down Expand Up @@ -213,6 +227,8 @@ To make sure the Next.js storefront properly displays the products in the search

![Search pop up in the Next.js storefront](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000082/Medusa%20Docs/Algolia/1f9qqK6_c0z8zi.png)

---

## Add to Gatsby and React-Based Storefronts

This section covers adding the search UI to React-based storefronts. It uses the Gatsby storefront as an example, but you can use the same steps on any React-based framework.
Expand Down Expand Up @@ -327,7 +343,9 @@ If you run your Gatsby storefront while the Medusa server is running, you should

![Search bar in the Gatsby storefront](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000097/Medusa%20Docs/Algolia/INtlcIo_jlh16x.png)

## What’s Next
---

## See Also

- Learn how to [deploy your Medusa server](../deployments/server/index.mdx).
- Learn how to [deploy your Gatsby storefront](../deployments/storefront/deploying-gatsby-on-netlify.md).
- [Deploy your Medusa server](../deployments/server/index.mdx)
- [Deploy your Gatsby storefront](../deployments/storefront/deploying-gatsby-on-netlify.md)
14 changes: 11 additions & 3 deletions docs/content/add-plugins/contentful/customize-contentful.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ On your storefront, you can add any necessary components that can render the Con

As an example to explain this process, in this documentation, you’ll create a migration that creates a Rich Text content model in Contentful and edits the Page and Product content models to allow using Rich Text content as a tile in pages and products. Then, you’ll modify the Gatsby storefront to render the Rich Text content model.

---

## Prerequisites

It’s assumed you already have set up a Medusa server integrated with Contentful and have a Gatsby storefront integrated with Contentful. If not, [please follow this documentation first](index.md).

---

## Create a Contentful Migration

The Contentful migrations are located in the `contentful-migrations` directory in the Medusa Contentful server starter. So, if you want to create your own Contentful migrations, you can create them under that directory.
Expand Down Expand Up @@ -144,6 +148,8 @@ Similarly, you can add Rich Text content to any product page.

![A rich text content is added to a product](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001305/Medusa%20Docs/Contentful/wgI8mEB_wbukpd.png)

---

## Render New Content Models in the Storefront

After creating a new content model in your Contentful Space, you must add the necessary component to render it in your Gatsby storefront.
Expand Down Expand Up @@ -308,7 +314,9 @@ Restart the Gatsby storefront then open a product that you added Rich Text conte
![Rich Text content you added to the product should be visible at the end of the page](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001342/Medusa%20Docs/Contentful/LGiVMxx_rqsr2l.png)
## What’s Next
---
## See Also
- Learn how to deploy your Medusa server to [Heroku](../../deployments/server/deploying-on-heroku.mdx), [Qovery](../../deployments/server/deploying-on-qovery.md), or [DigitalOcean](../../deployments/server/deploying-on-digital-ocean.md).
- Learn [how to deploy your Gatsby storefront to Netlify](../../deployments/storefront/deploying-gatsby-on-netlify.md).
- Deploy your Medusa server to [Heroku](../../deployments/server/deploying-on-heroku.mdx), [Qovery](../../deployments/server/deploying-on-qovery.md), or [DigitalOcean](../../deployments/server/deploying-on-digital-ocean.md).
- [How to deploy your Gatsby storefront to Netlify](../../deployments/storefront/deploying-gatsby-on-netlify.md).
23 changes: 20 additions & 3 deletions docs/content/add-plugins/contentful/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ In this document, you’ll learn how to integrate a Medusa server with Contentfu

By integrating Contentful to Medusa, you can benefit from powerful features in your ecommerce store including detailed product CMS details, easy-to-use interface to use for static content and pages, localization, and much more.

---

## Prerequisites

### Needed Accounts
Expand All @@ -22,6 +24,8 @@ By integrating Contentful to Medusa, you can benefit from powerful features in y
- Gatsby’s CLI tool. You can follow [this documentation to install it](https://www.gatsbyjs.com/docs/reference/gatsby-cli/#how-to-use-gatsby-cli).
- Medusa’s CLI tool. You can follow [this documentation to install it](../../cli/reference.md#how-to-install-cli-tool).

---

## Install Medusa Server Using Contentful Starter

Instead of using the default Medusa Server starter, you must use the [Contentful starter](https://github.com/medusajs/medusa-starter-contentful) to install a server that is ready to be used with Contentful. This server contains all the necessary files to make the integration work.
Expand Down Expand Up @@ -181,10 +185,14 @@ If you seeded the database with demo data, you should see that events related to

The Contentful integration ensures a two-way sync between the Medusa server and Contentful. So, when new products are added to Medusa, these products will be added to your Contentful Space as well.

---

## (Optional) Add Products with the Medusa Admin

Using the Medusa admin, you can add products to your Medusa server. This will trigger product events that subsequently add these products to Contentful.

---

## Manage Contentful Data

### Publish Products
Expand Down Expand Up @@ -217,6 +225,8 @@ Once you’re done adding products, click on Publish changes in the right sideba

![Click on the publish changes button on the right](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001508/Medusa%20Docs/Contentful/URNpkXq_cb5ppp.png)

---

## Setup Gatsby Storefront

In this section, you’ll set up the Gatsby storefront of your Medusa server.
Expand Down Expand Up @@ -264,6 +274,8 @@ This starts the storefront at `localhost:8000`. Open it in your browser and you

![The storefront with the featured products section](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001537/Medusa%20Docs/Contentful/f6xwYbS_w1v993.png)

---

## Make Changes to Content

You can update the CMS content of your storefront in your Contentful Space. This includes the CMS pages or product details.
Expand All @@ -274,8 +286,13 @@ If you make changes to the data while your Gatsby storefront is running, the cha

:::

---

## What’s Next

- Learn [how to customize your Contentful server and storefront](./customize-contentful.md).
- Learn how to deploy your Medusa server to [Heroku](../../deployments/server/deploying-on-heroku.mdx), [Qovery](../../deployments/server/deploying-on-qovery.md), or [DigitalOcean](../../deployments/server/deploying-on-digital-ocean.md).
- Learn [how to deploy your Gatsby storefront to Netlify](../../deployments/storefront/deploying-gatsby-on-netlify.md).
Learn [How to customize your Contentful server and storefront](./customize-contentful.md).

## See Also

- How to deploy your Medusa server to [Heroku](../../deployments/server/deploying-on-heroku.mdx), [Qovery](../../deployments/server/deploying-on-qovery.md), or [DigitalOcean](../../deployments/server/deploying-on-digital-ocean.md).
- [How to deploy your Gatsby storefront to Netlify](../../deployments/storefront/deploying-gatsby-on-netlify.md).
10 changes: 9 additions & 1 deletion docs/content/add-plugins/klarna.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ In this document, you’ll learn how to integrate Klarna as a payment provider i

You can integrate Klarna into Medusa using the [official plugin](https://github.com/medusajs/medusa/tree/master/packages/medusa-payment-klarna).

---

## Prerequisites

### Medusa Components
Expand All @@ -20,6 +22,8 @@ In addition, you’ll need to use the [Medusa Admin](../admin/quickstart.mdx) to

- A [Klarna business account](https://portal.klarna.com/)

---

## Install Plugin

On your Medusa server, run the following command to install the plugin:
Expand Down Expand Up @@ -69,12 +73,16 @@ const plugins = [
];
```

---

## Enable Klarna in Regions

To use Klarna in your store, you must enable it in at least one region.

You can follow [this user guide to learn how to enable a payment provider in a region](../user-guide/regions/providers#manage-payment-providers). You can alternatively use the [REST APIs](/api/admin/#tag/Region/operation/PostRegionsRegionPaymentProviders).

## What’s Next
---

## See Also

- Check out [more plugins](https://github.com/medusajs/medusa/tree/master/packages) you can add to your store.
18 changes: 16 additions & 2 deletions docs/content/add-plugins/mailchimp.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ This plugin is only used to allow your customers to subscribe but does not actua

:::

---

## Prerequisites

Before going further with this guide make sure you have a Medusa server set up. You can follow the [Quickstart guide](https://docs.medusajs.com/quickstart/quick-start).

You also need a Mailchimp account, so please [create one](https://mailchimp.com/signup) before you start.

---

## Obtain Mailchimp Keys

To integrate the plugin into Medusa you need two keys: The API Key and the Newsletter list or Audience ID. The API Key acts as a credential for your account, whereas the Newsletter list ID determines which audience should the subscribed customers be added to.
Expand All @@ -28,6 +32,8 @@ You can follow [this guide](https://mailchimp.com/help/about-api-keys/#Find_or_g

You can follow [this guide](https://mailchimp.com/help/find-audience-id/) from Mailchimp’s documentation to obtain your Newsletter list or Audience ID.

---

## Install the Plugin

In the directory of your Medusa server, run the following command to install the Mailchimp plugin:
Expand Down Expand Up @@ -64,6 +70,8 @@ const plugins = [
];
```

---

## Test it Out

This plugin adds a new `POST` endpoint at `/mailchimp/subscribe`. This endpoint requires in the body of the request an `email` field. You can also optionally include a `data` object that holds any additional data you want to send to Mailchimp. You can check out [Mailchimp’s subscription documentation](https://mailchimp.com/developer/marketing/api/list-members/add-member-to-list/) for more details on the data you can send.
Expand Down Expand Up @@ -101,6 +109,8 @@ Here’s an example of sending additional data with the subscription:

All fields inside `data` will be sent to Mailchimp’s API along with the email.

---

## Use Mailchimp Service

If you want to subscribe to users without using this endpoint or at a specific place in your code, you can use Mailchimp’s service `mailchimpService` in your endpoints, services, or subscribers. This service has a method `subscribeNewsletter` which lets you use the subscribe functionality.
Expand All @@ -122,6 +132,8 @@ You can learn more about how you can use services in your endpoints, services, a

:::

---

## Add Subscription Form

This section has a simple example of adding a subscription form in your storefront. The code is for React-based frameworks but you can use the same logic for your storefronts regardless of the framework you are using.
Expand Down Expand Up @@ -177,7 +189,9 @@ This will result in a subscription form similar to the following:

If you try entering an email and clicking Subscribe, the email will be subscribed to your Mailchimp newsletter successfully.

## What’s Next
---

## See Also

- Check out [SendGrid plugin](../add-plugins/sendgrid.mdx) for more Email functionalities.
- [Learn more about plugins.](../advanced/backend/plugins/overview.md)
- [Plugins Overview](../advanced/backend/plugins/overview.md)
16 changes: 13 additions & 3 deletions docs/content/add-plugins/meilisearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ MeiliSearch also provides a pleasant developer experience, as it is extremely in

Through Medusa's flexible plugin system, it is possible to add a search engine to your Medusa server and storefront using MeiliSearch with just a few steps.

---

## Prerequisites

### Medusa Components
Expand All @@ -30,6 +32,8 @@ You must install MeiliSearch to use it with Medusa. You can follow [this documen

Furthermore, you should create a master key for your MeiliSearch instance. If you don’t have one created, follow [this guide](https://docs.meilisearch.com/learn/security/master_api_keys.html#protecting-a-meilisearch-instance) to create a master key.

---

## Install the MeiliSearch Plugin

In the directory of your Medusa server, run the following command to install the MeiliSearch plugin:
Expand Down Expand Up @@ -77,6 +81,8 @@ const plugins = [

You can change the `searchableAttributes` and `displayedAttributes` as you see fit. However, the attributes included are the recommended attributes.

---

## Test MeiliSearch Plugin

Make sure your MeiliSearch instance is running. If you’re unsure how to run it, you can check the [installation documentation](https://docs.meilisearch.com/learn/getting_started/quick_start.html#setup-and-installation) for the command to run the MeiliSearch instance.
Expand Down Expand Up @@ -105,6 +111,8 @@ This feature is only available if you have Redis installed and configured with y

:::

---

## Add Search to your Storefront

In this section, you’ll learn how to add the UI on your storefront to allow searching with MeiliSearch. This section has instructions for Medusa’s [Next.js](../starters/nextjs-medusa-starter.mdx) storefront as well as React-based frameworks such as the [Gatsby storefront](../starters/gatsby-medusa-starter.mdx).
Expand Down Expand Up @@ -286,7 +294,9 @@ If you run your Gatsby storefront while the Medusa server and the MeiliSearch in

![Search box in the header of the storefront](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000317/Medusa%20Docs/MeiliSearch/ZkRgF2h_ytnpv9.png)

## What’s Next
---

## See Also

- Learn how to [deploy your Medusa server](../deployments/server/index.mdx).
- Learn how to [deploy your Gatsby storefront](./../deployments/storefront/deploying-gatsby-on-netlify.md).
- [Deploy your Medusa server](../deployments/server/index.mdx).
- [Deploy your Gatsby storefront](./../deployments/storefront/deploying-gatsby-on-netlify.md).
16 changes: 15 additions & 1 deletion docs/content/add-plugins/minio.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ To manage images in Medusa, you need a file service plugin responsible for hosti

Medusa provides three different options to handle your file storage. This document will focus on setting up [MinIO](https://min.io) on your local machine and connecting Medusa to it.

---

## Prerequisites

A Medusa server is required to be set up before following along with this document. You can follow the [quickstart guide](../quickstart/quick-start.mdx) to get started in minutes.

---

## Set up MinIO

You can follow [MinIO’s guide to install it](https://docs.min.io/minio/baremetal/quickstart/quickstart.html) on your machine based on your operating system.
Expand Down Expand Up @@ -76,6 +80,8 @@ You will not be able to access the Secret Key after closing the pop-up. So, make

:::

---

## Plugin Installation

In the directory of your Medusa server, run the following command to install the MinIO plugin:
Expand Down Expand Up @@ -115,12 +121,16 @@ If you have multiple storage plugins configured, the last plugin declared in the

:::

---

## Test it Out

Run your Medusa server alongside the [Medusa Admin](../admin/quickstart.mdx) to try out your new file service. Upon editing or creating products, you can now upload thumbnails and images, that are stored in a MinIO server.

![Image Uploaded on Admin](https://res.cloudinary.com/dza7lstvk/image/upload/v1668000429/Medusa%20Docs/MinIO/alabX2i_dzg2mh.png)

---

## Private Buckets

### Handle Exports
Expand Down Expand Up @@ -181,6 +191,8 @@ Then, add two new options to the plugin’s options in `medusa-config.js`:
},
```

---

## Next.js Storefront Configuration

If you’re using a [Next.js](../starters/nextjs-medusa-starter.mdx) storefront, you need to add an additional configuration that adds the MinIO domain name into the configured images domain names. This is because all URLs of product images will be from the MinIO server.
Expand All @@ -207,6 +219,8 @@ module.exports = withStoreConfig({

Where `127.0.0.1` is the domain of your local MinIO server.

## What’s Next
---

## See Also

- Check out [more plugins](https://github.com/medusajs/medusa/tree/master/packages) you can add to your store.
Loading

0 comments on commit b0ebfd6

Please sign in to comment.