Mobile app with Node.js backend - What framework to pick for client-side dev? - node.js

I'm planning to build a hybrid mobile app,
I have already progressed pretty well with the server-side using Express 3, and PAssport for authentication.
Now I need to make a decision on what framework or library to use for the clinet-side.
I was wondering if I could get some recommendations and perhaps pros and cons of going with frameworks like
Sencha Touch, JQuery Mobile, Phonegap....
and if there is anyother ones that you think it's worth considering please mention them here,
Thanks for any pointers or advice

JQuery Mobile and Sencha Touch are JavaScript libraries that will let you create an HTML5 application that looks like a native application. Cordova/Phonegap lets you wrap your HTML5 app in native code and provides a common JavaScript API that gives you access to native functionality, like taking a picture with the camera or getting the users Contacts. Another benefit of using Cordova is that it creates native applications for you using the same HTML5 app, so you can publish these files to App stores and increase your distribution. With a JQuery/Sencha Touch only app, you can't distribute on app stores because your hybrid app is simply a website (so, I guess it'd only be a mobile app.)
There are hundreds of blog posts comparing different JavaScript frameworks like Sencha vs jQuery vs Dojo, so you should just go off and do some of that reading. Personally I would suggest Dojo as I think it is the most powerful and enterprise ready framework, but it can have a steep learning curve. One thing I like about Dojo though is the build system, you can pick and choose the modules you want so that you don't have to end up including an enormous .js file like JQuery. I have no idea if jQuery can do this, but a lot of user apps I have seen that use Cordova and JQuery end up including all of jQuery and then jQuery mobile.
If you want to access native device features and/or package the web app as a native app and distribute it on the stores, you should use one of those JavaScript frameworks in combinations with Cordova. (Cordova is the new name for PhoneGap.) Phonegap/Cordova is not really used to build mobile web apps, it's used to extend the capabilities of mobile web apps and allow them to access native device functionality in a completely cross platform way.

Ionic is a new framework available for making hybrid apps that I am liking a lot so far. The framework is built with Sass and AngularJS on top of PhoneGap. Ionic just handles the front end so you still build your app with PhoneGap. I found that since it uses AngularJS your javascript code ends up being a lot cleaner and you will save development time making your app slick compared to what you would have to write with jQuery. It also has some beautiful UI elements. The ionic team has done a lot of speed optimizations with the framework so your app will feel more native than your typical hybrid app built purely with PhoneGap. The framework is still in alpha but I have been impressed with it.

Related

CRUD in Electron

Could you please give me a piece of advice about how to implement CRUD or DB(PouchDB) modifications using FORMs or any other efficient way in Electron?
The point is I would like whole application to behave as desktop tool and it seems to be possible in Electron. However I cannot determine the best way to do this especially if I would like to add to nice eye-candy tricks to make UX as smooth as possible.
First of all electron is not responsible for the visual appearance of your application. It is a framework which wraps your webapp into a desktop application.
That means you need to use standard web technologies (html/js/css) to create your site including 'eye-candy' and animations.
My suggestion is to do a tutorial which explains how to connect electron with a javascript framework like angular. If this is running you can attach a database and all the hot shizzle afterwards.
This tutorial is very good and well explained:
https://scotch.io/tutorials/creating-desktop-applications-with-angularjs-and-github-electron
enjoy!

Has Node JS anything to offer for the UI?

Hope I'm not being to general but: I have been tasked with the job of "rejuvenating/modernizing" a monolithic Java EE (JSF/CDI/EJB/JPA) app. Since the requirements state that it should support multiple clients, I have split up the code in a server (JAX-RS interfaces) and a client part (not yet done)
The server is pretty straightforward but I'm wondering about the UI part. Nowadays (hope I don't sound too oldskool) various Node JS spin-offs seem to be popular but I'm under the impression that they have the most value to offer in the "scalable server" section. Does the various Angular/React/Node framework have anything to offer for the client if you have something more complex than a single page app?
It appears to be a really hard time to pick a UI technology nowadays. Sure, the server/DB part which contains most of the business logic are pretty future-proof but still, one would like to focus on one UI technology. There are various jQuery-based frameworks like Kendo, Vaadin & co etc. One option would be to stick with JSF + ICEfaces/PrimeFaces and just work with the REST interface. And then there is JavaFX which looks nice but the future looks a bit uncertain.
So. If the backend is not going to be Node JS, does Node JS have anything to offer for the UI part that can't be done more easily with other frameworks and does anyone have other insights on the UI layer in general. Predicting is hard, especially the future ;-)
Node.js is a way to run javascript on the server side, not client side. That said, npm (nodes package manager) or its wrappers (like bower) are quite often used to manage the client side dependencies - which is very useful to have.
Angular and react (among others) are client side javascript ui frameworks to help make writing ui much nicer. Neither depend on the backend being written in node.js and can work with any rest api (or other server side apis) - or no api at all if that backend injects all the data the page needs into the page itself.
Electron, which combines NodeJS and Chromium (render Process).
https://electronjs.org/
Formerly known as atom shell it was created by Github, it is the core of the Atom Editor, VS Code, Slack app, and a ton of “thick client” applications. https://en.m.wikipedia.org/wiki/Fat_client
There are several implementations which allow you to use Node.JS modules on a client-side (ie. web browser). You can then use html/css and call Node.JS modules directly from your DOM which is used to implement UI.
I'm most familiar with NW.js which I've used couple of times. Others would be for example Electron or AppJS

