Initial questions about the Electron framework

Asked

Viewed 207 times

2

Good evening, I’m looking to start using Electron to develop desktop applications, but I have some initial questions. My doubts are as follows:

How do I persist my application in Electron using a database, for example Mysql?

When my application is fully ready as I do to create a version to distribute for use?

All the logic of my application the part of entering data into the database, recover this data, check login and etc will be done with Javascript or I can use another language like Java?

The application that was developed in the framework can be extended in some way to the Web or can only be used as a desktop?

2 answers

0

Here’s some of my experience and I hope it helps you:

Electron is basically the view of a desktop application, so in the backend code, it can be Node.js (in this case would use Javascript) or an API/Rest that can also be written in Node.js or even in Java, Web Api. Net Core.

If you are to adopt any of the above technologies, what you will get is this structure:

  • Electron view (HTML, CSS and Javascript screens)

  • HTTP GET, POST, PATH, UPDATE, DELETE requests for an API/Rest or SOAP (a Webservice)

The advantage here of using a Web API is that if you at some point want to use that same API to exchange the View for use in a Mobile app or a Web Site you will make the same requests.

In case this API can be installed in Windows environment and in this case you will have to check inside your development tools what best suits you (Noje.js, JAVA Api, Web Api C#...).

Regarding the distribution of an Electron application, you can package it using the Electron-packager: https://github.com/electron/electron-packager .It will enable you to compile for Windows, Macos and Linux and generate the package of your application.

Note: View are the screens on which the user interacts with the application.

0

For each database you must install a mysql library for example can be installed by npm npm install mysql as simple as that, I’ll leave a link with a simple example of the implementation Link

This link How to generate file for distribution will show how to generate files for distribution.

From what I noticed in your question the application will really need to be written in Javascript. Unless the idea is to create a server/API for the data and leave only the logic to the application.

To replicate the application Electron for the web are necessary many adaptations. I believe that it is impossible.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.