2

I am now building a native mobile application in Nativescript, leveraging my JS knowledge.

So, I though to switch to some other Nodejs framework.

My app's backend requirements will be:

  • pure JS
  • complete backend logic (i.e. controller)
  • connect to a MongoDB database
  • RESTful
  • non-frontend-dependent
  • non-DOM-dependent
  • easy-yet-complete to use: should be a framework which gives strong foundations to make a solid and efficient backend for a (relatively) inexperienced backend developer (except for Java basics and experience with pure PHP)

I was considering using my existing knowledge of Meteor but I can't implement any existing experiment of using ddp and websockets in it.

Some of the possibilities I was considering to give a try to:

  • Loopback
  • Total.js
  • Hapi.js
  • Sail.js
  • I am fine with any JS-based framework, whether it's NodeJS based or not
  • I am also open to a REST API solution which exposes Meteor backend, as long as is doesn't require ddp to be usable (it's not very clear to me what are the limits of non using DDP when using Meteor)

Any concrete advice, which would eventually avoid me trying all of them, before discovering they don't work with Nativescript or don't satisfy my requirements?

vijay
  • 10,276
  • 11
  • 64
  • 79
dragonmnl
  • 14,578
  • 33
  • 84
  • 129
  • 1
    if I'm not wrong, Hapi, Sails, Loopback and Restify, they were built on top of express.js. I asked this same question to myself couple days ago, and I decide to use pure express.js. I my case, I wanted to create a REST API, some people say that expressjs is an overkill. However, it is the most popular node framework, there's a lot of materials on the internet and it is pretty simple to use. So, I chose pure expressjs. I also have to tell you, that your question is opinion-based, and it does not fit in the SO – Fabio Jan 03 '16 at 20:23
  • I'm aware it's kinda opinion based. but where should I ask? this is a programming related question with specific requirements – dragonmnl Jan 03 '16 at 20:24

1 Answers1

1

SailsJs is a wrapper around express.js with many add-ons and shortcuts that eases your life and shortens the code required to write, and it's very much suitable to write RESTful apps.

HAPI and Total, I didn't use them myself, but there are very good reviews about them, but when it comes to Sails, it's the highest in popularity, hence, better tested and used, which leads to a more mature framework over the time.

Loopback is good, but it requires payment at some point of usage, and still Sails is more popular.

Meteor.js is great, but it's not the right tool for that job, and it might take you more effort to make it as an easy to use RESTful framework, not to mention the un-needed memory and processing overhead, which has it's uses, but not in RESTful case. I tried to use it to write RESTful apps but didn't feel the ease and the low memory footprint as I experienced with express and Sails.

Update

Sails has clear and easy to use MVC style, with a command line to generate apis, configure-and-fine-tune-later APIs style, which is very much needed in prototyping and PoC applications, as well as short time to market.

Update 2

Sails ORM supports both SQL and NoSQL DBs, with dozen of supported drivers out there

securecurve
  • 5,589
  • 5
  • 45
  • 80
  • What I'm not sure about SailJS is that it's frontend-agnostic but still provide the "V" in "MVC" model which is totally useless in my case as it'd be implemented in Nativescript but it seems to allow using the backend via REST APIs which should serve my goal – dragonmnl Jan 03 '16 at 21:26
  • In NativeScript you can use Node modules, which don't have platform dependecies. – Neli Chakarova Jan 07 '16 at 10:41
  • I was also looking into SailsJS but looks like it has several issues in apps meant to be scalable. also, I'm not very sure how development is going on. Issues on Github closed after ages, after years not even v1. 0 (if that matters). Happy to be wrong of course :) – dragonmnl Jul 25 '16 at 11:51
  • You are not wrong. But ... Sails is a good option if you have a small to medium sized project, specially if you are creating api baed app, generation of apis are so easy and quick, but at some point as, you grow, you start to feel things are slower, and you need to tinker Sails to match your needs. If you do this, why would you use Sails, Express (though the boilerplate code) is a better option here, since everything is open to you already, and you program it the way you like – securecurve Jul 25 '16 at 14:07
  • Sails is really a good project, with lots of DB drivers, but it probably needs more attention from the community of JS to make it a better option, and already it is – securecurve Jul 25 '16 at 14:09