Node JS web application to LAN application( Desktop App) - node.js

I am very new to Node JS. recently developed a web application in NodeJS & hosted it on a common server along with Database for a clinical management.
Now I have an immediate requirement of making it as a desktop application so that users in a clinic can run the exe on their desktop and the application where its installed will create a database for other users to connect and make their updates.
Checked articles with Electron, node-webkit but didn't work for my current solution.
Is there any other alternative solution where I can make it as a desktop for Windows and Mac. Seeking your kind help !!!

There is the software NEXE which shows promising results however, when it comes down too it, Node.JS is a perfectly fine platform for production environments and is quite performant for the use-case you suggest. You can bundle a Node.JS installation and call upon it from your C code using system, exec or spawn calls. You can also open your favourite browser from the command line, while Google Chrome has the --kiosk flag to show in widescreen by default.
Just some ideas.

Related

Publish Windows service in Microsoft store with NodeJS or Electron

I'm looking for a the golden advice.
I've created an app that listens to websockets over a certain port and then sends commands to a native module (wrapped by NodeJS). now all this is done in NodeJS app. and packed in exe file (with two extra files for the native module ".dll and .napi")
now I want two things:
Run this app as a windows service in the background.
Package it in an installer that should stop the service (if exists), install the new update, then re-run the service. this app will be published in Microsoft store as appx.
I'm new to all of this so I feel lost while trying to know which is the best approach with my little knowledge.
I'm a bit confused between NodeJS and ElectronJS, some people say electron is not the best choice for services, but electron-builder is a great tool for packaging.
Conclusion: I want to publish my app to Microsoft store (already bought a developer account), and to run it as a service (no GUI). and the code is written in JS (node or electron)
Thanks in advance

Can I run VueJS and NodeJS or related apps on Server that doesn't have NodeJS installed?

So I'm new to Vuejs and doesn't know anything about npm, node, and other javascript apps.
I wanted to switch to VueJS so that I can take away from JQuery. Been using AdminLTE for my projects before.
I wanted to use vue-admin now since it seems to address all of my needs. However, I have specific work area situations that seems to hinder learning Vue and other JS apps, these are:
The workspace folder (development) where I'm creating applications is hosted in the production server (Windows Server).
I think NodeJS isn't installed in the server
Adobe Coldfusion is used. I don't have a local server, so the production server is used when developing.
Question:
Will the production server run the app built with vue-admin even if the production server doesn't have NodeJS installed? (I have NodeJS locally).
I need to use Coldfusion for the logic of the application, specifically I'm using CFWheels right now and vue-admin for Frontend and UX. Is it possible? The application I'm making is closely related to parts of an ERP system.
Any pointers on how I could do this?
Yes you can. Most likely you will need NodeJS locally to make your development life a bit easier.
You can simply include Vue in your project with a script tag or your can use a buildtool like Webpack to enable you to write ES6 and use a module system.
If you go with the latter it still exports as plain ES5 allowing you to use it on your server without any problem since all of this is code which runs on the clients machine, not on your server.
As you can see the requirements for this project have a big bold headline with: 'Development'.
https://github.com/vue-bulma/vue-admin#development
You don't need any of the requirements in production.

Running related apps in different servers

I have NodeJS server for my iPhone and Android apps and I want to build an admin panel as desktop application using Electron.
From my research, I found out that Electron depends on its own version of node and it can't run on other server instance.
My questions are:
1) is it advisable to implement the admin panel using Electron knowing that it depends on its own version of NodeJS?
2) is there away to integrate my current NodeJS server for mobile apps to my Electron? because using two different servers will be costly when it comes to hosting them
3) what are other alternatives that enable me to implement cross-platform desktop application using my current mobile apps server?
NOTE: The admin panel server functionality are completely different from mobile apps.
1) is it advisable to implement the admin panel using Electron knowing that it depends on its own version of NodeJS?
Yes, that is perfectly fine. You can access your current node server directly from your electron app, or create a new node server that electron will access.
2) is there away to integrate my current NodeJS server for mobile apps to my Electron? because using two different servers will be costly when it comes to hosting them
You can run multiple nodejs servers on one machine (just use different ports when starting the servers). This is one easy way to get around this issue, or you can just have a group of /admin endpoints that handle all admin related functionality. Think of electron has a front-end that can be distributed across various platforms and access any back-end you choose.
3) what are other alternatives that enable me to implement cross-platform desktop application using my current mobile apps server?
Electron / nwjs (node-webkit) are the only two that come to mind. Although there are probably others.
More Electron/nwjs details:
Just think of these as browsers that allow you to write nodejs. Therefore, within the browser you can access databases you ship with your app, or anything on the users file system. You can also make requests from your app to already created nodejs servers. Also, they allow you to easily package up your app for cross-platform distribution.

How do I use NodeJS on Asustor AS-302T NAS

I have recently bought a Asustor AS-302T NAS, which is an absolutely brilliant solution for the home. One of it's most impressive features is that you can install apps which extends the ordinary behavior of a NAS. And if you are a developer you can also create your own apps.
While apps are fun, I have more interest in using my NAS as a kitchen-sink for my personal nodejs projects. In short I want to run nodejs application that I can then call from various other machines around the house. My own mini-cloud for IOT experiments.
Installing, one click only
Having installed NodeJS through App-Central I am at a loss how exactly to start using NodeJS on my NAS. The whole installation is essentially an on/off switch with no options or visible settings at all. I can find no documentation on practical tasks like uploading a nodejs application, deal with access rights or even execute it.
Under Windows or OS-X I would use npm via the command-line or shell, but Asustor is a purely html based interface (with the exception of XBMC through HDMI).
Why offer to users the option of installing NodeJS -if it's impossible to actually use it?
So my question has three aspects to it:
How do i get access to npm on my Asustor NAS
How do i get my NodeJS application running
Is it possible to run my application as a service (executed when the NAS boots)?
From the ASUSTOR Developer's Guide: apps are installed into
/usr/local/AppCentral/$APP_NAME.
NodeJS executables will be at path /usr/local/AppCentral/nodejs/bin/node and /usr/local/AppCentral/nodejs/bin/npm.
You can login to NAS via SSH and add them to PATH variable, or create symlinks...
I'm also searching for solution how to run them as a service (daemon), maybe an /etc/init.d script might help.

Desktop applications with Meteor.js

The options I've found for creating desktop applications in HTML, CSS, and JavaScript are:
Electron (formerly Atom-Shell)
NW.js (formerly Node-Webkit)
However, there doesn't seem to be any clear implementation for using meteor.js with these.
NW.js
I've seen some other questions of people asking this, but no implementation. Can't even figure out by the answers what I should be trying to put together:
Meteor leaderboard app on node-webkit
Demeteorizer with node-webkit
How can I start a Meteor instance before launching a node-webkit?
This guys actually got it running but doesn't say how: https://stackoverflow.com/questions/25508737/iron-router-routing-fails-on-reload-in-node-webkit
The idea proposed here is interesting—loading the desktop application completely from the web. However, I would like to allow my users to use the application offline.
Electron
There is an actual implementation, meteor-desktop-app, but it has no clear support for Windows. However, the atom-shell does support Windows just as NW.js does.
Has anyone figured out an implementation to allow meteor.js to operate as a desktop application?
If you drop the code from meteor-desktop-app into Electron Starter, you'll get Windows + Mac + Linux for free, as well as a build system you can definitely use for Real Apps.
Check out mongoclient's scaffold directory, it'll lead you to your electron app if you follow the steps from readme.

Resources