diff --git a/README.md b/README.md index f7786cdc8d..ac5f3b2616 100644 --- a/README.md +++ b/README.md @@ -49,24 +49,6 @@ Medusa is an open-source headless commerce engine that enables developers to cre After these four steps and only a couple of minutes, you now have a complete commerce engine running locally. You may now explore [the documentation](https://docs.medusa-commerce.com/api) to learn how to interact with the Medusa API. You may also add [plugins](https://github.com/medusajs/medusa/tree/master/packages) to your Medusa store by specifying them in your `medusa-config.js` file. -## ⭐️ Features -Medusa comes with a set of building blocks that allow you to create amazing digital commerce experiences, below is a list of some of the features that Medusa come with out of the box: -- **Headless**: Medusa is a highly customizable commerce API which means that you may use any presentation layer such as a website, app, chat bots, etc. -- **Regions** allow you to specify currencies, payment providers, shipping providers, tax rates and more for one or more countries for truly international sales. -- **Orders** come with all the functionality necessary to perform powerful customer service operations with ease. -- **Carts** allow customers to collect products for purchase, add shipping details and complete payments. -- **Products** come with relevant fields for customs, stock keeping and sales. Medusa supports multiple options and unlimited variants. -- **Swaps** allow customers to exchange products after purchase (e.g. for incorrect sizes). Accounting, payment and fulfillment plugins handle all the tedious work for you for automated customer service. -- **Claims** can be created if customers experience problems with one of their products. Plugins make sure to automate sending out replacements, handling refunds and collecting valuable data for analysis. -- **Returns** allow customers to send back products and can be configured to function in a 100% automated flow through accounting and payment plugins. -- **Fulfillment API** makes it easy to integrate with any fulfillment provider by creating fulfillment plugins, check the `/packages` directory for a full list of plugins. -- **Payments API** makes it easy to integrate with any payment provider by creatingn payment plugins, we already support Stripe, Paypal and Klarna. -- **Notification API** allow integrations with email providers, chat bots, Slack channels etc. -- **Customer Login** to give customers a way of managing their data, viewing their orders and saving payment details. -- **Shipping Options & Profiles** enable powerful rules for free shipping limits, multiple fulfillment methods and more. -- **Medusa's Plugin Architecture** makes it intuitive and easy to manage your integrations, switch providers and grow with ease. -- **Customization** is supported for those special use cases that all the other ecommerce platforms can't accommodate. - ## 🛒 Setting up a storefront for your Medusa project Medusa is a headless commerce engine which means that it can be used for any type of digital commerce experience - you may use it as the backend for an app, a voice application, social commerce experiences or a traditional e-commerce website, you may even want to integrate Medusa into your own software to enable commerce functionality. All of these are use cases that Medusa supports - to learn more read the documentation or reach out. @@ -84,19 +66,23 @@ To provide a quick way to get you started with a storefront install one of our t With your starter and your Medusa store running you can open http://localhost:8000 (for Gatsby) or http://localhost:3000 (for Nextjs) in your browser and view the products in your store, build a cart, add shipping details and pay and complete an order. -## ☁️ Linking development to Medusa Cloud -With your project in local development you can link your Medusa instance to Medusa Cloud - this will allow you to manage your store, view orders and test out the amazing functionalities that you are building. Linking your project to Medusa Cloud requires that you have a Medusa Cloud account. - -1. **Authenticate your CLI with Medusa Cloud:** - ``` - medusa login - ``` -2. **Link project** - ``` - medusa link --develop - ``` - -You can now navigate to Orders in Medusa Cloud to view the orders in your local Medusa project, just like you would if your store was running in production. +## ⭐️ Features +Medusa comes with a set of building blocks that allow you to create amazing digital commerce experiences, below is a list of some of the features that Medusa come with out of the box: +- **Headless**: Medusa is a highly customizable commerce API which means that you may use any presentation layer such as a website, app, chatbots, etc. +- **Regions** allow you to specify currencies, payment providers, shipping providers, tax rates and more for one or more countries for truly international sales. +- **Orders** come with all the functionality necessary to perform powerful customer service operations with ease. +- **Carts** allow customers to collect products for purchase, add shipping details and complete payments. +- **Products** come with relevant fields for customs, stock keeping and sales. Medusa supports multiple options and unlimited variants. +- **Swaps** allow customers to exchange products after purchase (e.g. for incorrect sizes). Accounting, payment and fulfillment plugins handle all the tedious work for you for automated customer service. +- **Claims** can be created if customers experience problems with one of their products. Plugins make sure to automate sending out replacements, handling refunds and collecting valuable data for analysis. +- **Returns** allow customers to send back products and can be configured to function in a 100% automated flow through accounting and payment plugins. +- **Fulfillment API** makes it easy to integrate with any fulfillment provider by creating fulfillment plugins, check the `/packages` directory for a full list of plugins. +- **Payments API** makes it easy to integrate with any payment provider by creating payment plugins, we already support Stripe, Paypal and Klarna. +- **Notification API** allow integrations with email providers, chatbots, Slack channels, etc. +- **Customer Login** to give customers a way of managing their data, viewing their orders and saving payment details. +- **Shipping Options & Profiles** enable powerful rules for free shipping limits, multiple fulfillment methods and more. +- **Medusa's Plugin Architecture** makes it intuitive and easy to manage your integrations, switch providers and grow with ease. +- **Customization** is supported for those special use cases that all the other e-commerce platforms can't accommodate. ## Database support In production Medusa requires Postgres and Redis, but SQLite is supported for development and testing purposes. If you plan on using Medusa for a project it is recommended that you install Postgres and Redis on your dev machine. diff --git a/docs/content/how-to/setting-up-a-nextjs-storefront-for-your-medusa-project.md b/docs/content/how-to/setting-up-a-nextjs-storefront-for-your-medusa-project.md new file mode 100644 index 0000000000..e0b8b8b891 --- /dev/null +++ b/docs/content/how-to/setting-up-a-nextjs-storefront-for-your-medusa-project.md @@ -0,0 +1,54 @@ +--- +title: Setting up a Next.js storefront for your Medusa project +--- + +# Setting up a Next.js storefront for your Medusa project + +> Medusa is a headless open source commerce platform giving engineers the foundation for building unique and scaleable digital commerce projects through our API-first engine. +> Being headless, our starters serve as a good foundation for you to get coupled with a frontend in a matter of minutes. + +This article assumes you already have the Medusa project created and ready to be linked to your Next.js starter. + +## Getting started + +In order to get started let's open the terminal and use the following command to create an instance of your storefront: + +```zsh + npx create-next-app -e https://github.com/medusajs/nextjs-starter-medusa my-medusa-storefront +``` + +Now we have a storefront codebase that is ready to be used with our Medusa server. + +Next, we have to complete two steps to make our new shiny storefront to speak with our server: **link storefront to a server** and **update the `STORE_CORS` variable**. + +Let's jump to these two. + +## Link storefront to a server + +For this part, we should navigate to a `client.js` file which you can find in the utils folder. + +We don't need to do much in here, but to make sure that our storefront is pointing to the port, where the server is running + +```js +import Medusa from "@medusajs/medusa-js" +const BACKEND_URL = process.env.GATSBY_STORE_URL || "http://localhost:9000" // <--- That is the line we are looking for +export const createClient = () => new Medusa({ baseUrl: BACKEND_URL }) +``` + +By default the Medusa server is running at port 9000, so if you didn't change that we are good to go to our next step. + +## Update the `STORE_CORS` variable + +Here let's navigate to your Medusa server and open `medusa-config.js` + +Let's locate the `STORE_CORS` variable and make sure it's the right port (which is 3000 by default for Next.js projects) + +```js +/* + * CORS to avoid issues when consuming Medusa from a client. + * Should be pointing to the port where the storefront is running. + */ +const STORE_CORS = process.env.STORE_CORS || "http://localhost:3000" +``` + +Now we have a storefront that interacts with our Medusa server and with that we have a sweet and complete e-commerce setup with a Next.js storefront. diff --git a/packages/medusa-payment-manual/CHANGELOG.md b/packages/medusa-payment-manual/CHANGELOG.md index af9295ee1e..ed5429f861 100644 --- a/packages/medusa-payment-manual/CHANGELOG.md +++ b/packages/medusa-payment-manual/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.4](https://github.com/medusajs/medusa/compare/medusa-payment-manual@1.0.2...medusa-payment-manual@1.0.4) (2021-09-02) + + +### Features + +* Update to API references look and feel ([#343](https://github.com/medusajs/medusa/issues/343)) ([143f06a](https://github.com/medusajs/medusa/commit/143f06aa397dcc16991405a6143c22eaa0e3ffd9)) + + + + + ## [1.0.3](https://github.com/medusajs/medusa/compare/medusa-payment-manual@1.0.2...medusa-payment-manual@1.0.3) (2021-08-31) diff --git a/packages/medusa-payment-manual/package.json b/packages/medusa-payment-manual/package.json index eb92d9b4e1..4ee70b9e8c 100644 --- a/packages/medusa-payment-manual/package.json +++ b/packages/medusa-payment-manual/package.json @@ -1,6 +1,6 @@ { "name": "medusa-payment-manual", - "version": "1.0.3", + "version": "1.0.4", "description": "A dummy payment provider to be used for testing or manual payments", "main": "index.js", "repository": { diff --git a/packages/medusa-plugin-brightpearl/CHANGELOG.md b/packages/medusa-plugin-brightpearl/CHANGELOG.md index 3dd4b3503d..5591c5d591 100644 --- a/packages/medusa-plugin-brightpearl/CHANGELOG.md +++ b/packages/medusa-plugin-brightpearl/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.30](https://github.com/medusajs/medusa/compare/medusa-plugin-brightpearl@1.1.28...medusa-plugin-brightpearl@1.1.30) (2021-09-02) + + +### Bug Fixes + +* account for non-division currencies in sales credit ([#342](https://github.com/medusajs/medusa/issues/342)) ([bd1e115](https://github.com/medusajs/medusa/commit/bd1e115696cf020a29bbfe07e5e85a3e0314bf78)) + + + + + ## [1.1.29](https://github.com/medusajs/medusa/compare/medusa-plugin-brightpearl@1.1.28...medusa-plugin-brightpearl@1.1.29) (2021-08-31) diff --git a/packages/medusa-plugin-brightpearl/package.json b/packages/medusa-plugin-brightpearl/package.json index e290d68d5a..34396c7f46 100644 --- a/packages/medusa-plugin-brightpearl/package.json +++ b/packages/medusa-plugin-brightpearl/package.json @@ -1,6 +1,6 @@ { "name": "medusa-plugin-brightpearl", - "version": "1.1.29", + "version": "1.1.30", "description": "Brightpearl plugin for Medusa Commerce", "main": "index.js", "repository": { diff --git a/packages/medusa-plugin-restock-notification/CHANGELOG.md b/packages/medusa-plugin-restock-notification/CHANGELOG.md index ed2601da73..c06c02d000 100644 --- a/packages/medusa-plugin-restock-notification/CHANGELOG.md +++ b/packages/medusa-plugin-restock-notification/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.0.18](https://github.com/medusajs/medusa/compare/medusa-plugin-restock-notification@0.0.16...medusa-plugin-restock-notification@0.0.18) (2021-09-02) + +**Note:** Version bump only for package medusa-plugin-restock-notification + + + + + ## [0.0.17](https://github.com/medusajs/medusa/compare/medusa-plugin-restock-notification@0.0.16...medusa-plugin-restock-notification@0.0.17) (2021-08-31) **Note:** Version bump only for package medusa-plugin-restock-notification diff --git a/packages/medusa-plugin-restock-notification/package.json b/packages/medusa-plugin-restock-notification/package.json index 2004d857f2..a4fae5d89f 100644 --- a/packages/medusa-plugin-restock-notification/package.json +++ b/packages/medusa-plugin-restock-notification/package.json @@ -1,6 +1,6 @@ { "name": "medusa-plugin-restock-notification", - "version": "0.0.17", + "version": "0.0.18", "main": "index.js", "repository": { "type": "git", diff --git a/packages/medusa-plugin-restock-notification/src/services/restock-notification.js b/packages/medusa-plugin-restock-notification/src/services/restock-notification.js index 014c38b748..d91c576785 100644 --- a/packages/medusa-plugin-restock-notification/src/services/restock-notification.js +++ b/packages/medusa-plugin-restock-notification/src/services/restock-notification.js @@ -34,13 +34,16 @@ class RestockNotificationService extends BaseService { return this } - const cloned = new RestockNotificationService({ - manager: transactionManager, - options: this.options_, - eventBusService: this.eventBus_, - productVariantService: this.productVariantService_, - restockNotificationModel: this.restockNotificationModel_, - }) + const cloned = new RestockNotificationService( + { + manager: transactionManager, + options: this.options_, + eventBusService: this.eventBus_, + productVariantService: this.productVariantService_, + restockNotificationModel: this.restockNotificationModel_, + }, + this.options_ + ) cloned.transactionManager_ = transactionManager diff --git a/packages/medusa-plugin-wishlist/CHANGELOG.md b/packages/medusa-plugin-wishlist/CHANGELOG.md index 49003ab7b9..be22214d88 100644 --- a/packages/medusa-plugin-wishlist/CHANGELOG.md +++ b/packages/medusa-plugin-wishlist/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.25](https://github.com/medusajs/medusa/compare/medusa-plugin-wishlist@1.1.23...medusa-plugin-wishlist@1.1.25) (2021-09-02) + + +### Bug Fixes + +* 404 ([b1132ee](https://github.com/medusajs/medusa/commit/b1132eec23514a6e7a22fe6653f4a4b4fde0e83f)) + + + + + ## [1.1.24](https://github.com/medusajs/medusa/compare/medusa-plugin-wishlist@1.1.23...medusa-plugin-wishlist@1.1.24) (2021-08-31) diff --git a/packages/medusa-plugin-wishlist/package.json b/packages/medusa-plugin-wishlist/package.json index 10203c5e3d..bd75c4d73b 100644 --- a/packages/medusa-plugin-wishlist/package.json +++ b/packages/medusa-plugin-wishlist/package.json @@ -1,6 +1,6 @@ { "name": "medusa-plugin-wishlist", - "version": "1.1.24", + "version": "1.1.25", "description": "Provides /customers/:id/wishlist to add items to a customr's wishlist", "main": "index.js", "repository": { diff --git a/packages/medusa/CHANGELOG.md b/packages/medusa/CHANGELOG.md index 0ffeb0e49c..f654c66090 100644 --- a/packages/medusa/CHANGELOG.md +++ b/packages/medusa/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.40](https://github.com/medusajs/medusa/compare/@medusajs/medusa@1.1.38...@medusajs/medusa@1.1.40) (2021-09-02) + + +### Bug Fixes + +* Account for non-discountable items in getRefundTotal ([#347](https://github.com/medusajs/medusa/issues/347)) ([fd14e24](https://github.com/medusajs/medusa/commit/fd14e243daf2724ce91aaf85c29806f22f3b6623)) + + +### Features + +* creates support for swaps on the storefront ([#355](https://github.com/medusajs/medusa/issues/355)) ([ae82cfc](https://github.com/medusajs/medusa/commit/ae82cfc70a94655ff03fcf1d9b8596f14e8c2840)) + + + + + ## [1.1.39](https://github.com/medusajs/medusa/compare/@medusajs/medusa@1.1.38...@medusajs/medusa@1.1.39) (2021-08-31) diff --git a/packages/medusa/package.json b/packages/medusa/package.json index 3e19c333c9..f9768de5eb 100644 --- a/packages/medusa/package.json +++ b/packages/medusa/package.json @@ -1,6 +1,6 @@ { "name": "@medusajs/medusa", - "version": "1.1.39", + "version": "1.1.40", "description": "E-commerce for JAMstack", "main": "dist/index.js", "bin": { diff --git a/www/docs/sidebars.js b/www/docs/sidebars.js index 7bcca221d6..016a92fa55 100644 --- a/www/docs/sidebars.js +++ b/www/docs/sidebars.js @@ -71,6 +71,10 @@ module.exports = { }, ], }, + { + type: "doc", + id: "how-to/setting-up-a-nextjs-storefront-for-your-medusa-project", + }, ], }, ],