Medusa 2.0 is finally here

As of 23rd October, the medusa core team release the official 2.0.0 as promised! This means we are no longer working with a "preview" or "release candidate" version. In this article I will cover what's new in the next generation of medusa, and of course, share my one-click deploy template for Railway, which have been updated to the new final release version.

To skip reading and go straight to the deploy template, use the wheel thingy on your mouse, until you see a purple button.

Video instrucitons

So what is new in medusajs 2.0?

MedusaJS 2.0 introduces several exciting updates that enhance both the user experience and the developer's ability to customize the platform.

  • Reworked Admin Dashboard: The admin dashboard has been revamped to offer a more intuitive and aesthetically pleasing interface. This update simplifies tasks such as creating product variants, reducing the repetitive configuration needed when adding products with multiple options like size and color. But also adds UI for additional features, such as...:
  • Enhanced Inventory Management: Inventory management now supports multiple warehouses, making it easier to scale your business without hassle. MedusaJS 2.0 ensures you have the tools needed for much more advanced inventory management compared to version 1.0.
  • New Promotions Engine: The updated promotions engine allows for detailed configuration of discounts and price campaigns, enhancing the admin/manager user experience by providing more flexibility in marketing strategies.

Under the hood, key changes;

  • Improved Software Architecture: The architecture has been redesigned to facilitate greater customization, making it easier for developers to add new features to their e-commerce projects. This aligns with Medusa's goal of being a highly customizable e-commerce stack. From my experience, building custom features on this platform is intuitive and easy—just build, plug, and play.
  • Database Structure Updates: Changes to the database's relational structure enable more adaptability in the Medusa data model. You can now modify parts of the datamodel while excluding entities you don't need, further enhancing customization options.
  • New Query Tool: A new query tool simplifies data fetching from the database without needing to manually pass a database connection. This feature improves development speed and ease, as it handles database interactions seamlessly from any part of your application. It's a significant quality-of-life improvement for developers.

For those using MedusaJS for a simple webshop with the storefront starter, there may not be many visible changes when upgrading to version 2.0 at this time. However, I still recommend using Medusa 2.0 for new projects since it's the latest major version that will continue to receive updates and new features.

Overall, MedusaJS 2.0 offers substantial improvements that benefit both business operations and development processes. Whether you're managing inventory or building custom features, this update provides tools that make your e-commerce journey smoother and more efficient. At this point, open-source e-commerce platforms like MedusaJS are becoming serious competitors to enterprise solutions such as Shopify. If I were one of those enterprise competitors, I would definitely be on my toes, as MedusaJS continues to push the boundaries.

You can read the full 2.0.0 change log here: https://medusajs.com/changelog/#v2.0.0

MedusaJS 2.0 Railway one-click deploy template

MedusaJS 2.0 on Railway service diagram

As this is now the 4th Railway deploy template I am working on, I have gained some experience, which has resulted in this template being the best so far. Here are some improvements:

  • No setup needed. Storefront, redis, Postgres database, medusa 2.0 backend, storage service, automatically configured and connected.
  • Automatic sharing of publishable api key, between backend and storefront.
  • Production ready, self managed open source bucket storage by MinIO, for all your media, with powerful user interface.
  • Health checks for deploys. Green checkmark now means that your app is 100% ready and running, you don't need to wait another ½-1 minute.
  • Automatic admin user creation with unique strong random password.
  • Automatic strong secrets for JWT_SECRET and COOKIE_SECRET

Preconfigured services (optional):

  • Payment with Stripe, plugin preinstalled (api key needed)
  • Emailing with Resend or Sendgrid, plugin preinstalled (api key needed)

Requirements

v2.0.4 🤩 updated 21. Nov. 2024

OBS: Hobby plan (5$/month) is required to run this template in the cloud💸- but if you don't want to pay, and just want to run it locally watch this video and launch the trial template instead ⬇️

Deploy Medusajs 2.0 + Storefront (TRIAL) on Railway
Full ecommerce solution, manage products, inventory, orders, etc.

Railway only allow free users a total of 5 services at once. The trial template does not contain the bucket medisa web interface console. This is a optional component (nice to have, not need to have)

Succuessfully deployed, what's next?

Congratulations! You've successfully deployed the seed of your project - a somewhat generic, yet fully functional Medusa.js 2.0 stack. While it is not personalized yet, it's a robust foundation for you to build on top of. Now comes the fun part: growing, shaping, and maintaining your project to align with your vision, whether it's for a hobby project or a business venture.

In the deployment video, I demonstrated a simple customization to get you started. However, to help you take your project to the next level, I am actively maintining a list of invaluable resources.

Self help

How to Run your Medusajs 2.0 boilerplate locally
Requirements Until now, everything has been done in your browser, but that is about to change. To make changes to your medusa project, you will need some web development tools. If you already have these tools, please scroll past this step. If you have never heard of any of these
How to add Stripe payment module to medusajs 2.0
Video Instructions Links Stripe module medusa 2.0 documentation: https://docs.medusajs.com/v2/resources/commerce-modules/payment/payment-provider/stripe GitHub repo config example: https://github.com/rpuls/medusajs-2.0-for-railway-boilerplate/blob/master/backend/medusa-config.js Video demonstarti…
Caching - perseides
Implementing caching strategies in Medusa

... more coming soon!

Ask for help

Honorable mentions

Thanks to everyone who contributed to this supercharged Medusa 2.0 starter template!

Analytics disclaimer

I have decided to introduce a little piece of analytics in this template. This is turned on by default, but not required, and can be turned off by deleting environment variable on the backend service by the key: TEMPLATE_REPORTER_URL. Normally I can see in the Railway dashboard, how many people have used my deploy template, and how many live projects there are - but I recently discovered that those numbers are incorrect, and therefore I was quite devastated when I found out that one of my templates, that I was investing a lot of time in, barely was used by anyone. For that reason, I have decided to take user engagement analytics into own hands, and I really hope that you will participate and leave the feature on, to help me get a better idea where my time is best spent. When left on, I will be pinged with your railway project id when you launch the template - no personal information is tracked.

Also... I welcome questions from people, and I'm happy to help as much as I can. However, it can be time-consuming. Not so long ago, I had a bad experience with someone who cloned my Git repository, made changes, and attempted to deploy it on Railway. When this didn't work out for them, they reached out to me, pretending there was a problem with my deployment template and asked for help in debugging their error messages. At some point, I realized what was happening and told them to use the template if they wanted it to work out of the box. If they wanted something different, they would need to spend their own time making that work.

This is another reason why I'd like to track project IDs when my template is used, so I can verify that someone asking for help is actually a template user. So, if you reach out with a question, I might ask for your project ID—something for something 😉