|
| 1 | +import { Prerequisites } from "docs-ui" |
| 2 | + |
| 3 | +export const metadata = { |
| 4 | + title: `Projects`, |
| 5 | +} |
| 6 | + |
| 7 | +# {metadata.title} |
| 8 | + |
| 9 | +In this guide, you'll learn about projects, how to create them, view their details, and manage their settings in Cloud. |
| 10 | + |
| 11 | +## What is a Project? |
| 12 | + |
| 13 | +A project is the collection of resources, environments, deployments, and settings related to a Medusa application deployed to the Cloud. The project is linked to a GitHub repository that hosts the Medusa application's code. |
| 14 | + |
| 15 | +To deploy a Medusa application to the Cloud, you create a project for it. Cloud will automatically set up and configure the necessary resources in the project to run the application, such as PostgreSQL, Redis, and S3. |
| 16 | + |
| 17 | +Each project can have multiple environments, such as production and staging. These environments allow you to test changes before pushing them live to users. You can learn more in the [Environments documentation](#). |
| 18 | + |
| 19 | +--- |
| 20 | + |
| 21 | +## Create a Project |
| 22 | + |
| 23 | +In this section, you'll learn how to create a project in Cloud to deploy your Medusa application. |
| 24 | + |
| 25 | +### Prerequisites |
| 26 | + |
| 27 | +Before creating a project, ensure you have: |
| 28 | + |
| 29 | +- A Medusa application whose codebase is hosted in a GitHub repository. |
| 30 | + - If you don't have a Medusa application yet, refer to the [Installation](!docs!/learn/installation) guide to set up a new Medusa application. |
| 31 | +- A Cloud account with a valid plan that allows creating more projects. |
| 32 | + - If you've exceeded the number of projects limit for your plan, you can [contact support to upgrade your plan](#). |
| 33 | + |
| 34 | +#### Medusa Application Configurations |
| 35 | + |
| 36 | +Your Medusa application doesn't need specific configurations to be deployed to Cloud. Cloud will automatically: |
| 37 | + |
| 38 | +- Create the necessary [server and worker instances](!docs!/learn/production/worker-mode). |
| 39 | +- Scale your Medusa application's resources based on the traffic it receives. |
| 40 | +- Set up and configure production resources and modules for your Medusa application: |
| 41 | + - [Redis Cache Module](!resources!/infrastructure-modules/cache/redis) |
| 42 | + - [Redis Event Module](!resources!/infrastructure-modules/event/redis) |
| 43 | + - [Redis Locking Module Provider](!resources!/infrastructure-modules/locking/redis) |
| 44 | + - [Redis Workflow Engine Module](!resources!/infrastructure-modules/workflow-engine/redis) |
| 45 | + - [S3 File Provider Module](!resources!/infrastructure-modules/file/s3) |
| 46 | + |
| 47 | +So, make sure to remove any of these modules from your `medusa-config.ts` file, unless you want to use custom options for them. In that case, you're expected to manually set up and manage those resources externally and configure them in your Medusa application. |
| 48 | + |
| 49 | +### Steps to Create a Project |
| 50 | + |
| 51 | +To create a project: |
| 52 | + |
| 53 | +1. Make sure you're viewing the [correct organization's dashboard in Cloud](../organizations/page.mdx#switch-organization). |
| 54 | +2. Click on the **Create Project** button in your organization's dashboard. |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | +3. If you haven't authenticated with GitHub yet, you'll be asked to authenticate first. |
| 59 | +4. Once you're authenticated, you'll need to select a GitHub account and the repository that contains your Medusa application's code. The repository can be public or private. |
| 60 | + - If you don't see your repository, you can click the "Configure repositories" link to manage the GitHub repositories that Cloud can access. |
| 61 | +5. Once you find the repository, select it and click the "Next" button. |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | +6. In the next step, configure the project's settings: |
| 66 | + - Enter the name of the project. |
| 67 | + - Enter a custom subdomain for the project. All projects are subdomains of `medusajs.app`. For example, if you enter `my-project`, the project will be accessible at `my-project.medusajs.app`. |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | +7. You can optionally change the "Build and project" settings by expanding its section: |
| 72 | + - Select a region to deploy the project. For better performance, choose a region that's closer to your target users. The region can't be changed later. |
| 73 | + - If you don't find the region you need, you can [contact support](#) to request it. |
| 74 | + - If your project is in a monorepo, you can specify the path to the Medusa project in the repository. Otherwise, leave it empty. |
| 75 | + - You can change the email and password for the admin user created for the project. These are the credentials you'll use to access the Medusa Admin. |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | +8. You can optionally add Environment Variables by expanding its section: |
| 80 | + - Enter the key and value for each environment variable you want to add. |
| 81 | + - Mark the variable as "Sensitive" to hide its value in the UI. |
| 82 | + - To add more variables, click the "Add another" button. |
| 83 | + - You can also add and change environment variables later in the project's environment settings. |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | +9. Once you're done configuring the project, click the **Create Project** button. |
| 88 | + |
| 89 | +After creating the project, it will take a few minutes to create the necessary resources for it and deploy it. You'll be redirected to the organization dashboard, where you can see the project in the list of projects. |
| 90 | + |
| 91 | +<Note> |
| 92 | + |
| 93 | +If the project creation takes too long, check out the [troubleshooting section](#troubleshooting-project-creation). |
| 94 | + |
| 95 | +</Note> |
| 96 | + |
| 97 | + |
| 98 | + |
| 99 | +If you click on the project, you'll be taken to the project's dashboard, where you can view [its details and status](#find-project-details). |
| 100 | + |
| 101 | +Once the project is created and deployed, you'll receive a notification in the Cloud dashboard. You can also view its status in the list of projects and in the project's details. |
| 102 | + |
| 103 | + |
| 104 | + |
| 105 | +### Troubleshooting Project Creation |
| 106 | + |
| 107 | +If you encounter any issues while creating a project: |
| 108 | + |
| 109 | +{/* TODO: add links */} |
| 110 | + |
| 111 | +- [Check the build and runtime logs of the project's production deployment](#). |
| 112 | +- [Contact support for help](#). |
| 113 | + |
| 114 | +--- |
| 115 | + |
| 116 | +## Open Deployed Medusa Admin |
| 117 | + |
| 118 | +To open the deployed Medusa Admin of a project: |
| 119 | + |
| 120 | +1. Make sure you're viewing the [correct organization's dashboard in Cloud](../organizations/page.mdx#switch-organization). |
| 121 | +2. Open the project's dashboard by clicking on the project card in the organization's dashboard. |
| 122 | +3. Click on the URL in the "Production" card of the project's dashboard. It will open the Medusa Admin in a new tab. |
| 123 | + |
| 124 | + |
| 125 | + |
| 126 | +You can then log in using the email and password you set during the project creation. |
| 127 | + |
| 128 | +<Note> |
| 129 | + |
| 130 | +Lost your Medusa Admin email or password? You can [contact support](#) or [reset your password in the Medusa Admin](!user-guide!/reset-password) if your Medusa project has a Notification Module Provider configured. |
| 131 | + |
| 132 | +</Note> |
| 133 | + |
| 134 | +--- |
| 135 | + |
| 136 | +## Access Server through SSH |
| 137 | + |
| 138 | +Cloud doesn't support SSH access to the server instances of a project. However, you can still access the server's [runtime and build logs](#) to debug issues or monitor the application's performance. |
| 139 | + |
| 140 | +If this isn't sufficient for your use case, you can [contact support](#) to discuss alternatives. |
| 141 | + |
| 142 | +--- |
| 143 | + |
| 144 | +## Open Project Dashboard |
| 145 | + |
| 146 | +To open a project's dashboard: |
| 147 | + |
| 148 | +1. Make sure you're viewing the [correct organization's dashboard in Cloud](../organizations/page.mdx#switch-organization). |
| 149 | +2. Open the project's dashboard by clicking on the project card in the organization's dashboard. |
| 150 | + |
| 151 | +When you open a project's dashboard, its name will be shown at the top left next to the [organization switcher](../organizations/page.mdx#organization-switcher). |
| 152 | + |
| 153 | + |
| 154 | + |
| 155 | +### Find Project Details |
| 156 | + |
| 157 | +On the project's dashboard, you can view the following details: |
| 158 | + |
| 159 | + |
| 160 | + |
| 161 | +1. **Region**: The region where the project is deployed. You'll find it below the project name. |
| 162 | +2. **Environments**: The environments for the project are shown as cards. By default, you'll find Production and Previews environments. You can learn more about environments in the [Environments documentation](#). |
| 163 | + - The Production environment is the live environment where your Medusa application is deployed and clients connect to. |
| 164 | + - The Previews environments are created whenever you create a pull request in the linked GitHub repository. They allow you to preview changes before merging them into the main branch. |
| 165 | +3. **Production URL**: The URL of the project's production deployment. You'll find it in the "Production" card under the title. Clicking it will open the production Medusa Admin in a new tab. |
| 166 | +4. **Repository**: The GitHub repository linked to the project. You'll find it as a "Repository" button at the top right of the project's dashboard. Clicking it will open the repository in a new tab. |
| 167 | +5. **Project Status**: The status of the project, which may be "Live", "Building", or "Failed". The status for the production deployment is shown in the "Production" card of the project's dashboard. |
| 168 | + |
| 169 | +### Switch Projects |
| 170 | + |
| 171 | +The project's name at the top left of the dashboard is also a project switcher. |
| 172 | + |
| 173 | +To switch to a different project: |
| 174 | + |
| 175 | +1. Click on the project's name at the top left of the Cloud dashboard, next to the organization name. |
| 176 | +2. Choose the project you want to switch to from the dropdown. |
| 177 | + |
| 178 | + |
| 179 | + |
| 180 | +This will change the view to the selected project, and you'll see its details, environments, and settings. |
| 181 | + |
| 182 | +--- |
| 183 | + |
| 184 | +## View Project Deployments |
| 185 | + |
| 186 | +To view the deployments of a project, click on the "Deployments" tab in the project's dashboard. This will show you a list of all deployments for the project, including their status, environment, and how long the deployment took. |
| 187 | + |
| 188 | +Learn more in the [Deployments documentation](#). |
| 189 | + |
| 190 | +--- |
| 191 | + |
| 192 | +## Edit Project Details |
| 193 | + |
| 194 | +After creating a project, you can edit its general details, such as its name and root directory in the repository, and manage its preview settings. |
| 195 | + |
| 196 | +To edit a project's general details: |
| 197 | + |
| 198 | +1. Open the project's dashboard. |
| 199 | +2. Click on the "Settings" tab. |
| 200 | +3. In the "General" tab of the Settings page, you can edit the project's name and root directory in the repository. |
| 201 | + - Editing the root directory in the repository is useful if the repository is a monorepo. |
| 202 | +4. Once you're done making changes, click the "Save changes" button next to the input field. |
| 203 | + |
| 204 | + |
| 205 | + |
| 206 | +### Editing Previews Settings |
| 207 | + |
| 208 | +You can also edit the "Previews" settings of a project from the "Settings" tab, which are general settings related to Previews environments. |
| 209 | + |
| 210 | +Learn more in the [Environments documentation](#). |
| 211 | + |
| 212 | +--- |
| 213 | + |
| 214 | +## Delete Project |
| 215 | + |
| 216 | +<Note type="warning" title="Danger"> |
| 217 | + Deleting a project will delete all its environments and deployments. This action is irreversible. |
| 218 | + You won't be able to recover any data after deletion. |
| 219 | +</Note> |
| 220 | + |
| 221 | +To delete a project: |
| 222 | + |
| 223 | +1. Open the project's dashboard. |
| 224 | +2. Click on the "Settings" tab. |
| 225 | +3. In the "General" tab of the Settings page, click the "Delete Project" button. |
| 226 | +4. Confirm the deletion by typing the project's name in the confirmation input, then click the "Delete" button. |
| 227 | + |
| 228 | + |
0 commit comments