How can we use Node.js with Html/Bootstrap to develop Mobile App

I want to develop Mobile App using Node.js and Html5/Bootstrap as frontend?
I searched the web , but not getting any proper source of look. I am New in Node.js , but i Know HTML5 / Bootstrap.
Can anyone Guide me through to Develop Mobile App using these two?
While this is an opinionated question/answer and shouldn't be on SO, I'll share my experience as I was in the same boat recently:
For the front-end (The app): Look up PhoneGap (Apache Cordova) to get an idea about building cross-platform mobile apps using HTML5/CSS/JS. Keep in mind that you can use a good amount of front-end frameworks to ease your workload (AngularJS, Framework7, jQuery, etc.)
For the back-end (Server): Node.js is a great start, however you'll need to code your backend almost from scratch this way. I suggest looking up "Parse Server" to use it for your backend. It's an open-source solution for mobile apps backends (MBaaS). If you still decide to code your own full backend, then I highly recommend learning MEAN stack (MonogoDB, Express.js, AngularJS, Node.js), it might take you a while, but the portable experience you'll get is huge.
Either way, if you want to make high performing apps, it's always recommended to go native (Android apps using Java and Android Studio, iOS apps using XCode and Swift)
I hope this helps,
Best of luck

Node-webkit: using the same codebase for web- and desktop application

I was given the following to consider:
Develop desktop application using Nodeweb kit.
Also develop web application using the same code base.
Applications should look identical.
Both apps must use the same code base. The reason for this is to cut down development expenses.
If it was up to me I would not even consider using node-webkit for desktop. There are far better desktop solutions for Win platforms. For web application using Node is certanly viable.
But people who plan the project somehow think Node is a way to go for both apps.
After lots of thinking, I came to the conclusion that doing what they want will only increase dev and maintenance costs.
I consider using express (maybe even Sails.js) for web application. I made some tests where I used express on node-webkit and it run just fine.
Certanly NW is powerfull platform (popcorn). Just in my case I fail to see how can it cut down the dev expense
Am I right to be against this solution? Is this a plausible decision and I am not seeing another solution?
Any opinion is very welcome
I have actually done exactly this, and it worked very well. The trick was to write some Node Webkit code that will "detect" that it's running as a desktop application, instead of a web app, and thus integrate with desktop notifications etc.
Yes, it was more work than just writing a web app, but it was also less work (and maintenance) than developing separate applications. You get to use a lot of common code, because of the fact that you are running in a browser already, that I feel the project saved a lot of time.
In fact, I am currently working on another application that requires some desktop features (file access, notifications) but the same functionality as the web application, and I'm proposing that the development happens in Node Webkit.
The important criteria here for me is that both applications are 90% the same, the desktop just adds things you don't normally have on the web. So the core of the application is exactly the same AngularJS application, with some JavaScript injected by the Node Webkit startup page to add the required desktop behaviour.
You haven't presented reasons why you think node-webkit is not a suitable option for desktop application.
On the other hand I think client's opinion that development in node and node-webkit will be able to cut down costs is not ungrounded.
nw.js (formerly node-webkit) is basically a Chromium browser with intergrated node.js engine. So if you develop a web-application using node.js (and any of its frameworks) then you will be able to reuse it in nw.js fairly easy.

What backend can I use to setup breeze properly on a mac?

I would like to develop an AngularJS app with Breeze. I usually use NodeJS with Express but I hear it wont work with Breeze. All the example on breezejs.com use ASP.Net but i am on a mac and you can't run visual studio... What are my options ?
We are releasing a sample later today (in breeze v1.3.0) that shows Breeze talking to an arbitrary web service that could have been written on any platform using any technology.
Obviously, we need more of these examples and as importantly we need to show server side implementations of how one might write these web servivces to best leverage Breeze. But... this is all definitely on our roadmap, and we are actively looking for partners in this process.

Resources