This PR includes documentation that preps for v2 docs (but doesn't introduce new docs). _Note: The number of file changes in the PR is due to find-and-replace within the `references` which is unavoidable. Let me know if I should move it to another PR._ ## Changes - Change Medusa version in base OAS used for v2. - Fix to docblock generator related to not catching all path parameters. - Added typedoc plugin that generates ER Diagrams, which will be used specifically for data model references in commerce modules. - Changed OAS tool to output references in `www/apps/api-reference/specs-v2` directory when the `--v2` option is used. - Added a version switcher to the API reference to switch between V1 and V2. This switcher is enabled by an environment variable, so it won't be visible/usable at the moment. - Upgraded docusaurus to v3.0.1 - Added new Vale rules to ensure correct spelling of Medusa Admin and module names. - Added new components to the `docs-ui` package that will be used in future documentation changes.
178 lines
5.2 KiB
Plaintext
178 lines
5.2 KiB
Plaintext
---
|
|
description: "Learn how to install Medusa's admin dashboard. The admin dashboard gives merchants an easy-to-use interface to manage their data such as orders, products, regions, and more."
|
|
addHowToData: true
|
|
---
|
|
|
|
import Feedback from '@site/src/components/Feedback';
|
|
import DetailsList from '@site/src/components/DetailsList'
|
|
import AdminLoginSection from '../troubleshooting/signing-in-to-admin.md'
|
|
import CorsSection from '../troubleshooting/cors-issues.md'
|
|
|
|
# Admin Dashboard Quickstart
|
|
|
|
This document will guide you through setting up the admin dashboard in the Medusa backend.
|
|
|
|
## Overview
|
|
|
|
The admin dashboard is installed on the Medusa backend. The admin dashboard starts when you start the Medusa backend. This also means you can later deploy the Medusa backend along with the admin dashboard on the same hosting.
|
|
|
|
This guide will explain the steps and configurations required to set up the admin dashboard.
|
|
|
|
---
|
|
|
|
## Prerequisites
|
|
|
|
### Medusa Backend
|
|
|
|
As the admin dashboard is a plugin installed on the Medusa Backend, you must have a Medusa Backend installed first. You can learn how to install it in [this documentation](../development/backend/install.mdx).
|
|
|
|
### Node.js
|
|
|
|
The Admin uses [Vite v4.1.4](https://vitejs.dev/guide/#scaffolding-your-first-vite-project) which requires v14.8+ or v16+ of Node.js, and as Medusa requires v16 or greater it's recommended you use v16+ of Node.js.
|
|
|
|
You can check which version of Node you have by running the following command:
|
|
|
|
```bash noReport
|
|
node -v
|
|
```
|
|
|
|
You can install Node from the [official website](https://nodejs.org/en/).
|
|
|
|
---
|
|
|
|
## Install and Serve Admin with the Backend
|
|
|
|
This section explains how to install the admin to be served with the Medusa Backend and later deployed together.
|
|
|
|
### Step 1: Install the Package
|
|
|
|
In the directory of your Medusa backend, run the following command to install admin dashboard:
|
|
|
|
```bash npm2yarn
|
|
npm install @medusajs/admin
|
|
```
|
|
|
|
### Step 2: Add Admin to Medusa Configurations
|
|
|
|
In `medusa-config.js`, add the admin plugin into the array of `plugins`:
|
|
|
|
```js title="medusa-config.js"
|
|
const plugins = [
|
|
// ...
|
|
{
|
|
resolve: "@medusajs/admin",
|
|
/** @type {import('@medusajs/admin').PluginOptions} */
|
|
options: {
|
|
// ...
|
|
},
|
|
},
|
|
]
|
|
```
|
|
|
|
Check [this documentation](./configuration.mdx#plugin-options) for a full list of available options.
|
|
|
|
### Step 3: Test the Admin Dashboard
|
|
|
|
You can test the admin dashboard by running the following command in the directory of the Medusa backend:
|
|
|
|
```bash
|
|
npx medusa develop
|
|
```
|
|
|
|
This starts the Medusa Backend and the admin dashboard in a development environment. By default, the admin will be available on the URL `localhost:7001` and the browser will open automatically to the admin dashboard in your default browser, unless you have the `develop.open` option disabled.
|
|
|
|
<Feedback
|
|
event="survey_admin_quickstart"
|
|
question="Did you set up the admin successfully?"
|
|
positiveQuestion="Is there anything that should improved?"
|
|
negativeQuestion="Please describe the issue you faced."
|
|
/>
|
|
|
|
---
|
|
|
|
## Production Path
|
|
|
|
:::note
|
|
|
|
This doesn't apply if you have the `serve` option disabled or you're deploying the admin separately.
|
|
|
|
:::
|
|
|
|
When you run the Medusa project in a production environment (such as with the `npx medusa start` command), the admin dashboard will be available at `<MEDUSA_URL>/<ADMIN_PATH>`, where:
|
|
|
|
1. `<MEDUSA_URL>` is the URL of your Medusa backend. By default, it'll be `localhost:9000` locally.
|
|
2. `<ADMIN_PATH>` is the path you define in the [admin plugin's configurations](./configuration.mdx#plugin-options).
|
|
|
|
So, if you simulate a production environment locally, the admin dashboard will run by default on `localhost:9000/app`.
|
|
|
|
---
|
|
|
|
## Demo Credentials
|
|
|
|
If you installed the demo data when you installed the Medusa backend by running:
|
|
|
|
```bash npm2yarn
|
|
npm run seed
|
|
```
|
|
|
|
You can use the email `admin@medusa-test.com` and password `supersecret` to log in.
|
|
|
|
:::info
|
|
|
|
Passwords in Medusa are hashed using the [scrypt-kdf](https://www.npmjs.com/package/scrypt-kdf). The password hash is then stored in the database.
|
|
|
|
:::
|
|
|
|
---
|
|
|
|
## Create a New Admin User
|
|
|
|
To create a new admin user from the command line, run the following command in the directory holding your Medusa backend:
|
|
|
|
```bash
|
|
npx medusa user -e some@email.com -p some-password
|
|
```
|
|
|
|
This will create a new user that you can use to log into your admin panel.
|
|
|
|
---
|
|
|
|
## Admin User Guide
|
|
|
|
The admin dashboard provides a lot of ecommerce features including managing Return Merchandise Authorization (RMA) flows, store settings, products, orders, and much more.
|
|
|
|
You can learn more about the admin dashboard and its features in the [User Guide](../user-guide.mdx).
|
|
|
|
---
|
|
|
|
## Multi-Language Support
|
|
|
|
Medusa supports multiple languages and translations. Check out available languages [here](../user-guide/tips/languages.md).
|
|
|
|
Refer to [this user guide](../user-guide/users/profile.md#change-admin-language) to learn how to switch the language of the Medusa Admin.
|
|
|
|
---
|
|
|
|
## Troubleshooting Installation
|
|
|
|
<DetailsList
|
|
sections={[
|
|
{
|
|
title: 'Signing into Admin',
|
|
content: <AdminLoginSection />
|
|
},
|
|
{
|
|
title: 'CORS Errors',
|
|
content: <CorsSection />
|
|
}
|
|
]}
|
|
/>
|
|
|
|
---
|
|
|
|
## See Also
|
|
|
|
- [Admin Configuration](./configuration.mdx)
|
|
- [Admin widgets](./widgets.md)
|
|
- [Admin UI routes](./routes.md)
|