Help me find the 20/80 for Meteor

Hi guys!

Pretty newbie Meteor developer here. Iā€™m more of a designer/ux-developer (using front-end languages) and since Iā€™m a big fan of the Pareto Principe I was wondering how I could apply this to Meteor.

So my question is: whatā€™s the 20 percent (or 30, 40 letā€™s not get hung up by numbers ;)) would account for 80 percent of your work while developing with the Meteor framework? What are the things I should learn first in order for me to build most of my app and then worry about the details later? What methods/functions do you keep using over and over that you consider a must-know from the start? Are there any patterns which I should learn first?

Iā€™ve seen some jquery and underscore in Meteor as well as mongodb, spacebars and read about blaze. Iā€™m quite unfamiliar with mongodb/blaze, could we apply the 20/80 rule here again?

Would love to hear from you!

edit: I donā€™t even wanna start about the react/angular integrations Iā€™ve seen on some vids/articles. I would guess this is not really applicable in my case, right?

1 Like
  • Learn a UI Framework like Semantic UI or Bootstrap to get the UI done with the smallest amount of work
  • Use existing packages (Atmosphere, npm, bower) to get a lot of the common functionality done. A very good example is the useraccounts package.

Blaze is very fundamental and you should learn it. Many Atmosphere packages support Blaze. Also MongoDB is fundamental to an app and you should learn it. For both Blaze and MongoDB, you can get started quickly by learning the basics and learn more details as you go.

3 Likes

Iā€™ve been working with Meteor for less than a year, and I started out with a similar approach. So I can give an attempt of a list for someone starting as a complete beginner (Meteor was my first framework apart from very basic Rails).

  • Learn JavaScript basics
  • Learn how to read documentation

Both of the above steps were major for me. Once I passed each of them (the first one helps with the second) I immediately got about 3x faster.

Other essentials are, as you mention, Mongodb, Blaze and I would add Iron Router and how to use server methods. Along with basic HTML/CSS skills those are everything you need to get started.

For Mongo - Learn how to do queries in different ways. Itā€™s quite straightforward, as long as you understand how JSON and document oriented databases work.

For Blaze - Learn how Blaze uses helpers and data, and how the Template scope and functions work (the official Meteor docs are very helpful here). You will need to use several Template functions, such as onRendered, onCreated, helpers, events and so on, so have a look through all of them. I wouldnā€™t worry about AngularJS or React in the beginning, as I found both a little harder to use as a novice.

The Iron Router is mostly straightforward, and most of the time (in the beginning) you will just define routes, what data to load and add some actions to a route.

You should also familiarize yourself with things like packages, the Session, reactivity and common structures of a Meteor app.

Once you get a little better you should go back and learn how async programming works and how that pairs with Meteorā€™s reactivity. This was one of the rough patches for me as I found it very difficult to connect to external APIs.

All that being said, I would love to hear the recommendations of more experienced developers. But this is at least my two cents as a fellow beginner.

Yes, stick to Blaze, thatā€™s the 20/80 approach for Meteor.

For router, Iā€™d go with Flow Router+BlazeLayout simply because itā€™s focused only on routing. It will let you do your job without thinking of details.

+1 for use of UserAccounts packages in your case.

Other than what was already said, use SimpleSchema+Collection2+Autoform to generate all the work with forms and updating the data you need. It will let you to very quickly start writing complex forms and will do validation for you on both frontend and backend. Also, while itā€™s easy to just start to use after a short time, itā€™s flexible enough so later you will be able to utilize it for more complex stuff when you learn Meteor better.

What methods/functions do you keep using over and over that you consider a must-know from the start?

Learn how to write server methods and global helpers. Master the use of each loops in your templates, they will be crucial for your apps. Learn how to write database schemas - while you can use Mongo without them, they will let you do a big step to the 20/80 approach.

1 Like

Can you point out where to learn about schemas?

