Running related apps in different servers - node.js

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.

Related

IIS/ASP.Net vs NodeJs/ExpressJS

I'm very new to NodeJs/expressJs, i read tons of articles on internet and still don't understand it
is NodeJs a web server like IIS ? if so can i host an asp.net app in NodeJS ?
Is expressJs a framework like ASP.NET ?
I currently work on both IIS ASP.NET applications as well as NodeJS/ExpressJS systems and the below is what I have noted to be different:
IIS:
Windows server based
Can have strict setups such as MVC etc
Built in deployment that compiles the entire website
Setup can take quite some time to create all modals and get all
plugins working etc
Services can take some time setup and modal mapping can be tedious
NodeJS/ExpressJS:
Not Windows based. I run this typically on an Ubuntu server with
Nginx to push the domain to the public
Easy to setup and fast to get something basic online
Does not natively compile and runs files as they are
Uses npm package manager with easy to install packages
Does not have strict setups but you can technically create your own
MVC style system
Code can quickly become messy however with the correct approach you
can manage the amount of code easily.
NodeJS is not a web server. It is a backend server (Such as a REST API etc)
ExpressJS sits ontop of NodeJS to add functionality and is essentially a framework. Coupled with jade/pug you can write js inside the html.

Electron like node integration in nodejs web server

I'm new to web servers in nodejs and i'd like to know if there is possible to have an electron like node integration in a web server (to be able to use nodejs in index.js script file linked to index.html)
Thx for all :)
It's not possible. Browsers control the way that client side JavaScript is executed, so it's just technically impossible to connect both runtimes in any way that works on client machine, you'd need a customized browser, which is what Electron basically is. And neither should you want to - if the runtimes were connected in that way, any user could execute arbitrary commands on your server.

Node JS web application to LAN application( Desktop App)

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.

Can you convert MEAN applications with a compiler to App store?

As we all know you can use compilers as Cordova to convert web applications so you can upload your application to the app store.
This can easily be done when developing with HTML5 and Node.
But is it possible to convert a MEAN application (MongoDB, Express, Angular and Node)?
You can run nodejs server on mobile with jxcore, but I think you should run only client side part on cordova and api shall stay on server. Ideally, I think that api and client side must be separate projects.
No, you can't.
MEAN stack is full stack. You can make your frontend an app with cordova but you still need database and backend service.
But that's ok. Make your app mobile friendly and stick with your server to provide the data you need to make it work.
What you can do, it's to create hosted web app. This is existing web application, just wrapped to make it possible to submit to app store.
For this you can use Manfoldjs, for example Using Cordova Plugins in Hosted Web Apps or if you use Visual Studio, you can use Visual Studio Tools
for Apache Cordova.

How to upload Node.js Application to FTP server?

I am kind of new to Node.js but I built an application and am pretty happy with it. I was wondering how would I go about uploading my Node.js application to an FTP server? Is it even possible to do this?
A Node.JS application is just a collection of files. You can upload them to another computer using FTP just like any other files.
That probably isn't what you are trying to ask though.
If you want to host a website built as a Node.JS application then you need to be using hosting that either:
Explicitly supports Node.JS (Google finds this list) or
Gives you full admin access (such as a virtual or dedicated server)
Such hosting will generally give you (at a minimum) shell access (via SSH) which you can use to run the Node.JS application.

Resources