Medusa 2.0 is finally here

Medusa 2.0 is finally here

Yes, it did take a bit longer than expected, and yes the preview version is not without shortcomings. But nonetheless, it is here now, and after more evenings than I can count on one hand I finally managed to have a fully functional medusajs 2.0 running on Railway. As alway, in this article you will find a 1-click deploy template, so with zero effort you can get your very own medusajs 2.0 preview instance, at its current state.

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

What to expect from the "preview" version

It is important to understand that the medusa development team, refers to the current version as "preview". So it is a beta version that is incomplete, both in terms of features, stability and documentation.

This is not meant to be negative feedback! Just my honest experience so far.

My experience with the preview version so far has been straight up a very steep hill. Documentation is lacking, and so are what seems to me, obvious key features. I am sure the documentation will be rock solid in the future, but it is unclear to me what features will be developed along the way, and what features they will leave for you to implement yourself. Let me give you an example, once you spin up the admin dashboard and want to add a new admin user, you can do so by navigating to the user page, and then type in an email address of the admin user you want to invite. There's then a "send invite" button that you would think would send an invitation, but even after installing email plugin sendgrid, and testing that it works, I was not getting any invitation mail in my inbox. And it seems like this is something you have to develop yourself. So I dipped my toe into that, and found that I had to use the event system to subscribe to the user.invite.created event, and then send a message, by using the notification service and providing a template id. Unfortunately, the invite event doesn't even contain the invite token, so that you also have to fetch somehow. I wanted to try to lookup the invite in the database to get the token so I could manually construct the invite link and include in the email, but it wasn't clear to me how to look up the invite. I did find some example for looking up orders, but they used a service for that which did not exist for invites, so I would have to create a module myself, to expose functions that would look up invites, and at this point I was biting my teeth a bit, because it felt like a domino effect of things I needed to build, just to get this email to send - and not knowing whether this feature will be developed by the team in the future or not. Unfortunately I can't find a roadmap with a list of features that they are working on, so this is still a bit of a mystery to me. For now I decided not to develop the invite email logic, and hoping it will be shipped in a future update. While scratching my head I asked quite a few times in the community discord, but the help to get there is as scarce as the documentation.

The reason why I am emphasizing this, is so you don't get some false idea about what this deploy template comes with.

So what is new in medusajs 2.0?

You get a reworked admin dashboard, that look and feels somewhat nicer. Also the product variant creation have been simplified a little so you don't have to repeat as much configuration as you did before, when adding products of multiple variants (such as size + color combination). The software architecture have also been reworked to accommodate customization even more, this is going to make your life easier for those of you who intend to build features into your ecommerce stack. If you are just aiming for a simple webshop, there isn't much new juice - at least not for now, but I would still recommend using this template (medusa 2.0) for your simple webshop, as this is the new major version that will be maintained with updates and new features going forward.

The medusajs 2.0 one-click deploy template

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 automatically configured and connected.
  • Internal media storage, no need to sign up with Cloudinary and provide api keys and what not.
  • 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.

Other key features:

  • Payment with Stripe, plugin preinstalled (api key needed)
  • Emailing with Sendgrid, plugin preinstalled (api key needed)
Deploy on Railway

OBS: Hobby plan (5$/month) is required to use this template 💸

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... some people reach out with questions, which is fine of course, I am happy to answer as good as I can. But this is also time consuming, and I had a bad experience not so long ago, with someone cloning my git repository, changing things in it, and then attempting to deploy it on railway. When this didn't work out for this person, they reached out to me, pretending that there was a problem with my deploy template and asked me to help debugging their error messages. At some point I realized what was going on, and told this person to use the template if they want it to work out of the box, and if they want something else then they'll have to spend their own time trying to get that to work. So this is another reason why I'd like to track project ids when my template is used, so I eventually 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 😉

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. 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've compiled a list of invaluable resources.

Self help

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/stripeGitHub repo config example: https://github.com/rpuls/medusajs-2.0-for-railway-boilerplate/blob/master/backend/medusa-config.jsVideo demonstarti…

... more coming soon!

Ask for help