docs: added dividers + see also section (#2899)

This commit is contained in:
Shahed Nasser
2022-12-26 15:52:08 +02:00
committed by GitHub
parent b0e5769e27
commit b0ebfd6bcf
100 changed files with 1047 additions and 291 deletions

View File

@@ -31,6 +31,8 @@ If you want to use another Git Provider supported by DigitalOcean, its possib
- 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).
---
## Changes to package.json
Change the `start` script in `package.json` to the following:
@@ -41,6 +43,8 @@ Change the `start` script in `package.json` to the following:
This ensures that Migrations are run everytime the Medusa server is restarted.
---
## Changes to medusa-config.js
In `medusa-config.js`, the `DATABASE_URL` variable is set to the environment variable `DATABASE_URL`. This needs to be changed as DigitalOcean provides the different details of the database connection separately.
@@ -68,6 +72,8 @@ 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.
@@ -107,6 +113,8 @@ git push origin master
After pushing the changes, you can find the files in your GitHub repository.
---
## Deploy to DigitalOcean App
After logging into your account, click on the Create button at the top right, then choose App.
@@ -240,6 +248,8 @@ In the new page, click on the Previously Created DigitalOcean Database radio but
Once youre done click Attach Database. This will add the Redis database to the list of resources of your App and will trigger a redeploy of the App.
---
## Test your Server
Once the redeployment is complete, copy the URL of the App which can be found under the Apps name.
@@ -250,6 +260,8 @@ Then, go to `<YOUR_APP_URL>/store/products`. If the deployment was successful, y
![JSON response with list of products](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002196/Medusa%20Docs/Digital%20Ocean/5xTdMbY_pqwyzy.png)
---
## Run Commands on Your Server
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.
@@ -265,6 +277,8 @@ Make sure to replace `<EMAIL>` and `<PASSWORD>` with the credentials you want to
![Console in the DigitalOcean App](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002204/Medusa%20Docs/Digital%20Ocean/9RMfD4C_u0mdqs.png)
---
## Add Environment Variables
Youll likely need to add environment variables later such as Admin Cross-Origin Resource Sharing (CORS) and Store CORS variables.
@@ -279,7 +293,9 @@ Then, scroll down and find Environment Variables. You can expand the environment
Once you click Save, the environment variables will be saved and a redeployment will be triggered.
## Whats Next
---
- Learn [how to deploy the Medusa Admin to Netlify](../admin/deploying-on-netlify.md).
- Learn [how to deploy the Gatsby Storefront to Netlify](../storefront/deploying-gatsby-on-netlify.md).
## 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).

View File

@@ -39,6 +39,8 @@ Furthermore, your Medusa server should be configured to work with PostgreSQL and
- 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).
- 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).
---
## Deploy to Heroku
### 1. Login to Heroku from your CLI
@@ -238,6 +240,8 @@ heroku logs -n 500000 --remote heroku --tail -a <APP_NAME>
Where `<APP_NAME>` is the name of the app.
---
## Run Commands on Your Server
To run commands on your server, you can use the following command:
@@ -256,6 +260,8 @@ heroku run -a <APP_NAME> -- medusa user -e "<EMAIL>" -p "<PASSWORD>"
Where `<APP_NAME>` is the name of your Heroku app, and `<EMAIL>` and `<PASSWORD>` are the credentials you want to use to log in to the Medusa admin dashboard.
---
## Add Environment Variables
Youll likely need to add environment variables later such as Admin Cross-Origin Resource Sharing (CORS) and Store CORS variables.
@@ -268,7 +274,9 @@ heroku config:set <ENV_NAME>=<ENV_VALUE> -a <APP_NAME>
Where `<APP_NAME>` is the name of your Heroku app, `<ENV_NAME>` is the name of the environment variable, and `<ENV_VALUE>` is the value.
## What's Next
---
- Learn how to [deploy your Medusa admin](../admin/index.mdx).
- Learn how to [deploy your storefront](../storefront/index.mdx).
## See Also
- [Deploy your Medusa admin](../admin/index.mdx)
- [Deploy your storefront](../storefront/index.mdx)

View File

@@ -42,6 +42,8 @@ If you want to use another [Git Provider supported by Qovery](https://hub.qovery
- 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).
---
## Create GitHub Repository
Before you can deploy your Medusa server you need to create a GitHub repository and push the code base to it.
@@ -81,6 +83,8 @@ git push origin master
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.
@@ -473,6 +477,8 @@ If you run into any errors while running this command, you can just re-run it af
:::
---
## Test your Server
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.
@@ -481,6 +487,8 @@ Once the command finishes and the deployment is successful, you can access your
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`.
---
## Run Commands on Your Server
To run commands on your server, run the following command:
@@ -498,6 +506,8 @@ npm install @medusajs/medusa-cli -g
medusa user --email <EMAIL> --password <PASSWORD>
```
---
## Add Environment Variables
Youll likely need to add environment variables later such as Admin Cross-Origin Resource Sharing (CORS) and Store CORS variables.
@@ -506,7 +516,9 @@ To add environment variables, in your [Qovery Console](https://console.qovery.co
![Environment Variables in the sidebar](https://res.cloudinary.com/dza7lstvk/image/upload/v1668002258/Medusa%20Docs/Qovery/aQl7zdz_tjs0eb.png)
## Whats Next
---
- Learn how to [deploy the Medusa Admin to Netlify](../admin/deploying-on-netlify.md).
- Learn how to [deploy the Gatsby Storefront to Netlify](../storefront/deploying-gatsby-on-netlify.md).
## 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)

View File

@@ -12,6 +12,8 @@ In this document, youll learn how to deploy your Medusa server to Railway.
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.
---
## Prerequisites
### Medusa Server
@@ -29,12 +31,16 @@ Furthermore, your Medusa server should be configured to work with PostgreSQL and
- 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).
---
## Changes to Medusa Server 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.
As this guide doesn't use Docker, make sure to delete `Dockerfile` from the root of your Medusa server.
---
## Create GitHub Repository
Before you can deploy your Medusa server you need to create a GitHub repository and push the code base to it.
@@ -74,6 +80,8 @@ git push origin master
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.
@@ -172,6 +180,8 @@ The last step is to add a domain name to your Medusa server. To do that:
2. Click on the Settings tab and scroll down to the Domains section.
3. Either click on the Custom Domain button to enter your own domain or the Generate Domain button to generate a random domain.
---
## Test your Server
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.
@@ -184,6 +194,8 @@ 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:
@@ -192,13 +204,17 @@ If you run into any issues or a problem with your deployed server, you can check
2. Click on the Deployments tab.
3. Click on the View Logs button.
---
## Run Commands on Server
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).
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).
## Whats Next
---
- Learn [how to deploy the Medusa Admin to Netlify](../admin/deploying-on-netlify.md).
- Learn [how to deploy the Gatsby Storefront to Netlify](../storefront/deploying-gatsby-on-netlify.md).
## 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)