Wrap Electron app in a local server then access from remote device - javascript

I'm building a desktop app with Electron and React.
I need that the app runs always when the computer is on (cause it periodically make some api call to the web)
I want to ask if I need a local server or something to accomplish that and if yes how to do that.
Also I need to know if there is a way to access this single page app from my smartphone. Because if isn't necessary I don't want to use paas like aws.
Thanks

Related

How to create different instances of a Node.js Application

So i have this idea for an App and i need some configurations on the backend so obviously i decided to go with node.js because that's an option I'm more familiar with, but i need to have different configurations for different clients connected to the application. For example when a client visits the base url, it'll save that users information and use it whenever he visits other routes on the backend. But i can't seem to get that work using express, i have tried socket.io but that doesn't meet my needs. But how does the client side i.e browsers run different instances of the same application but my backend doesn't?... its still javascript, i don't want to use docker images or anything like that, i just want it on the same port is that possible?

How to establish a SSH MySQL database connection for a Electron App?

I'm making a app with the Electron Framework, within this the user needs to register an account to be able to use this app.
This worked great when making this for my localhost database, but creating connection with the MySQL server that is running on a dedicated server seems not working for me, and also insecure since people can unpack the .asar file and see the database credentials..
So, I've heard about 'SSH Connection' but can't figure out how to set this up, and get this up and running for my Electron app.
I am using XAMPP to create a MySQL/Apache server and I use HeidiSQL to enter the MySQL server.
For your info, I've never used Electron before and this is my first time using it. I've also never used a SSH connection before (at least, not that I'm aware of.) so a guide for newbies would be nice.

How to control electron.js app?

I'm new to electron.js.I created a game using html,css and javascript. Right now the app is running offline on the client side.
But i want to access,analyse and change that app.One way this can be possible is to load game resources from a server,so i can have complete access and control over app.But i don't want to put heavy duty on server.
Basically i want app's resources loaded from the user's computer,also i want to control app.The electron.js app should be able to work offline also.
How can i achieve this?
Thanks.
You can use "electron online" npm plugin to check app is connected to internet or not. If app has internet access you can perform your action to send updates to serer otherwise you can store those actions in "electron-json-storage" and later when have internet connectivity may be on app launch or at any specific event you can send those local storage information to server.

HTTP Request Mobile Javascript

Hey everyone so I have a question, can I have an endpoint api in my Mobile application?
For example I have a server that would do stuff with data and then I would send a post request to my mobile application letting it know new data had came in. How would I go about that? Is that even possible?
My solution I came across was to use firebase api since I remember It has a watcher. So I can easily change some data inside the firebase database by using my server. The mobile application will have the firebase watcher and see that something in the FB database got changed and it will proceed to react to it.
Without using firebase. If I were to send a get request to my server from my mobile application every second(as a watcher) is that bad practice? Or is that pretty much what firebase's watcher is doing?
I know that when you deploy a web application you can have a backend inside the directory. Would mobile applications even allow that?
Is there a simpler way?
also note
I'm using Ionic framework so its a javascript framework
And I'm using nodejs/express as my server
If I were to send a get request to my server from my mobile
application every second(as a watcher) is that bad practice? Or is
that pretty much what firebase's watcher is doing?
This is a bad practice and that is not what it is doing.
I know that when you deploy a web application you can have a backend
inside the directory. Would mobile applications even allow that?
You can't have easily a backend in your mobile application. You can call it but not having one inside your application.
Using Firebase is the good practise.
If you want to create your own server, you can create also a firebase cloud messaging server.
What you are doing is called push notifications. More infos here : https://stackoverflow.com/tags/push-notification/info

how can i access mail from a microsoft exchange server using javascript?

I am trying to build a desktop app using electron that retrieves mail from a specific mailbox (microsoft exchange server), now, i have looked around and read that mailbox connection should be done server side (the question was made by a guy building a web based app that is a little bit similar to what i want to do), but, since i am not really deploying a node js server but rather using electron, which, as far as i understand is like a desktop app version of node, im not sure on which approach to take. Should i use an api? does microsoft has any interface for this? or should i use a third party integration for it?
It looks like the Exchange Web Services API is only provided as a CLR assembly, so if you wanted to use it you'd need to:
write a C# console app that you then spawn from your Electron app
(and communicate via stdin/stdout), or
use the EWS API in your Electron app via Edge.js
Alternatively, you could probably just directly communicate with the exchange server using SOAP messages, but that could be a bit tedious to implement.

Categories