From 7c0ae7f6ba1d7efa75097531f6b959e0bea2e612 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Wed, 21 Dec 2022 19:23:16 +0200 Subject: [PATCH] docs: added customize medusa admin docs (#2870) --- docs/content/admin/development.md | 100 ++++++++++++++++++++++++ docs/content/admin/quickstart.md | 1 + docs/content/usage/local-development.md | 2 +- www/docs/sidebars.js | 18 ++++- 4 files changed, 117 insertions(+), 4 deletions(-) create mode 100644 docs/content/admin/development.md diff --git a/docs/content/admin/development.md b/docs/content/admin/development.md new file mode 100644 index 0000000000..cd9763d11c --- /dev/null +++ b/docs/content/admin/development.md @@ -0,0 +1,100 @@ +# Customize Medusa Admin + +In this document, you’ll learn how to customize the Medusa admin by forking it, and how to keep it updated with changes from the main repository. + +## Overview + +Although Medusa provides an intuitive admin that should cover all your ecommerce needs, you are free to customize the Medusa admin as you see fit. + +For customization and development, it’s recommended that you fork the main Medusa admin repository. That way, you can configure your forked repository to pull changes from the main Medusa admin repository for any latest updates. + +In this document, you’ll learn how to: + +- Fork the Medusa admin repository. +- Configure the Medusa admin repository as an upstream repository. +- Pull changes from the upstream repository to keep your fork synced with the Medusa admin repository. + +--- + +## Prerequisites + +### Required Tools + +[Git CLI tool](../tutorial/0-set-up-your-development-environment.mdx#git) + +### Required Accounts + +[GitHub](https://github.com/) + +--- + +## Fork the Medusa Admin Repository + +To fork the Medusa admin: + +1. Go to the [Medusa admin repository](https://github.com/medusajs/admin). +2. Click on the Fork button at the top right. +3. You can optionally change the name of the repository and description. +4. Once done, click on the Create fork button. +5. After your fork is created, you can clone it using the following command: + +```bash +git clone +``` + +Where `` is the HTTPS URL of your repository. You can obtain it from your forked repository’s GitHub page by clicking on the Code button and copying the URL. + +--- + +## Configure Upstream Repository + +To configure the Medusa admin as the upstream repository: + +1. Change to the directory of your cloned forked repository. +2. Run the following command to add the Medusa admin repository as an upstream repository: + +```bash +git remote add upstream https://github.com/medusajs/admin +``` + +1. You can verify that it has been added by running the following command: + +```bash +git remote -v +``` + +You should see an `origin` repository which is your forked repository, and an `upstream` repository which is the Medusa admin repository. + +--- + +## Update your Fork with Latest Changes + +To update your fork with the latest changes from the Medusa admin repository: + +1. Change to the directory of your cloned forked repository. +2. Run the following command to fetch the latest changes from the Medusa admin repository: + +```bash +git fetch upstream +``` + +1. Make sure you’re on your `main` or `master` branch of the forked repository: + +```bash +git checkout main +``` + +1. Merge the changes from the `main` branch of the Medusa admin repository: + +```bash +git merge upstream/main +``` + +If your forked repository doesn’t have any conflicts with the changes from the Medusa admin repository, the merge will be done successfully. Otherwise, you’ll need to [resolve these conflicts](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line). + +--- + +## What’s Next + +- Check out the [Admin API reference](/api/admin). +- Learn about [local development of the Medusa server](../usage/local-development.md). diff --git a/docs/content/admin/quickstart.md b/docs/content/admin/quickstart.md index a116680f61..45c502cf42 100644 --- a/docs/content/admin/quickstart.md +++ b/docs/content/admin/quickstart.md @@ -135,5 +135,6 @@ You can learn more about Medusa admin and its features in the [User Guide](../us ## What’s Next +- Learn how to [Customize Medusa Admin](./development.md) - Install the [Next.js](../starters/nextjs-medusa-starter.md) or [Gatsby](../starters/gatsby-medusa-starter.md) storefront starters. - [Learn how you can use `create-medusa-app` to install all of Medusa’s 3 components.](../usage/create-medusa-app.mdx) diff --git a/docs/content/usage/local-development.md b/docs/content/usage/local-development.md index aade667607..9b52873033 100644 --- a/docs/content/usage/local-development.md +++ b/docs/content/usage/local-development.md @@ -1,4 +1,4 @@ -# Local Development +# Local Development of Medusa Server and Monorepo In this document, you’ll learn how to customize Medusa’s core and run tests. diff --git a/www/docs/sidebars.js b/www/docs/sidebars.js index 4aa011920c..78e9f9a46e 100644 --- a/www/docs/sidebars.js +++ b/www/docs/sidebars.js @@ -207,9 +207,21 @@ module.exports = { ] }, { - type: "doc", - id: "usage/local-development", - }, + type: "category", + label: 'Local Development', + items: [ + { + type: "doc", + id: "usage/local-development", + label: "Server and Monorepo" + }, + { + type: "doc", + id: "admin/development", + label: "Medusa Admin" + } + ] + } ] }, {