Great Experience Moving from Mantra to the Meteor Guide App Structure


#1

When I first started learning Meteor, it was before Meteor Guide described a desired application structure. So I used @arunoda’s Mantra figuring it would be a fast way to have a properly set-up app structure for Meteor.

While @arunoda’s Kadira and Flow Router are brilliant and continue to be widely used, his Mantra project turned out to be a dead end. It was never turned over to the community and its forum has been shut down.

So it was time for me to remove Mantra from my app. I figured it could take a month of spare time hours to learn how to get an app running in the Meteor standard folder structure, because it took about that long to get my app running in Mantra.

In fact it only took a few days! I used meteor create appName --full to generate the recommended folder structure and easily moved my app files over and got them working. I was very impressed with Meteor.


#2

There is no need for mantra. However there are diff strategies for folder structure. I honestly thought it brings even more complexity into the chaos, it felt over-engineered and unnecessary.

Example, instead of “/imports/ui” use “/imports/client”, this way if you do a change in it, it will only refresh the client, app will be faster.

Always keep your methods/publications in /api/{whatever}/server, making a change in them will only restart the server, and not your browser.

Modularization:
/imports/modules/payments/api
/imports/modules/payments/client

It’s important that you keep api and ui as close as you can if they work hand in hand. At least some modules of UI not everything. For example, we have a package where we have a CreditCardForm that accepts an onSubmit handler and is easily manipulateable.

Microservicification for even bigger apps:
/root/modules/payments
/root/app/imports/modules --SYMLINK-- …/…/modules
/root/admin/imports/modules–SYMLINK-- …/…/modules

To promote reusability amongst microservices.

There are so many other tricks I found in terms of organizing UI and API… If you guys want, I can make time to write a solid article about it.


#3

That would be great - One for the guide in fact - esp. microservice structure with Meteor.


#4

That would be extremely helpful!


#5

Mind expanding on the Microservicification? Any good resources to read more on those? I’m looking to separate things out into their own packages.

+1 @vikr00001 Would be a great article.


#6

Hello. I’m sorry for the delay. But I managed to finish Chapter 3. I still have some elements to add, but it’s 85% done. Thanks! There you will see more about microservice architecture.