That depends on what schemas you want to use. Weā€™ve got two great options in SimpleSchema/Collection2 and Astronomy. While Astronomy is a very good package, so far it lacks things like form generator, so Iā€™d recommend you to go with SimpleSchema/Collection2 and just read their docs:


Edited: The author of Astronomy stated it hits 1.0 next week, so take a look at this project, maybe youā€™ll find it better suiting your needs. I used it and itā€™s a pleasure to work with it too.

Hey thx for replying! The part on UI is actually my strength, so wouldnā€™t need to much help on that part.

So what about Blaze should I really learn? I donā€™t really understand what it is, as Iā€™ve not seen it before. But I read a bit about Tracker. What else would I need to know about blaze in order for it to work for me?

He Vegard! Thx for your long reply! Those points are some what I thought would be quite important. I know the basics but Iā€™m especially concerned about reading documentation. Often when I look at documentation I just see a lot of terminology I donā€™t understand, a lot of keywords that donā€™t mean anything to me and usually because I donā€™t understand it, I read through it while spacing out and not understanding what the concrete follow-up action should be. Any help you can provide me on that part as hopefully youā€™ve had sort of the same experience :smile:

Ah I think you actually answered my question to @Sanjo. What about Tracker?

@brajt Thanks for answering as well! I donā€™t really understand whatā€™s better about flow router and blazelayout compared to iron router. So itā€™s more focused on doing one thing, wouldnā€™t you be missing out on certain functionality? (or is that exactly the 80% I donā€™t want to learn yet) Thanks for the other suggestions!

I had the exact same experience when I first started out. Unfortunately I donā€™t really have a quick fix except practicing different concepts and looking up the documentation every time you do. You can also look at other peopleā€™s code by inspecting packages and example apps, and try to backtrack by looking up what the code actually does. I donā€™t think reading everything from beginning to end is neccessary. Just take it bite by bite. Documentation is like grammar (or sheet music), which you should look up when you need it - and as often as possible at first. If you donā€™t understand a term - like modifier, callback, operator etc - look it up. Eventually youā€™ll understand more and more, and at a certain point documentation becomes your best friend and will feel very empowering. At least it did for me. I would also highly recommend the Discover Meteor book. It goes a long way in explaining the core concepts for Meteor in bite-sized chapters.

As for picking routers. I havenā€™t really worked with Flow Router, but it looks very promising and easier than Iron Router. However, I think most examples and packages that depend on a router at this point use Iron Router, so it might be a good idea to start with that one and rather move to Flow Router later.

@flowen yes, the rest is 80% you want to leave for later. Itā€™s not like youā€™d be missing a certain functionality - Flow Router is just based on an opinion that this functionality should be left for other parts of the stack, not the router. Well, the least you should do is to actually get to know any router at all.

As for Blaze, start with:

  1. how to define a template
  2. how to write a helper (and global helpers)
  3. how to write an event
  4. how to use spacebars (template language)
  5. master the use of #each and inheritance of data in templates

Hello! Welcome to the community :smile:

My advice:

whatā€™s the 20 percent would account for 80 percent of your work while developing with the Meteor framework?

  • The combined simplicity and flexibility of the API which allows you to prototype and iterate quickly and efficiently.

What are the things I should learn first in order for me to build most of my app and then worry about the details later?

  • Best practices/options for things such as routing.
  • Know that Kadira is available to help with your debugging

What methods/functions do you keep using over and over that you consider a must-know from the start?

  • I think this is fairly app-specific, though I recently made a simple ā€œwrapperā€ function for console.log that will only run in debug mode - saves me from removing them later on :wink:
  • & as you mentioned, underscore is used by Meteor and provides many useful functions already.

Are there any patterns which I should learn first?

  • Familiarise yourself with Meteor packages and itā€™s API. It allows you more control over file load order, re-usability and modularity.

Blaze enables you to create dynamic user interfaces that respond to the user interaction. Resources are:

If you have a lot of state in your UI, I recommend the viewmodel pattern.

You might check out my package dalgard:viewmodel ā€“ a leaner, meaner version of the venerable manuel:viewmodel package.

1 Like