docs: publish restructure (#3496)

* docs: added features and guides overview page

* added image

* added version 2

* added version 3

* added version 4

* docs: implemented new color scheme

* docs: redesigned sidebar (#3193)

* docs: redesigned navbar for restructure (#3199)

* docs: redesigned footer (#3209)

* docs: redesigned cards (#3230)

* docs: redesigned admonitions (#3231)

* docs: redesign announcement bar (#3236)

* docs: redesigned large cards (#3239)

* docs: redesigned code blocks (#3253)

* docs: redesigned search modal and page (#3264)

* docs: redesigned doc footer (#3268)

* docs: added new sidebars + refactored css and assets (#3279)

* docs: redesigned api reference sidebar

* docs: refactored css

* docs: added code tabs transition

* docs: added new sidebars

* removed unused assets

* remove unusued assets

* Fix deploy errors

* fix incorrect link

* docs: fixed code responsivity + missing icons (#3283)

* docs: changed icons (#3296)

* docs: design fixes to the sidebar (#3297)

* redesign fixes

* docs: small design fixes

* docs: several design fixes after restructure (#3299)

* docs: bordered icon fixes

* docs: desgin fixes

* fixes to code blocks and sidebar scroll

* design adjustments

* docs: restructured homepage (#3305)

* docs: restructured homepage

* design fixes

* fixed core concepts icon

* docs: added core concepts page (#3318)

* docs: restructured homepage

* design fixes

* docs: added core concepts page

* changed text of different components

* docs: added architecture link

* added missing prop for user guide

* docs: added regions overview page (#3327)

* docs: added regions overview

* moved region pages to new structure

* docs: fixed description of regions architecture page

* small changes

* small fix

* docs: added customers overview page (#3331)

* docs: added regions overview

* moved region pages to new structure

* docs: fixed description of regions architecture page

* small changes

* small fix

* docs: added customers overview page

* fix link

* resolve link issues

* docs: updated regions architecture image

* docs: second-iteration fixes (#3347)

* docs: redesigned document

* design fixes

* docs: added products overview page (#3354)

* docs: added carts overview page (#3363)

* docs: added orders overview (#3364)

* docs: added orders overview

* added links in overview

* docs: added vercel redirects

* docs: added soon badge for cards (#3389)

* docs: resolved feedback changes + organized troubleshooting pages (#3409)

* docs: resolved feedback changes

* added extra line

* docs: changed icons for restructure (#3421)

* docs: added taxes overview page (#3422)

* docs: added taxes overview page

* docs: fix sidebar label

* added link to taxes overview page

* fixed link

* docs: fixed sidebar scroll (#3429)

* docs: added discounts overview (#3432)

* docs: added discounts overview

* fixed links

* docs: added gift cards overview (#3433)

* docs: added price lists overview page (#3440)

* docs: added price lists overview page

* fixed links

* docs: added sales channels overview page (#3441)

* docs: added sales overview page

* fixed links

* docs: added users overview (#3443)

* docs: fixed sidebar border height (#3444)

* docs: fixed sidebar border height

* fixed svg markup

* docs: added possible solutions to feedback component (#3449)

* docs: added several overview pages + restructured files (#3463)

* docs: added several overview pages

* fixed links

* docs: added feature flags + PAK overview pages (#3464)

* docs: added feature flags + PAK overview pages

* fixed links

* fix link

* fix link

* fixed links colors

* docs: added strategies overview page (#3468)

* docs: automated upgrade guide (#3470)

* docs: automated upgrade guide

* fixed vercel redirect

* docs: restructured files in docs codebase (#3475)

* docs: restructured files

* docs: fixed eslint exception

* docs: finished restructure loose-ends (#3493)

* fixed uses of backend

* docs: finished loose ends

* eslint fixes

* fixed links

* merged master

* added update instructions for v1.7.12
This commit is contained in:
Shahed Nasser
2023-03-16 17:03:10 +02:00
committed by GitHub
parent f312ce1e0f
commit 1decaa27c7
415 changed files with 12422 additions and 5098 deletions

View File

@@ -3,24 +3,24 @@ description: 'Learn step-by-step.'
addHowToData: true
---
# Deploy Your Medusa Server to DigitalOcean Apps
# Deploy Your Medusa Backend to DigitalOcean Apps
In this document, you'll learn how to deploy your Medusa server to a DigitalOcean App.
In this document, you'll learn how to deploy your Medusa backend to a DigitalOcean App.
DigitalOcean is a reliable hosting provider that provides different ways to host websites and servers. One way to host a server is using their DigitalOcean App Platform.
DigitalOcean is a reliable hosting provider that provides different ways to host websites and servers. One way to host a backend is using their DigitalOcean App Platform.
## Prerequisites
### Medusa Server
### Medusa Backend
It is assumed that you already have a Medusa server installed locally. If you dont, please follow the [quickstart guide](../../quickstart/quick-start.mdx).
It is assumed that you already have a Medusa backend installed locally. If you dont, please follow the [quickstart guide](../../development/backend/install.mdx).
Furthermore, your Medusa server should be configured to work with PostgreSQL and Redis. You can follow the [Configure your Server documentation](../../usage/configurations.md) to learn how to do that.
Furthermore, your Medusa backend should be configured to work with PostgreSQL and Redis. You can follow the [Configure your Backend documentation](../../development/backend/configurations.md) to learn how to do that.
### Needed Accounts
- A [DigitalOcean](https://cloud.digitalocean.com/registrations/new) account. You need to provide a payment method on sign up.
- A [GitHub](https://github.com/) account to create a repository to host your servers codebase.
- A [GitHub](https://github.com/) account to create a repository to host your Medusa backends codebase.
:::tip
@@ -30,7 +30,7 @@ If you want to use another Git Provider supported by DigitalOcean, its possib
### Required Tools
- Gits CLI tool. You can follow [this documentation to learn how to install it for your operating system](../../tutorial/0-set-up-your-development-environment.mdx#git).
- Gits CLI tool. You can follow [this documentation to learn how to install it for your operating system](../../development/backend/prepare-environment.mdx#git).
---
@@ -42,7 +42,7 @@ Change the `start` script in `package.json` to the following:
"start": "medusa migrations run && medusa start"
```
This ensures that Migrations are run everytime the Medusa server is restarted.
This ensures that Migrations are run everytime the Medusa backend is restarted.
---
@@ -79,7 +79,7 @@ module.exports = {
## Create GitHub Repository
Before you can deploy your Medusa server you need to create a GitHub repository and push the code base to it.
Before you can deploy your Medusa backend you need to create a GitHub repository and push the code base to it.
On GitHub, click the plus icon at the top right, then click New Repository.
@@ -97,7 +97,7 @@ After creating the repository, youll be redirected to the repositorys page
![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 server codebase and run the following commands:
Copy the link. Then, open your terminal in the directory that holds your Medusa backend codebase and run the following commands:
```bash
git init
@@ -138,7 +138,7 @@ Additional inputs will show up to choose the Branch, Source Directory, and Autod
![Enter master for Branch input, backslash for Source Directory, and check Autodeploy](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002055/Medusa%20Docs/Digital%20Ocean/kjk9E2B_qpwrx4.png)
If you host your Medusa server in a monorepo, you should change the Source Directory to the directory the server is available in the repository. Otherwise, it can be left as is.
If you host your Medusa backend in a monorepo, you should change the Source Directory to the directory the backend is available in the repository. Otherwise, it can be left as is.
Once youre done, click Next to move on to the next step.
@@ -148,7 +148,7 @@ In the next step, youll see the resources to create.
![List of resources showing a docker resource and web service resource](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002067/Medusa%20Docs/Digital%20Ocean/6TlpWB9_wfppc7.png)
If you have a Dockerfile available in the servers codebase (which is available by default), youll have two resources showing. You can remove it by clicking on the trash icon at the right of the resource.
If you have a Dockerfile available in the backends codebase (which is available by default), youll have two resources showing. You can remove it by clicking on the trash icon at the right of the resource.
By default, DigitalOcean hosts the web service in a sub-path of the domain name of the created App. To change it to the root of the domain, click on the edit icon at the right of the Web Service resource.
@@ -176,7 +176,7 @@ Once youre done, click Next to move on to the next step.
### Set Environment Variables
In this section, youll add environment variables that are essential to your Medusa server.
In this section, youll add environment variables that are essential to your Medusa backend.
You should see two ways to add environment variables: Global or specific to the Web Service.
@@ -221,7 +221,7 @@ In the final step, you can see a review of everything you created. If everything
### Create Redis Resource
While the server is being deployed, you can create the Redis resource.
While the backend is being deployed, you can create the Redis resource.
Click the Create button at the top right and choose Database from the dropdown.
@@ -253,7 +253,7 @@ Once youre done click Attach Database. This will add the Redis database to th
---
## Test your Server
## Test your Backend
Once the redeployment is complete, copy the URL of the App which can be found under the Apps name.
@@ -265,9 +265,9 @@ Then, go to `<YOUR_APP_URL>/store/products`. If the deployment was successful, y
---
## Run Commands on Your Server
## Run Commands on Your Backend
To run commands on your server, you can access the console on the Apps page by choosing the Console tab. This opens a console in your browser where you can run commands on your server.
To run commands on your backend, you can access the console on the Apps page by choosing the Console tab. This opens a console in your browser where you can run commands on your backend.
For example, you can run the following commands to create a new admin user:

View File

@@ -7,14 +7,14 @@ import styles from '../deployment.module.css';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Deploy Your Medusa Server on Heroku
# Deploy Your Medusa Backend on Heroku
In this document, you'll learn how to deploy your Medusa server on Heroku. Heroku is a PaaS (Platform as a Service) that allows you to easily deploy your applications in the cloud.
In this document, you'll learn how to deploy your Medusa backend on Heroku. Heroku is a PaaS (Platform as a Service) that allows you to easily deploy your applications in the cloud.
Alternatively, you can use this button to deploy the Medusa server to Heroku directly:
Alternatively, you can use this button to deploy the Medusa backend to Heroku directly:
<a href="https://heroku.com/deploy?template=https://github.com/medusajs/medusa-starter-default/tree/feat/deploy-heroku" class="img-url">
<img src="https://www.herokucdn.com/deploy/button.svg" alt="Deploy to Heroku" class="no-zoom-img" />
<a href="https://heroku.com/deploy?template=https://github.com/medusajs/medusa-starter-default/tree/feat/deploy-heroku" className="img-url">
<img src="https://www.herokucdn.com/deploy/button.svg" alt="Deploy to Heroku" className="no-zoom-img" />
</a>
<div>
@@ -25,11 +25,11 @@ Alternatively, you can use this button to deploy the Medusa server to Heroku dir
## Prerequisites
### Medusa Server
### Medusa Backend
It is assumed that you already have a Medusa server installed locally. If you dont, please follow the [quickstart guide](../../quickstart/quick-start.mdx).
It is assumed that you already have a Medusa backend installed locally. If you dont, please follow the [quickstart guide](../../development/backend/install.mdx).
Furthermore, your Medusa server should be configured to work with PostgreSQL and Redis. You can follow the [Configure your Server documentation](../../usage/configurations.md) to learn how to do that.
Furthermore, your Medusa backend should be configured to work with PostgreSQL and Redis. You can follow the [Configure your Backend documentation](../../development/backend/configurations.md) to learn how to do that.
### Needed Accounts
@@ -37,7 +37,7 @@ Furthermore, your Medusa server should be configured to work with PostgreSQL and
### Required Tools
- Gits CLI tool. You can follow [this documentation to learn how to install it for your operating system](../../tutorial/0-set-up-your-development-environment.mdx#git).
- Gits CLI tool. You can follow [this documentation to learn how to install it for your operating system](../../development/backend/prepare-environment.mdx#git).
- Heroku's CLI tool. You can follow [Heroku's documentation to learn how to install it for your operating system](https://devcenter.heroku.com/articles/heroku-cli).
---
@@ -56,7 +56,7 @@ Depending on your operating system, you must follow either the instructions in y
### 2. Create an App with Heroku
In the root directory of your Medusa server, run the following commands to create an app on Heroku and add it as a remote origin:
In the root directory of your Medusa backend, run the following commands to create an app on Heroku and add it as a remote origin:
```bash
heroku create <APP_NAME>
@@ -97,9 +97,9 @@ This uses the lowest plan in Stackhero Redis. You can check out [the plans and p
### 4. Configure Environment Variables on Heroku
Medusa requires a set of environment variables to be configured. You can learn more about Medusa's configurations in the [Configure your Medusa Server](../../usage/configurations.md) document.
Medusa requires a set of environment variables to be configured. You can learn more about Medusa's configurations in the [Configure your Medusa backend](../../development/backend/configurations.md) document.
Run the following commands in the root directory of your Medusa server to set some environment variables:
Run the following commands in the root directory of your Medusa backend to set some environment variables:
```bash
heroku config:set NODE_ENV=production
@@ -150,7 +150,7 @@ However, if you use another add-on, make sure to set the environment variable `D
#### (Optional) Configure CORS Variables
Optionally, if you've deployed the admin dashboard and you want to ensure it can use the server's REST APIs, you must set the following environment variable:
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:
```bash
heroku config:set ADMIN_CORS=<YOUR_ADMIN_URL>
@@ -158,7 +158,7 @@ heroku config:set ADMIN_CORS=<YOUR_ADMIN_URL>
Where `<YOUR_ADMIN_URL>` is the URL of your admin dashboard.
Similarly, if you've deployed the storefront and you want to ensure it can use the server's REST APIs, you must set the following environment variable:
Similarly, if you've deployed the storefront and you want to ensure it can use the backend's REST APIs, you must set the following environment variable:
```bash
heroku config:set STORE_CORS=<YOUR_STOREFRONT_URL>
@@ -166,9 +166,9 @@ heroku config:set STORE_CORS=<YOUR_STOREFRONT_URL>
Where `<YOUR_STOREFRONT_URL>` is the URL of your storefront.
### 5. Configure Medusa Server
### 5. Configure Medusa Backend
Before jumping into the deployment, you need to configure your Medusa server to ensure it uses the previous environment variables and the recommended production configurations.
Before jumping into the deployment, you need to configure your Medusa backend to ensure it uses the previous environment variables and the recommended production configurations.
#### medusa-config.js
@@ -205,21 +205,21 @@ Update `scripts` to include the following scripts:
},
```
### 6. Launch your Medusa Server
### 6. Launch your Medusa Backend
Finally, commit and push all changes to Heroku:
```bash
git add .
git commit -m "Deploy Medusa Server on Heroku"
git commit -m "Deploy Medusa Backend on Heroku"
git push heroku HEAD:master
```
This triggers a redeploy of the Medusa server with all the new configurations.
This triggers a redeploy of the Medusa backend with all the new configurations.
## Test your Server
## Test your Backend
To test your server, run the following command to retrieve the server's URL:
To test your backend, run the following command to retrieve the backend's URL:
```bash
heroku apps:info -a <APP_NAME>
@@ -227,13 +227,13 @@ heroku apps:info -a <APP_NAME>
Where `<APP_NAME>` is the name of the app. You should see as the output a bunch of info of the app.
The server's URL is available under "Web URL". You can copy it and perform requests to it to test it out.
The backend's URL is available under "Web URL". You can copy it and perform requests to it to test it out.
For example, you can send a request to `<YOUR_SERVER_URL>/store/products` and you should receive a JSON response with the products in your store.
For example, you can send a request to `<YOUR_BACKEND_URL>/store/products` and you should receive a JSON response with the products in your store.
### Troubleshooting: Inspect Build Logs
If an error occurs during the deployment, you can explore your Heroku app build logs using the following command in the root directory of your Medusa server:
If an error occurs during the deployment, you can explore your Heroku app build logs using the following command in the root directory of your Medusa backend:
```bash
heroku logs -n 500000 --remote heroku --tail -a <APP_NAME>
@@ -243,9 +243,9 @@ Where `<APP_NAME>` is the name of the app.
---
## Run Commands on Your Server
## Run Commands on Your Backend
To run commands on your server, you can use the following command:
To run commands on your backend, you can use the following command:
```bash
heroku run -a <APP_NAME> -- <COMMAND>

View File

@@ -3,9 +3,9 @@ description: 'Learn step-by-step.'
addHowToData: true
---
# Deploy Your Medusa Server on Qovery
# Deploy Your Medusa Backend on Qovery
In this document, you'll learn how to deploy your Medusa server on Qovery with the help of Terraform.
In this document, you'll learn how to deploy your Medusa backend on Qovery with the help of Terraform.
[Qovery](https://www.qovery.com/) is a Continuous Deployment Platform that provides you with the developer experience of Heroku on top of your cloud provider (For example, AWS, DigitalOcean).
@@ -19,17 +19,17 @@ This tutorial explains how to deploy Medusa to a Qovery organization with an AWS
## Prerequisites
### Medusa Server
### Medusa Backend
It is assumed that you already have a Medusa server installed locally. If you dont, please follow the [quickstart guide](../../quickstart/quick-start.mdx).
It is assumed that you already have a Medusa backend installed locally. If you dont, please follow the [quickstart guide](../../development/backend/install.mdx).
Furthermore, your Medusa server should be configured to work with PostgreSQL and Redis. You can follow the [Configure your Server documentation](../../usage/configurations.md) to learn how to do that.
Furthermore, your Medusa backend should be configured to work with PostgreSQL and Redis. You can follow the [Configure your Backend documentation](../../development/backend/configurations.md) to learn how to do that.
### Needed Accounts
- A [Qovery](https://start.qovery.com/) account with a created organization. Qovery provides a free plan that you can use.
- An [AWS](https://aws.amazon.com/) account that youll connect to a Qovery cluster.
- A [GitHub](https://github.com/) account to create a repository to host your servers codebase.
- A [GitHub](https://github.com/) account to create a repository to host your backend's codebase.
:::tip
@@ -39,7 +39,7 @@ If you want to use another [Git Provider supported by Qovery](https://hub.qovery
### Required Tools
- Gits CLI tool. You can follow [this documentation to learn how to install it for your operating system](../../tutorial/0-set-up-your-development-environment.mdx#git).
- Gits CLI tool. You can follow [this documentation to learn how to install it for your operating system](../../development/backend/prepare-environment.mdx#git).
- Terraforms CLI tool. You can follow [this guide to install it based on your operating system](https://www.terraform.io/downloads).
- Qoverys CLI tool. You can follow [this guide to install it based on your operating system](https://hub.qovery.com/docs/using-qovery/interface/cli/#install).
@@ -47,7 +47,7 @@ If you want to use another [Git Provider supported by Qovery](https://hub.qovery
## Create GitHub Repository
Before you can deploy your Medusa server you need to create a GitHub repository and push the code base to it.
Before you can deploy your Medusa backend you need to create a GitHub repository and push the code base to it.
On GitHub, click the plus icon at the top right, then click New Repository.
@@ -65,7 +65,7 @@ After creating the repository, youll be redirected to the repositorys page
![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 server codebase and run the following commands:
Copy the link. Then, open your terminal in the directory that holds your Medusa backend codebase and run the following commands:
```bash
git init
@@ -88,7 +88,7 @@ After pushing the changes, you can find the files in your GitHub repository.
## Deploy to Qovery
In this section, youll learn how to deploy your Medusa server to Qovery with the help of Terraform.
In this section, youll learn how to deploy your Medusa backend to Qovery with the help of Terraform.
### Sign in Using Qovery CLI
@@ -116,7 +116,7 @@ Youll be prompted to choose an organization and add a name and description fo
You need to add some variables to use for your Medusa deployment to Qovery.
In the root directory of your Medusa server, create the file `variables.tf` with the following content:
In the root directory of your Medusa backend, create the file `variables.tf` with the following content:
```
variable "qovery_organization_id" {
@@ -245,19 +245,19 @@ git_root_path = "/"
Heres an explanation of each of the variables and how to retrieve their variables:
- `qovery_organization_id`: The ID of the Qovery organization to deploy the server to. It can be found by logging into your [Qovery Console](https://console.qovery.com/). Youll be redirected to the organizations main page with a URL of the format `https://console.qovery.com/platform/organization/<ORGANIZATION_ID>/projects`. Copy the `<ORGANIZATION_ID>` in the URL to use as the value of this field.
- `qovery_organization_id`: The ID of the Qovery organization to deploy the backend to. It can be found by logging into your [Qovery Console](https://console.qovery.com/). Youll be redirected to the organizations main page with a URL of the format `https://console.qovery.com/platform/organization/<ORGANIZATION_ID>/projects`. Copy the `<ORGANIZATION_ID>` in the URL to use as the value of this field.
- `qovery_create_cluster`: A boolean value indicating whether a new cluster should be created or not. If you already have a cluster that you want to use, you can set the value to `false` and set the value of `qovery_cluster_id`. Otherwise, set the value to `true` and set the values of `aws_access_key_id`, `aws_secret_access_key`, and `aws_region`.
- `qovery_cluster_id`: The ID of the existing cluster to use (if `qovery_create_cluster` is set to `false`). You can use [Qoverys REST API](https://api-doc.qovery.com/#tag/Clusters/operation/listOrganizationCluster) to retrieve the cluster ID. You can use the token you generated earlier for the Bearer authorization token as explained [here](https://hub.qovery.com/docs/using-qovery/interface/cli/#generate-api-token).
- `aws_access_key_id`, `aws_secret_access_key`, and `aws_region`: The credentials used to create the cluster (if `qovery_create_cluster` is set to `true`). You can refer to [this guide](https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys) to learn how to retrieve the `aws_access_key_id` and `aws_secret_access_key`.
- `medusa_jwt_secret`: The value of the JSON Web Token (JWT) Secret on your Medusa server. Its recommended to use a strong randomly generated string.
- `medusa_cookie_secret`: The value of the Cookie Secret on your Medusa server. Its recommended to use a strong randomly generated string.
- `medusa_jwt_secret`: The value of the JSON Web Token (JWT) Secret on your Medusa backend. Its recommended to use a strong randomly generated string.
- `medusa_cookie_secret`: The value of the Cookie Secret on your Medusa backend. Its recommended to use a strong randomly generated string.
- `git_url`: The URL of the Git repository you created earlier. Make sure it ends with `.git`.
- `git_branch`: The branch to use in the GitHub repo. By default its `master`.
- `git_root_path`: The root path of the Medusa server. By default, its `/`. If you are hosting your Medusa server in a monorepo in a nested directory, you need to change the value of this variable.
- `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.
### Add Terraform Configuration File
In the root directory of your Medusa server, create the file `main.tf` with the following content:
In the root directory of your Medusa backend, create the file `main.tf` with the following content:
```bash
# Install the Qovery Terraform provider
@@ -430,25 +430,25 @@ Finally, it creates the Medusa app and sets all the necessary environment variab
:::tip
This deployment uses Docker. By default, you should have the files [`Dockerfile`](https://github.com/medusajs/medusa-starter-default/blob/master/Dockerfile) and [`docker-compose.yml`](https://github.com/medusajs/medusa-starter-default/blob/master/docker-compose.yml)` in the root of your Medusa server.
This deployment uses Docker. By default, you should have the files [`Dockerfile`](https://github.com/medusajs/medusa-starter-default/blob/master/Dockerfile) and [`docker-compose.yml`](https://github.com/medusajs/medusa-starter-default/blob/master/docker-compose.yml)` in the root of your Medusa backend.
:::
### Change develop.sh
The `Dockerfile` runs the file `develop.sh` to start the server. Change the content of `develop.sh` to the following:
The `Dockerfile` runs the file `develop.sh` to start the backend. Change the content of `develop.sh` to the following:
```bash
#!/bin/bash
#Run migrations to ensure the database is updated
# Run migrations to ensure the database is updated
medusa migrations run
#Start production server
# Run backend
medusa start
```
This makes sure the production server is started and not a development server.
This makes sure the production backend is started and not a development backend.
### Initialize Terraform
@@ -480,19 +480,19 @@ If you run into any errors while running this command, you can just re-run it af
---
## Test your Server
## Test the Backend
Once the command finishes and the deployment is successful, you can access your server in the [Qovery Console](https://console.qovery.com/). Go to the project, environment, then the app that you created using Terraform and Qovery. In the app, click the Open button at the top right to open your website in a new tab.
Once the command finishes and the deployment is successful, you can access your backend in the [Qovery Console](https://console.qovery.com/). Go to the project, environment, then the app that you created using Terraform and Qovery. In the app, click the Open button at the top right to open your website in a new tab.
![open button at the top right](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002245/Medusa%20Docs/Qovery/Ji59ZSJ_nrkpvb.png)
You can access any of the endpoints on your server using the server URL. For example, you can get the list of products using the endpoint `/store/products`.
You can access any of the endpoints on your backend using the backend URL. For example, you can get the list of products using the endpoint `/store/products`.
---
## Run Commands on Your Server
## Run Commands on the Backend
To run commands on your server, run the following command:
To run commands on the backend, run the following command:
```bash
qovery shell
@@ -500,7 +500,7 @@ qovery shell
Youll be asked to either confirm the existing context or choose a new context.
After choosing your Medusa app in the context, you should be able to execute any command in the directory of your Medusa server. For example, you can run the [`user` command using Medusas CLI tool to create a new user](../../cli/reference.md#user):
After choosing your Medusa app in the context, you should be able to execute any command in the directory of your Medusa backend. For example, you can run the [`user` command using Medusas CLI tool to create a new user](../../cli/reference.md#user):
```bash
npm install @medusajs/medusa-cli -g

View File

@@ -3,48 +3,48 @@ description: 'Learn step-by-step.'
addHowToData: true
---
# Deploy Your Medusa Server to Railway
# Deploy Your Medusa Backend to Railway
In this document, youll learn how to deploy your Medusa server to Railway.
In this document, youll learn how to deploy your Medusa backend to Railway.
## What is Railway
[Railway](https://railway.app/) is a hosting provider that you can use to deploy web applications and databases without having to worry about managing the full infrastructure.
Railway provides a free plan that allows you to deploy your Medusa server along with PostgreSQL and Redis databases. This is useful mainly for development and demo purposes.
Railway provides a free plan that allows you to deploy your Medusa backend along with PostgreSQL and Redis databases. This is useful mainly for development and demo purposes.
---
## Prerequisites
### Medusa Server
### Medusa Backend
It is assumed that you already have a Medusa server installed locally. If you dont, please follow the [quickstart guide](../../quickstart/quick-start.mdx).
It is assumed that you already have a Medusa backend installed locally. If you dont, please follow the [quickstart guide](../../development/backend/install.mdx).
Furthermore, your Medusa server should be configured to work with PostgreSQL and Redis. You can follow the [Configure your Server documentation](./../../usage/configurations.md) to learn how to do that.
Furthermore, your Medusa backend should be configured to work with PostgreSQL and Redis. You can follow the [Configure your Backend documentation](./../../development/backend/configurations.md) to learn how to do that.
### Needed Accounts
- A [Railway](https://railway.app/) account.
- A [GitHub](https://github.com/) account to create a repository to host your servers codebase.
- A [GitHub](https://github.com/) account to create a repository to host your backend's codebase.
### Required Tools
- Gits CLI tool. You can follow [this documentation to learn how to install it for your operating system](./../../tutorial/0-set-up-your-development-environment.mdx#git).
- Gits CLI tool. You can follow [this documentation to learn how to install it for your operating system](./../../development/backend/prepare-environment.mdx#git).
---
## Changes to Medusa Server Codebase
## Changes to Medusa Backend Codebase
By default, Railway looks for a Dockerfile in the root of the codebase. If there is one, it will try to deploy your server using it.
By default, Railway looks for a Dockerfile in the root of the codebase. If there is one, it will try to deploy your backend using it.
As this guide doesn't use Docker, make sure to delete `Dockerfile` from the root of your Medusa server.
As this guide doesn't use Docker, make sure to delete `Dockerfile` from the root of your Medusa backend.
---
## Create GitHub Repository
Before you can deploy your Medusa server you need to create a GitHub repository and push the code base to it.
Before you can deploy your Medusa backend you need to create a GitHub repository and push the code base to it.
On GitHub, click the plus icon at the top right, then click New Repository.
@@ -62,7 +62,7 @@ After creating the repository, youll be redirected to the repositorys page
![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 server codebase and run the following commands:
Copy the link. Then, open your terminal in the directory that holds your Medusa backend codebase and run the following commands:
```bash
git init
@@ -85,7 +85,7 @@ After pushing the changes, you can find the files in your GitHub repository.
## Deploy to Railway
In this section, youll create the PostgreSQL and Redis databases first, then deploy the server from the GitHub repository.
In this section, youll create the PostgreSQL and Redis databases first, then deploy the backend from the GitHub repository.
### Create the PostgreSQL Database
@@ -118,7 +118,7 @@ To find the Redis database URL which youll need later:
2. Choose the Connect tab.
3. Copy the Redis Connection URL.
### Deploy the Medusa Server Repository
### Deploy the Medusa Backend Repository
In the same project view:
@@ -133,11 +133,11 @@ If the GitHub repositories in the dropdown are stuck on loading and aren't showi
:::
It will take the server a few minutes to deploy successfully.
It will take the backend a few minutes to deploy successfully.
### Configure Environment Variables
To configure the environment variables of your Medusa server:
To configure the environment variables of your Medusa backend:
1. Click on the GitHub repositorys card.
2. Choose the Variables tab.
@@ -161,9 +161,9 @@ Its highly recommended to use strong, randomly generated secrets for `JWT_SE
### Change Start Command
The start command is the command used to run the server. Youll change it to run any available migrations, then run the Medusa server. This way if you create your own migrations or update the Medusa server, it's guaranteed that these migrations are run first before the server starts.
The start command is the command used to run the backend. Youll change it to run any available migrations, then run the Medusa backend. This way if you create your own migrations or update the Medusa backend, it's guaranteed that these migrations are run first before the backend starts.
To change the start command of your Medusa server:
To change the start command of your Medusa backend:
1. Click on the GitHub repositorys card.
2. Click on the Settings tab and scroll down to the Service section.
@@ -175,7 +175,7 @@ medusa migrations run && medusa develop
### Add Domain Name
The last step is to add a domain name to your Medusa server. To do that:
The last step is to add a domain name to your Medusa backend. To do that:
1. Click on the GitHub repositorys card.
2. Click on the Settings tab and scroll down to the Domains section.
@@ -183,11 +183,11 @@ The last step is to add a domain name to your Medusa server. To do that:
---
## Test your Server
## Test the Backend
Every change you make to the settings redeploys the server. You can check the Deployments of the server by clicking on the GitHub repositorys card and choosing the Deployments tab.
Every change you make to the settings redeploys the backend. You can check the Deployments of the backend by clicking on the GitHub repositorys card and choosing the Deployments tab.
After the server is redeployed successfully, open the app in your browser using the domain name. For example, you can open the URL `<YOUR_APP_URL>/store/products` which will return the products available on your server.
After the backend is redeployed successfully, open the app in your browser using the domain name. For example, you can open the URL `<YOUR_APP_URL>/store/products` which will return the products available on your backend.
:::tip
@@ -199,7 +199,7 @@ If you generated a random domain, you can find it by clicking on the GitHub repo
## Troubleshooting
If you run into any issues or a problem with your deployed server, you can check the logs in your Railway container instance by:
If you run into any issues or a problem with your deployed backend, you can check the logs in your Railway container instance by:
1. Click on the GitHub repositorys card.
2. Click on the Deployments tab.
@@ -207,11 +207,11 @@ If you run into any issues or a problem with your deployed server, you can check
---
## Run Commands on Server
## Run Commands on the Backend
To run commands on your server, you can use [Railways CLI tool to run a local shell and execute commands](https://docs.railway.app/develop/cli#local-shell).
To run commands on your backend, you can use [Railways CLI tool to run a local shell and execute commands](https://docs.railway.app/develop/cli#local-shell).
For example, you can run commands on the server to seed the database or create a new user using [Medusas CLI tool](../../cli/reference.md).
For example, you can run commands on the backend to seed the database or create a new user using [Medusas CLI tool](../../cli/reference.md).
---

View File

@@ -1,13 +1,13 @@
---
hide_table_of_contents: true
description: 'Learn how to deploy your Medusa server to different hosting providers including DigitalOcean, Heroku, Railway, and more.'
description: 'Learn how to deploy your Medusa backend to different hosting providers including DigitalOcean, Heroku, Railway, and more.'
---
import DocCardList from '@theme/DocCardList';
import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
# Medusa Server Deployment Guides
# Medusa Backend Deployment Guides
Find in this page guides to deploy your Medusa server on different platforms.
Find in this page guides to deploy your Medusa backend on different platforms.
<DocCardList items={useCurrentSidebarCategory().items}/>