How can I convert a Node Js web application to a desktop application? - node.js

I have created a Node js Web application which is running on an express server. It is a web automation application which is made using puppeteer. I want this app to run in headful mode which is not possible if I deploy this on servers (for eg Heroku). So instead of deploying this application,I wanted to create a desktop app which runs this application on the local host everytime. Is there any way to convert this web application to a desktop application and run it on local host through the desktop app only?

Your best bet would be using Electron.
It is used for cross-platform apps with Nodejs and interacts like website, so you wouldn't need to rebuilt your app from scratch.

Related

Can we containerize an electron app using docker?

Currently, I have developed a desktop application using electron JS, and I am using electron-store to save user preference. And these prefernce are being saved in a config.json file inside the C:/Users/<user>/AppData/Roaming/<applicationName>/config.json
I wonder if I have containerized my electron app using docker:
Would I face any issues related to storage or anything else?
Would I be able to run the app normally?
Would I be able to run the GUI of the electron app?

Can you easily explain the process of deploying ionic (based on react) apps with a node backend?

I recently started using react with a node server as a backend. I'm having problems to understand how to deploy such an app. I'm a beginner with ionic and deploying websites (or rather web based mobile apps) so I apologize if this is an easy/stupid question.
I searched a lot about this but my brain is still struggling to understand the deployment process. As I understand, any website have generally two parts, the frontend built with HTML/CSS/JS and the backend built with nodejs (in my case). If I want to run the app, I need to type npm start in the terminal right? so I'm only running the node server actually, where it will serve the HTML pages (static pages) depending on which url endpoint I wrote, right?
So deploying this is "easy" by copying the static files into a remote server and just run the nodeJs server to serve pages depending on the request, right. Therefore, is the start command here npm start, which will start the whole app.
I'm now using the ionic framework with react syntax and nodejs in the backend. There is a special command to run the ionic app (frontend), which is ionic serve. So if I run this the frontend will show up in the browser. Furthermore, I need to run the node server with npm start to handle requests. Therefore, to start my app, I need the ionic serve and npm start commands. How can this be deployed?
After some research, I read that I need to deploy the ionic app (frontend) and the backend separately. For example the ionic app would be a webapp and the server also a separate webapp (since I'm using MS Azure). The communication between them can be over rest API or web sockets as I understand. Is this the right approach to do this or there is a better/more clear way?
deploying two apps would mean that I need to pay for two apps on azure. Is there a way to minimize costs and have a functional app?
PS: generally, I'm having problems to understand the deployment process. I understand basically how the web works and I can build website on my machine but I'm not confident about my skills when it comes to deployment. Surprisingly, there is not much on the internet about it. Can someone please recommend articles, books or ideally videos that explain this process. Thank you in advance.
here is how you deploy ionic apps as pwa - https://ionicframework.com/docs/react/pwa
if you are using a node backend, the you would start the server same as you would normally, If I am understanding the question
Though your question is not specific to a particular issue but highlights a wide variety of issues, i will still try to explain it.
Ionic is primarily used for creating HYBRID/WEB MOBILE APPLICATIONS. Although you can deploy the code as a website too, but you will not be able to get any benefit out of using ionic for a website only and not using react as a standalone framework.
Be clear on your requirement, your question talks about website and web based mobile apps. Deploying a website and a hybrid mobile application is not one and the same thing. Websites are hosted on servers, mobile apps are deployed in app stores.
If you are not going to deploy to any mobile platform, i suggest you drop ionic and build your website with react.
Now coming to Ionic mobile apps, this is the flow
Create Ionic Project -> Build project for iOS/Android platform -> Deploy these apps to respective app stores
You will not host your Ionic mobile code on any hosting provider.
Your node.js backend code gets hosted on a hosting service. The endpoint URL will change to your hosted servers IP address.
Read about following topics first
What are hybrid mobile applications
What is Ionic
How to build mobile apps using Ionic
Publishing Mobile Applications
Deploying node.js to a cloud host

Angular Universal app running in shared hosting

So I have created an angular universal app and I have successfully deployed it in Heroku and it's running great. I would like to know if it is possible I can run it in a shared hosting. More specifically I have A2Hosting shared plan which supports node.js. More over which commands should I execute in the server in order to start the node server? Thank you.

Electron JS/Node JS desktop app as a local network webserver

Is it possible to make an Electron JS desktop app that is a web server, so that when we start the app the server will also start and we can access it from other computer within the same network/LAN?
Yes, it is.
Yout can run you server (express or just bare http/https/http2) on main process.
Also you can child_process.fork() or child_process.spawn(). It works fine.

Google Web Stater Kit to Server

I am using the Google web starter kit to build myself a portfolio. I have everything up and running locally using gulp etc. I just want to know how I prepare my app to allow it to be placed on a web server? What are the processes to do so?
Just running gulp will prepare your app for deployment.
https://github.com/google/web-starter-kit/blob/master/docs/commands.md

Resources