This article was originally published on my personal blog.
E-commerce platforms and frameworks are usually built on a complex architecture to provide you with the best features as a developer and as a business owner.
Although this is good as they pack all useful features in one framework in the hopes no additional work needs to be done to launch a store, this can result in some issues. The store can be slow which would require a set of external tools to make it faster and in some cases big hosting plans to ensure the customers get the best experience.
In addition to that, customizing an e-commerce store to fit your or your client's needs using some platforms can be hard due to their tightly bound or complicated architecture.
This is where Medusa comes in. Medusa is an open-source headless commerce platform that aims to simplify how e-commerce platforms are built and provide you with the highest level of customization you can attain to build the e-commerce store you have in mind.
In this article, we'll briefly take a look at Medusa's structure and what it provides, then we'll see what are some of its strong points and what are some of its cons that you should keep in mind before choosing Medusa.
Medusa's Architecture
Medusa as a full e-commerce system is split into 3 parts or 3 building blocks.
The core of Medusa is its backend. The backend exposes a REST API and connects directly to the database. The backend acts as the headless commerce, accessing and managing the store's data. The backend is built with Node.js and express. By default and for development purposes it provides support for SQLite for the database, however, it also provides support for PostgreSQL and Redis.
Next comes the storefront. Medusa provides 2 storefronts that you can use, one built with Next.js and another with Gatsby.js. The storefront connects to the backend and provides a slick design and a fast experience for your users.
The last building block is the admin dashboard. The admin dashboard connects to the backend and allows you to easily manage products, orders, customers, and settings.
The only building block required to use Medusa is the backend. With the backend, you are able to customize your storefront as you see fit. Although Medusa provides a storefront that you can use, you are not obligated to use it and can create your own. The same goes for the admin dashboard.
E-Commerce Features
In this section, we'll cover some of the e-commerce features that Medusa provides. These are the features that you should expect when you create a store with Medusa.
Product Variants
In Medusa, you can easily add product variants like Size. You can also add multiple prices for different currencies, manage the inventory of each variant, and more.
Discounts
You can add discounts or offer free shipping based on region. You can apply the discount as a percentage or as a fixed amount.
Gift Cards
Gift cards come built-in in Medusa. You can set an image for the gift card, manage how much the gift card is worth and add different worths for a gift card, and more.
Multiple Currencies
In Medusa, you can choose multiple currencies for your store and set a default one.
Multiple Regions
Medusa allows you to add multiple regions, each having its own countries that are part of the region, payment method, shipping method, currency, and more.
Medusa's Strong Points
Blazingly Fast
As the frontend is decoupled from the backend, it removes the extra workload that is usually done in tightly coupled systems.
In addition, static site generators like Gatsby can be used to generate the storefront which would only need to connect to the backend through the REST APIs.
Highly Customizable
The decoupling of the frontend from the backend allows you to customize your storefront freely. You can pick whatever programming language or framework you wish to use for the front end.
That's one of the benefits of headless commerce. You are free to focus on the front end and get creative with it without the shackles of the backend.
Easy Development
One of the cons of a lot of popular e-commerce platforms is that they get too complicated or hard to learn. So, although they provide a lot of features that are enough to launch a store as is if you need to do any custom development you might need a lot of time to learn or understand its architecture.
Medusa is easy to use. In addition to the REST APIs available by default, you can easily add your own APIs. You can also create plugins to add missing functionalities or integrations that you need for your store.
Easy Setup and Deployment
You can set up a medusa store locally in a matter of minutes. With just 3 commands at most, you can have the backend, frontend, and admin dashboard all installed and ready to use.
Similarly, its deployment is easy as well. Medusa's documentation already has a guide on how to deploy the backend on Heruko, and the admin dashboard on Netlify.
Medusa's Cons
No Internationalization
At the moment of writing this, Medusa does not support multiple languages. Internationalization is a very important aspect of e-commerce.
So, if your store needs to support languages other than the English language, then Medusa is not a good option.
Medusa's roadmap shows that Localization is a planned task. So, in the future, it should be available.
Lack of Community Plugins
As Medusa is relatively new, at the moment there aren't many plugins created by the community to add custom functionalities to a Medusa store.
This is especially essential when it comes to payment and shipment integrations. Medusa comes with support for Stripe by default. Any additional payment or shipment services integration needs to be developed by you.
Simple Storefront
Although we all love simplicity, the storefronts that Medusa currently provides are too simple. For example, although you can add multiple regions or currencies in the admin panel, there's no way to actually switch between them when using the storefronts Medusa provides.
This won't be a problem if you're mostly relying on Medusa's headless commerce backend, or you're looking to customize your frontend as necessary for you. However, if you need to use the frontend as is with additional development, then you need to consider this first.
When Should You Use Medusa
Medusa is the perfect option if you are looking for headless commerce. With its easy setup, you can have a headless commerce backend ready in a few minutes.
Medusa is also perfect if you're looking for complete freedom when designing your storefront. Even if you use one of its storefronts, you can easily make changes to the design as you find fitting.
Medusa is also one of the very few options available to build e-commerce stores with modern technologies.
Conclusion
Medusa is still an evolving e-commerce platform. Yet, it still offers promising results compared to a lot of other e-commerce platforms when it comes to performance, customization, and other pros we've discussed throughout the article.
You can get started with Medusa in minutes with their Quickstart documentation.