docs: add documentation for v1.8 (#3669)

This commit is contained in:
Shahed Nasser
2023-04-03 13:50:59 +02:00
committed by GitHub
parent 0cca13779d
commit c6bfad14d8
123 changed files with 7610 additions and 2697 deletions
@@ -83,20 +83,14 @@ Before you can deploy your Medusa backend you need to create a GitHub repository
On GitHub, click the plus icon at the top right, then click New Repository.
![Click plus then choose new repository from dropdown](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001782/Medusa%20Docs/Netlify/0YlxBRi_aiywpo.png)
Youll then be redirected to a new page with a form. In the form, enter the Repository Name then scroll down and click Create repository.
![New repository form](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001800/Medusa%20Docs/Netlify/YPYXAF2_lypjne.png)
### Push Code to GitHub Repository
The next step is to push the code to the GitHub repository you just created.
After creating the repository, youll be redirected to the repositorys page. On that page, you should see a URL that you can copy to connect your repository to a local directory.
![GitHub repository's URL](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001818/Medusa%20Docs/Netlify/pHfSTuT_w544lr.png)
Copy the link. Then, open your terminal in the directory that holds your Medusa backend codebase and run the following commands:
```bash
@@ -111,7 +105,7 @@ Then, add, commit, and push the changes into the repository:
```bash
git add .
git commit -m "initial commit"
git push origin master
git push
```
After pushing the changes, you can find the files in your GitHub repository.
@@ -197,13 +191,19 @@ NPM_CONFIG_PRODUCTION=false
NODE_ENV=production
```
:::caution
Its highly recommended to use strong, randomly generated secrets for `JWT_SECRET` and `COOKIE_SECRET`.
:::
Notice how for database environment variables you access the values from the database you created earlier `db`. If you changed the name of the database, you must change `db` here to the name you supplied to the PostgreSQL database.
Another thing to note here is that you added a `REDIS_URL` environment variable that uses a `redis` resource to retrieve the URL. Youll be creating this resource in a later section.
:::caution
:::note
Its highly recommended to use strong, randomly generated secrets for `JWT_SECRET` and `COOKIE_SECRET`.
If you're using modules that require setting environment variables, make sure to set them here. You can also add them later. For example, if you're using the Redis Event Bus module, you can set the environment variable for it here or use the same `REDIS_URL` variable. Your module may also require setting up other resources than those explained in this guide so make sure to add them as well.
:::
@@ -300,5 +300,5 @@ Once you click Save, the environment variables will be saved and a redeployment
## See Also
- [Deploy the Medusa Admin to Netlify](../admin/deploying-on-netlify.md).
- [Deploy the Gatsby Storefront to Netlify](../storefront/deploying-gatsby-on-netlify.md).
- [Deploy the Medusa Admin](../admin/index.mdx).
- [Deploy the Storefront](../storefront/index.mdx).
@@ -17,12 +17,6 @@ Alternatively, you can use this button to deploy the Medusa backend to Heroku di
<img src="https://www.herokucdn.com/deploy/button.svg" alt="Deploy to Heroku" className="no-zoom-img" />
</a>
<div>
<video width="100%" height="100%" playsinline autoplay muted controls>
<source src="https://user-images.githubusercontent.com/59018053/154798681-37060f13-5248-47c5-97c5-81c06da301d4.mp4" type="video/mp4" />
</video>
</div>
## Prerequisites
### Medusa Backend
@@ -148,6 +142,20 @@ If you're using the Heroku PostgreSQL Add-on, it should configure the environmen
However, if you use another add-on, make sure to set the environment variable `DATABASE_URL` to the PostgreSQL Database URL.
#### (Optional) Configure Modules Environment Variables
If you use in your Medusa backend modules that require setting environment variables, then you should set them at this point.
For example, if you use the Redis Event Bus module:
```bash
heroku config:set EVENT_REDIS_URL=<YOUR_REDIS_URL>
```
Make sure to change `EVENT_REDIS_URL` to the environment variable name you use for your module's configurations.
If your module requires setting up other services, do that then add the environment variables.
#### (Optional) Configure CORS Variables
Optionally, if you've deployed the admin dashboard and you want to ensure it can use the backend's REST APIs, you must set the following environment variable:
@@ -51,20 +51,14 @@ Before you can deploy your Medusa backend you need to create a GitHub repository
On GitHub, click the plus icon at the top right, then click New Repository.
![Click plus icon at the top right](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001782/Medusa%20Docs/Netlify/0YlxBRi_aiywpo.png)
Youll then be redirected to a new page with a form. In the form, enter the Repository Name then scroll down and click Create repository.
![An image of the Create Repository form](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001800/Medusa%20Docs/Netlify/YPYXAF2_lypjne.png)
### Push Code to GitHub Repository
The next step is to push the code to the GitHub repository you just created.
After creating the repository, youll be redirected to the repositorys page. On that page, you should see a URL that you can copy to connect your repository to a local directory.
![An image of the GitHub URL in a new repository](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001818/Medusa%20Docs/Netlify/pHfSTuT_w544lr.png)
Copy the link. Then, open your terminal in the directory that holds your Medusa backend codebase and run the following commands:
```bash
@@ -79,7 +73,7 @@ Then, add, commit, and push the changes into the repository:
```bash
git add .
git commit -m "initial commit"
git push origin master
git push
```
After pushing the changes, you can find the files in your GitHub repository.
@@ -118,7 +112,7 @@ You need to add some variables to use for your Medusa deployment to Qovery.
In the root directory of your Medusa backend, create the file `variables.tf` with the following content:
```
```tf
variable "qovery_organization_id" {
type = string
nullable = false
@@ -255,6 +249,12 @@ Heres an explanation of each of the variables and how to retrieve their varia
- `git_branch`: The branch to use in the GitHub repo. By default its `master`.
- `git_root_path`: The root path of the Medusa backend. By default, its `/`. If you are hosting your Medusa backend in a monorepo in a nested directory, you need to change the value of this variable.
:::note
If you're using modules that require setting up other variables, you can add them here.
:::
### Add Terraform Configuration File
In the root directory of your Medusa backend, create the file `main.tf` with the following content:
@@ -422,6 +422,12 @@ resource "qovery_application" "medusa_app" {
}
```
:::note
If you're using modules that require setting up other resources, make sure to add them here.
:::
This is a Terraform configuration file that creates all the resources necessary to deploy Medusa to Qovery. If you set `qovery_create_cluster` to `true`, it will create new credentials and a cluster in your Qovery organization using the AWS credentials you set in the variables.
Next, it creates a new project, environment, PostgreSQL database, and a Redis database in your Qovery organization.
@@ -521,5 +527,5 @@ To add environment variables, in your [Qovery Console](https://console.qovery.co
## See Also
- [Deploy the Medusa Admin to Netlify](../admin/deploying-on-netlify.md)
- [Deploy the Gatsby Storefront to Netlify](../storefront/deploying-gatsby-on-netlify.md)
- [Deploy the Medusa Admin](../admin/index.mdx)
- [Deploy the Storefront](../storefront/index.mdx)
@@ -48,20 +48,14 @@ Before you can deploy your Medusa backend you need to create a GitHub repository
On GitHub, click the plus icon at the top right, then click New Repository.
![Click plus then choose new repository from dropdown](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001782/Medusa%20Docs/Netlify/0YlxBRi_aiywpo.png)
Youll then be redirected to a new page with a form. In the form, enter the Repository Name then scroll down and click Create repository.
![New repository form](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001800/Medusa%20Docs/Netlify/YPYXAF2_lypjne.png)
### Push Code to GitHub Repository
The next step is to push the code to the GitHub repository you just created.
After creating the repository, youll be redirected to the repositorys page. On that page, you should see a URL that you can copy to connect your repository to a local directory.
![GitHub repository's URL](https://res.cloudinary.com/dza7lstvk/image/upload/v1668001818/Medusa%20Docs/Netlify/pHfSTuT_w544lr.png)
Copy the link. Then, open your terminal in the directory that holds your Medusa backend codebase and run the following commands:
```bash
@@ -76,7 +70,7 @@ Then, add, commit, and push the changes into the repository:
```bash
git add .
git commit -m "initial commit"
git push origin master
git push
```
After pushing the changes, you can find the files in your GitHub repository.
@@ -118,6 +112,11 @@ To find the Redis database URL which youll need later:
2. Choose the Connect tab.
3. Copy the Redis Connection URL.
### Note about Modules
If you use modules that require setting up other resources, make sure to add them at this point. This guide does not cover configurations specific to a module.
### Deploy the Medusa Backend Repository
In the same project view:
@@ -217,5 +216,5 @@ For example, you can run commands on the backend to seed the database or create
## See Also
- [Deploy the Medusa Admin to Netlify](../admin/deploying-on-netlify.md)
- [Deploy the Medusa Admin](../admin/index.mdx)
- [Deploy the Gatsby Storefront to Netlify](../storefront/deploying-gatsby-on-netlify.md)