How we use Electron build Linux desktop applications | Linux China

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/F8qG7f9YD02Pe/article/details/91477919
640?wx_fmt=jpeg This is accomplished by Electron framework, to build a story in the open-source Linux desktop e-mail services running natively. - Nils Ganther

Tutanota  is a secure open-source e-mail service that can be used through a browser, but also iOS and Android applications. Its client code released under GPLv3, Android applications can  F-Droid  find on so that everyone can use completely unrelated to the Google version.

Since Tutanota attention of open source and Linux client development, so we hope to release a desktop application for Linux and other platforms. As a small team, we quickly ruled out the possibility to build native applications for Linux, Windows and MacOS, and decided to use  Electron  to build our application.

For anyone who wants to quickly deliver a consistent vision for cross-platform applications, Electron is the most suitable choice, especially if you already have a Web application that you want to get out from the shackles of the browser when the API. Tutanota is such a case.

Tutanota based  SystemJS  and  the Mithril , designed to provide a simple, secure e-mail communication for everyone. Therefore, it must provide a lot of standard features users expect to get from your email client.

Thanks to modern standards and API, some functions (such as basic push notification, text search, and contacts as well as support for two-factor authentication) is easily available in the browser. Other features (such as automatic backup of our servers with or without transit IMAP support) require limiting access to system resources, which is the Electron framework provides.

Although some criticism Electron "just a basic package," but it has obvious benefits:

◈ Electron allows you to quickly as Linux, Windows and MacOS Desktop construct Web applications. In fact, most Linux desktop applications are built using Electron. ◈ Electron can easily desktop client and Web applications to achieve the same level of functionality. After ◈ publish desktop applications, you are free to use the development features to add desktop-specific features to enhance the usability and security. ◈ Last but not least is that, this way, the application has a native feel, into the user's system, while maintaining a good way to recognize their degrees. ### to meet the needs of users

Tutanota not dependent on large sums of investment funds, relying instead on community-driven project. Based on more and more users to upgrade to a paid plan our free service, we organically grow our team. Listening to customers is important not only for us, but also critical to our success.

Provide user desktop client is Tutanota most desired features , we are proud that we can now offer a free beta version of a desktop client for all users. (We also achieved another highly requested feature -  search encrypted data  - but that's another subject)

We like to provide users with the signed version of Tutanota and support the browser can not be achieved, for example, push notifications through a background process. Now, we plan to add more desktop-specific features, such as IMAP support (without relying on our server acts as a proxy), automatic backup and offline availability.

We chose Electron because of its combination of Chromium and Node.js most suitable for our small development team, because it requires minimal changes to our Web application. When we started, the browser can be used for all API function is particularly useful, as we progress slowly replace these components with more native version. This method is particularly convenient for attachment downloads and notifications.

Adjust security

We know that some people are concerned about security issues Electron, but we found that fine-tune access Electron in a Web application option is very satisfactory. You can use the Electron security documents and Luca Carettoni of Electron security checklist and other resources, to help prevent the contents of a Web application untrusted catastrophic accident.

Specific functions

Tutanota Web client from the outset to build a reliable protocol for interprocess communication. We use the thread remains responsive Web user interface (UI), and when encrypting the requested data. When we start implementing our mobile applications, which come in handy, these applications use the same protocol for communication between the primary portion and the Web view.

That's why when we started building desktop client, such as used in many parts of the native push notifications, open the mailbox and use the file system already exists, it is only necessary to achieve the original Shengduan (Node.js).

Another convenience is our build process using  Babel translator , it allows us to write an entire modern ES6 JavaScript code libraries, and mixing and matching modules between different environments. This allows us to quickly adjust the code-based Electron desktop applications. However, we also encountered some challenges.

Overcome challenges

Although Electron allows us to easily integrate with desktop environments on different platforms, but you can not underestimate the time invested! Finally, it is these small things that take up more time than we expected, but also essential to complete desktop client projects.

Platform-specific code led most of obstruction:

◈ For example, window management and trays are still processed in a slightly different way on the three platforms. ◈ registered Tutanota as the default mail program and set to start automatically require in-depth Windows registry while ensuring  UAC  compatible manner prompts the user for administrator access. ◈ We need to use the API Electron as a shortcut and menu to provide a copy, paste, undo and redo and other standard features.

Because users expect from certain (sometimes not directly compatible with) the behavior of applications on different platforms, this process is a bit complicated. The three versions feel like native require some iterations, even the need for a Web application some modest additions to provide functionality similar to the browser text search.

to sum up

Our experience in terms of Electron largely positive, we in less than four months to complete the project. Although there are some fairly time-consuming function, but we are surprised that we can easily deliver a beta version for Linux  Tutanota desktop client . If you are interested, you can understand  GitHub  source code on.


via: https://opensource.com/article/19/4/linux-desktop-electron

Author: Nils Ganther  topics: lujun9972  Translator: wxy  proofread: wxy

This article from the  LCTT  original compiler, Linux China  is proud

640?wx_fmt=jpeg


Guess you like

Origin blog.csdn.net/F8qG7f9YD02Pe/article/details/91477919