Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ember with Node (MEEN stack?)

I've been building apps on the Rails platform for over a year now. That being said, if you can make any comparisons to the Rails equivalent, it might help all parties involved. Just a thought.

Anyway, I'm trying to wrap my head around node, and the front end framework, ember. I was originally intrigued by stumbling across the MEAN stack. After digging into that a bit, I realized I didn't really like angular all that much, and started looking up alternates. Ember seems pretty awesome, and the syntax seems much cleaner without all of the ng- markup to the DOM. I'd like to experiment with mongoDB, and I feel like this approach will teach me a lot.

My question, I guess, is Express. What is the role of Express when using Node? It seems that Ember (even Angular, for that matter) has a pretty expressive router. In my limited understanding of it all, I thought Express was for routes? I found this, which seems to be a MEEN stack of sorts.

The package.json for MEAN is massive, but that MEEN I linked to, is very tiny, with just express, mongoose, and request. Another question, I suppose, is what are the different roles in a MEAN / MEEN stack? Does that make sense? I'm rambling a bit, lol, but I'm hoping to keep researching and playing with this stuff until I have that 'Ah ha!' moment, you know?

mongoose - seems to be a better way of interacting with mongoDB?

express - routes specific to node?

request - seems simple enough. send external requests to other pages on the web. I can't see what the equivalent package would be in MEAN, is this truly needed?

grunt - runs a bunch of stuff so that all the different parts play nicely together?

Any explanations, links, or help are greatly appreciated.

like image 714
Dudo Avatar asked Jan 06 '14 21:01

Dudo


1 Answers

If you're coming from Rails I'd break it down like this:

node.js -> Ruby - your server side language / platform

express -> Rails - your server side framework, although a little more like Sinatra

grunt -> Rake - your preprocessor / build tool

npm -> gem - your server side package manager

Angular.js / Ember.js -> No direct map, your client side framework.

mongoose.js -> ActiveRecord, but for MongoDb. If you want a SQL ORM use Sequelize

Two other tools worth learning are

bower -> your client side package manager, for things like bootstrap

yeoman -> all round js app scaffolding, ties everything together, a great tool to see how to scaffold "best practice" apps.

like image 110
Doobi Avatar answered Nov 01 '22 10:11

Doobi