docs: general updates and fixes (#13374)

* docs: general updates and fixes

* fix lint errors
This commit is contained in:
Shahed Nasser authored and GitHub committed 2025-09-02 09:07:07 +03:00
1 parent c717535ca2
commit 24199fa47a
25 files changed
+477 -396

No files matched your search

@@ -11,20 +11,20 @@ export const metadata = {
# {metadata.title}
Create a standalone build of the Medusa application.
Create a standalone build of the Medusa application that you can deploy to production.
This creates a build that:
- Doesn't rely on the source TypeScript files.
- Can be copied to a production server reliably.
The build is outputted to a new `.medusa/server` directory.
The build is output to a new `.medusa/server` directory.
```bash
npx medusa build
```
Refer to [this section](#run-built-medusa-application) for next steps.
Refer to the [Build Medusa Application](!docs!/learn/build) guide for next steps.
## Options
@@ -44,7 +44,7 @@ Refer to [this section](#run-built-medusa-application) for next steps.
</Table.Cell>
<Table.Cell>
Whether to only build the admin to host it separately. If this option is not passed, the admin is built to the `.medusa/server/public/admin`. When this option is passed, the admin is built to the `.medusa/admin` directory instead.
Whether to build only the admin to host it separately. If this option is not passed, the admin is built to the `.medusa/server/public/admin` directory. When this option is passed, the admin is built to the `.medusa/admin` directory instead.
</Table.Cell>
</Table.Row>
@@ -53,38 +53,8 @@ Refer to [this section](#run-built-medusa-application) for next steps.
---
## Run Built Medusa Application
After running the `build` command, use the following step to run the built Medusa application:
- Change to the `.medusa/server` directory and install the dependencies:
```bash npm2yarn
cd .medusa/server && npm install
```
- When running the application locally, make sure to copy the `.env` file from the root project's directory. In production, use system environment variables instead.
```bash npm2yarn
cp .env .medusa/server/.env.production
```
- In the system environment variables, set `NODE_ENV` to `production`:
```bash
NODE_ENV=production
```
- Use the `start` command to run the application:
```bash npm2yarn
cd .medusa/server && npm run start
```
---
## Build Medusa Admin
By default, the Medusa Admin is built to the `.medusa/server/public/admin` directory.
If you want a separate build to host the admin standalone, such as on Vercel, pass the `--admin-only` option as explained in the [Options](#options) section. This outputs the admin to the `.medusa/admin` directory instead.
If you want a separate build to host the admin as a standalone application, such as on Vercel, pass the `--admin-only` option as explained in the [Options](#options) section. This outputs the admin to the `.medusa/admin` directory instead.
@@ -11,7 +11,9 @@ export const metadata = {
# {metadata.title}
Start Medusa application in development. This command watches files for any changes, then rebuilds the files and restarts the Medusa application.
Start the Medusa application in development.
This command watches files for any changes, then rebuilds the files and restarts the Medusa application.
```bash
npx medusa develop
@@ -36,7 +38,7 @@ npx medusa develop
</Table.Cell>
<Table.Cell>
Set host of the Medusa server.
Set the host of the Medusa server.
</Table.Cell>
<Table.Cell>
@@ -53,7 +55,7 @@ npx medusa develop
</Table.Cell>
<Table.Cell>
Set port of the Medusa server.
Set the port of the Medusa server.
</Table.Cell>
<Table.Cell>
@@ -91,7 +91,7 @@ npx medusa user --email <email> [--password <password>]
</Table.Cell>
<Table.Cell>
An automatically generated ID.
An automatically generated ID is used.
</Table.Cell>
</Table.Row>
@@ -103,9 +103,8 @@ npx medusa user --email <email> [--password <password>]
</Table.Cell>
<Table.Cell>
Whether to create an invite instead of a user. When using this option, you don't need to specify a password.
If ran successfully, you'll receive the invite token in the output.
Whether to create a user invite instead of directly creating a user. Learn more in the [Create User Invite](#create-user-invite-with-medusa-cli) section.
</Table.Cell>
<Table.Cell>
@@ -119,4 +118,21 @@ npx medusa user --email <email> [--password <password>]
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
</Table>
---
## Create User Invite with Medusa CLI
The `user` command accepts the `--invite` option to create a user invite. The user must accept the invite before they can log into the Medusa Admin.
For example:
```bash
npx medusa user --email user@example.com --invite
```
The command will create a user invite and output the invite token. You can then either:
- Accept the invite in the Medusa Admin at the path `/app/invite?token=<invite_token>`
- Accept the invite using the [Accept Invite API route](!api!/admin#invites_postinvitesaccept).