Choosing the right seed for Mean stack
When faced with a challenge of new project, I tend to either go with some completely new technology — just for the fun of it, or reuse the stack that I consider currently best for me.
But, as beautiful the Mean stack is, there are no canonical way to do it. No predefined folder structures, no preset precompilators, no deployment scripts. Nothing except general idea and lot of opinionated approaches to it.
So, what options are there for a newcomer to Mean stack?
As a first I will mention one of the oldest implementations — Mean.io. It used to be quite nice boilerplate of all the four main ingredients of the stack. It was quite bare bones, with only a Jade html templating for server side and couple of Mocha tests thrown in. Folder structure and naming convention was maybe not the best, but it was there, and it was usable.
So, I went on happily using this wonderful stack, and as it was just a boilerplate, there was no ongoing feedback from the Mean.io — all the changes I noticed only when I wanted to start a next project.
Suddenly I could not understand anymore how server parts of Mean are connected. There were lot more files involved now and no more crystal clear link between server.js, routes.js, express.js and config.js. Now there were some specific system modules, some things included automatically, some not. from 25+ npm packages, node_modules folder had grown to 55+. Now it also has better testing tools and good set of gulp tasks to ease development.
How it all worked together — I did not know anymore. But it worked and worked quite well for its intended purpose. But it felt like Mean.io has become lot more opinionated, and also they have made lot of decisions for me already — how to define menus, how to handle users, how to package different parts of code. How it all should be run together, how it should be tested. And also a bunch of custom full-stack packages built for Mean.io
It was just too much for me, from clean well tested boilerplate at start it had become almost a framework. Framework that adds all the complexity of framework, but not really a comparable amount of added value. I tried, but I just could’t fall in love with this stack-turned-framework.
Now when looking at Mean.io months later, looks like it has been growing in same direction. More framework, more magic, more packages, less clarity.
Second big contender of Mean space is Mean.js. Fork of Mean.io authored by one of original creators. It was forked around the time when Mean.io introduced packages and modules, so it contains same of that unfortunate complexity as well. It is just as complex as Mean.io when it comes to server side code. And it also includes almost the same amount of npm packages. However, it feels a lot less pushy on what should be used and how.
It comes as a nice Yeoman generator, that is kind enough to ask if you at least some preferences for Angular, even if not much else. Also it comes with set of Grunt tasks, which is handy.
Overall, this is not bad place to start Mean journey, there will be some stuff harder to understand in server side, but as long as you will not deviate from path set by Mean.js authors, that should not be a problem.
All the setup works, only, same problem as for Mean.io — more it becomes a framework, less obvious the code is, the more dependent it is on the size of community and amount of documentation.
This is our third participant in today's mean development list.
Compared to previous two, MEAN Boilerplate maintains its boilerplate nature of it directly in its name. There are no framework motive beneath, it is really just a boilerplate.
On a server side, it has only 20+ npm packages, and on client side about the same amount of bower components as Mean.io and Mean.js. There are some more optimizations, fixes and presets for client side, but not too many.
This particular part was a biggest downside for me, as I do not want to move to Coffeescript right now. And also YAML feels like a redundant supplement to Mean stack.
Boilerplate does not have Gulp or Grunt scripts, however it has hot code reload with nodemon preconfigured.
Also there is a ruby dependency for scheduler, which could be removed rather easily if not used.
Compared to other boilerplates, there are no good usage examples included, when starting up server it shows only a logo with one input field showing off basic Angular code. No Articles, Users or To-do list to see all MVC in action.
Overall — good choice if you are experienced Mean stack user and also fond of Coffeescript. If not — still useful to at least peak around the code, probably there are some goodies for you to find and pick up. However, I would not suggest this as a starting point into Mean journey.
AngularJS Full-Stack generator
It does not have anything resembling logo, so I will omit that. It is featuring Angular proudly in its name, and rest of the Mean stack applications only in description. In essence it is advanced Yeoman generator for Mean stack.
Grunt setup is advanced with linting, testing, minifying, uglyfying and separate dist folder. All well prepared to do good coding and deployment practices right from the start.
There are also some rather full usage examples included, for Users and for Things in main page. Examples let you immediately see how to use Angular, Node and Mongo in conjunction both in client and server side as well as presents proposed naming conventions, which are quite good as well.
Right now it seems that generated Html version contains full example, while Jade version is missing interactive part. I have reported that here.
In general development of this generator seems active, issues are being answered and new code is being commited.
This is good choice for newcomer to Mean stack, as well as to seasoned developer. It delivers exactly what is required, and lets you choose alternatives wherever needed. No extra magic code, no extra libraries.
And even if it feels like there are no extra libraries, it still manages to bring hefty 75 npm modules to the battle — the most among today's contenders.
Ultimate Seed has a subheading ’Mean stack on steroids’. And it certainly is. A lot of extra libraries are packed in there, the most among our contenders. There are Redis for session storage and Winston for logfile storage in server side, Handlebars and AngularUI in client side and much more.
While you most likely will end up needed AngularUI, the same will not necessarily be true for lot of other components packed in this boilerplate. And there are no choices to be made when generating the code, take it or leave it.
This boilerplate has lot of opinions about how things should be done, and all those opinions are backed up with code written to wire them together. and code to deploy to Heroku, and core to deploy to Docker containers. A lot of stuff. Although only 47 npm packages — less than many of other seeds reviewed today.
I think that this is excellent boilerplate if you have reached the stage when your application needs are just as complex as Ultimate seed offers. If you have not, it is still good place where to look how to do various things in Mean stack, from Redis to Docker, from Protractor tests to advanced grunt tasks and from Browserify to Modernizr.
Compared to other generators, this does not seem to have a lot of attention from the maintainers, with latest commit being already months ago. However, it is still excellent piece of technology exhibition.
Overall, my choice for now is AngularJS full-stack generator with Mean.js coming as a second option.
Ultimate seed is cool, but just packs too much of a punch to start with. Mean.io is going in strange direction and maybe will end up being something awesome. Or maybe not.
If there are any other notable mean seeds, generators, boilerplates or frameworks — do not hesitate to comment.