SlideShare a Scribd company logo
Build cross platform desktop apps with JavaScript,
HTML, and CSS
Why we need ‘Desktop Applications’? [1/2]
3
● Secure
● To work ‘Offline’
○ On premises
○ We are ‘NOT CONSTANTLY CONNECTED’
● For professional level applications
○ Photoshop, AutoCAD etc.
● Hosting?
Why we need ‘Desktop Applications’? [2/2]
● Connect with peripheral devices & other local hardware
● Edit any local files
● Novice users - non tech savvy
4
Other Desktop App Development Tools
● JavaFX
● Qt
● Gtk+
● NW.js
● Kivy
● Lazarus
● Xojo
● Enyo
● Haxe
5
If you can build a website,
you can build a desktop app.
7
Electron
● Open source library
● Developed by GitHub - Led by Cheng Zhao
● Cross-platform desktop applications
● Use web technologies - HTML, CSS & JavaScript.
● Combines Chromium and Node.js into a single runtime
● Mac, Windows, and Linux
8
Atom Shell
Framework originally
written for Atom
GitHub's hackable text
editor
became
open-source Lorem ipsum dolor sit
amet, consectetur
Apps compatible with
Mac App Store
April 2013 May 2014 April 2015 May 2016 May 2016 August 2016
9
renamed as
Electron
Electron
v1.0.0
Windows Store
support
Why Electron?
10
● Electron enables you to create desktop applications
with pure JavaScript by providing a runtime with rich
native (operating system) APIs.
● Electron is NOT a JavaScript binding to GUI libraries.
● Electron uses web pages as its GUI
○ “Chromium browser, controlled by JavaScript”
● Electron App: Web pages running in a browser that can
leverage your OS APIs.
11
It takes care of the hard parts.
So you can focus on the core of your application
12
● Enable auto update
○ Squirrel/Squirrel.Windows - installation/update framework
● Native Components
○ Create native application menus and context menus,
dialogs, system tray & notifications etc.
● Crash reporting
○ Submit crash reports to a remote server.
● Debugging & Profiling
○ Collect tracing data from Chromium's content module for
finding performance bottlenecks and slow operations.
13
14
Apps built on Electron
Install Electron?
● Recommended: Install as a development dependency
○ Allows you to work on multiple apps with different Electron
versions
● Global Installation
● Proxies
● Custom Mirrors & Caches
● Customized
15
Install Electron as a development dependency
● npm
○ Package manager/ software registry
○ Open-source building blocks of code
(third party packages)
○ Install, update, share & distribute
● npm install --save-dev electron
16
Quick Start
● Create a new empty folder for your new Electron
application.
● Run npm init
● npm will guide you to create a basic package.json file
18
19
● Install electron:
○ npm install --save-dev electron
20
21
● Add a start script that instructs node to execute the
current package with electron runtime.
○ "start": "electron ."
22
Folder Structure
23
your-app/
|__packagage.json
|__main.js
|__index.html
1. package.json
{
"name": "your-app",
"version": "0.1.0",
"main": "main.js",
"scripts": {
"start": "electron ."
}
}
24
2. main.js
const {app, BrowserWindow} = require('electron')
function createWindow () {
// Create the browser window.
win = new BrowserWindow({width: 800, height: 600})
// and load the index.html of the app.
win.loadFile('index.html')
}
app.on('ready', createWindow)
25
3. index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>
26
npm start
27
Architecture
28
Main Process
29
● Runs package.json's main script.
● The script that runs in the main process can display a
GUI by creating web pages.
● An Electron app always has one main process, but
never more.
Renderer Process
30
● Based on Chromium's multi-process architecture
● Electron uses Chromium for displaying web pages
● Each web page in Electron runs in its own process
31
● The main process creates web pages by creating
BrowserWindow instances.
● Each BrowserWindow instance runs the web page in its
own renderer process.
● When a BrowserWindow instance is destroyed, the
corresponding renderer process is also terminated.
32
● The main process manages all web pages and their
corresponding renderer processes.
● Each renderer process is isolated and only cares about
the web page running in it.
33
● In web pages, calling native GUI related APIs is not
allowed.
○ Managing native GUI resources in web pages is very
dangerous
○ It is easy to leak resources
● If you want to perform GUI operations in a web page,
the renderer process of the web page must
communicate with the main process to request that the
main process perform those operations.
34
Demo
36
Application Distribution
1. Download Electron's prebuilt binaries
2. Packaging
○ can be done manually
○ Third party packaging tool
■ electron-forge
■ electron-builder
■ Electron-packager
37
Pros [1/5]
● Electron Apps Are Similar to Web Apps
○ Relies entirely on web standards
■ HTML, CSS, JS
● Can focus on the core functionality
○ Electron already handles the hard part in software
development
38
Pros [2/5]
● Reuse of resources
○ Same team working on a web-application can easily
implement a desktop application.
○ Several things from the web-application can be
reused in the desktop app:
■ Business logic (services, helpers)
■ Design
■ General application structure
○ Saves time and money.
39
Pros [3/5]
● Chromium engine for rendering UI
○ Developer tools
■ Don’t have to think of an external debugger
■ easy to measure performance, conduct profiling or
detect memory leaks
○ Hot / Live reload
■ See changes instantly
○ Storage access
■ LocalStorage, SessionStorage, IndexedDB to persist
application state. 40
Pros [4/5]
● Provides various core functionalities:
○ Auto-update
○ crash reporter
○ installer creator
○ system-specific/native-ish features
■ Menu, system dialogs, file selection dialogs,
notifications, printer, etc
■ Shortcuts bindings
○ Open file manager & external links
○ Screenshots & PDF
41
Pros [5/5]
● Reuse of npm modules, out of the box
● No cross-browser compatibility issues
● No loading of remote assets (then no latency)
● Hardware Access
○ Keyboard shortcuts
42
Cons [1/2]
● JavaScript
● No built-in MVC
● Not as feature-rich or mature as NW.js
43
Cons [2/2]
● Size & Memory Usage!
○ Node JS + Chromium
○ Electrino - experimental featherweight alternative
● Cross Platform Builds?
○ If your app has native dependencies, it can be compiled only
on the target platform.
■ macOS code Signing works only on MacOS.
44
45
Sponsors
46
Resources for learning Electron
● electronjs.org/docs - all of Electron's documentation
● electron/electron-quick-start - a very basic starter Electron app
● electronjs.org/community#boilerplates - sample starter apps created
by the community
● electron/simple-samples - small applications with ideas for taking
them further
● electron/electron-api-demos - an Electron app that teaches you how
to use Electron
● hokein/electron-sample-apps - small demo apps for the various
Electron APIs
47
References
● https://electronjs.org/
● https://electronjs.org/docs/faq
● https://www.npmjs.com/package/electron
● https://slides.com/juliamaksimchik/electron-awesome
● https://www.tutorialspoint.com/electron/
● https://steemit.com/technology/@ryanbaer/getting-started-with-electron-pt-3-how
-the-hell-does-this-thing-work
● https://www.arroyolabs.com/2016/08/electron-and-cross-platform-applications/
● https://ourcodeworld.com/articles/read/259/how-to-connect-to-a-mysql-database
-in-electron-framework
48
Thank you!

More Related Content

What's hot

Nodejs presentation
Nodejs presentationNodejs presentation
Nodejs presentation
Arvind Devaraj
 
What is flutter and why should i care?
What is flutter and why should i care?What is flutter and why should i care?
What is flutter and why should i care?
Sergi Martínez
 
Build beautiful native apps in record time with flutter
Build beautiful native apps in record time with flutterBuild beautiful native apps in record time with flutter
Build beautiful native apps in record time with flutter
RobertLe30
 
Flutter session 01
Flutter session 01Flutter session 01
Flutter session 01
DSC IEM
 
Introduction to the Dart language
Introduction to the Dart languageIntroduction to the Dart language
Introduction to the Dart language
Jana Moudrá
 
FULL stack -> MEAN stack
FULL stack -> MEAN stackFULL stack -> MEAN stack
FULL stack -> MEAN stack
Ashok Raj
 
Flutter tutorial for Beginner Step by Step
Flutter tutorial for Beginner Step by StepFlutter tutorial for Beginner Step by Step
Flutter tutorial for Beginner Step by Step
Chandramouli Biyyala
 
Google flutter the easy and practical way
Google flutter the easy and practical wayGoogle flutter the easy and practical way
Google flutter the easy and practical way
Ahmed Abu Eldahab
 
Flutter Intro
Flutter IntroFlutter Intro
Flutter Intro
Vladimir Parfenov
 
Flutter
FlutterFlutter
Flutter
Ankit Kumar
 
Bloc Pattern - Practical Use Cases - Flutter London - 21JAN2019
Bloc Pattern - Practical Use Cases - Flutter London - 21JAN2019Bloc Pattern - Practical Use Cases - Flutter London - 21JAN2019
Bloc Pattern - Practical Use Cases - Flutter London - 21JAN2019
Didier Boelens
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
Rob O'Doherty
 
Pune Flutter Presents - Flutter 101
Pune Flutter Presents - Flutter 101Pune Flutter Presents - Flutter 101
Pune Flutter Presents - Flutter 101
Arif Amirani
 
Flutter talkshow
Flutter talkshowFlutter talkshow
Flutter talkshow
Nhan Cao
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
Akshay Mathur
 
Dart presentation
Dart presentationDart presentation
Dart presentation
Lucas Leal
 
Maven Introduction
Maven IntroductionMaven Introduction
Maven Introduction
Sandeep Chawla
 
Micro-frontend
Micro-frontendMicro-frontend
Introduction to angular with a simple but complete project
Introduction to angular with a simple but complete projectIntroduction to angular with a simple but complete project
Introduction to angular with a simple but complete project
Jadson Santos
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
Dinesh U
 

What's hot (20)

Nodejs presentation
Nodejs presentationNodejs presentation
Nodejs presentation
 
What is flutter and why should i care?
What is flutter and why should i care?What is flutter and why should i care?
What is flutter and why should i care?
 
Build beautiful native apps in record time with flutter
Build beautiful native apps in record time with flutterBuild beautiful native apps in record time with flutter
Build beautiful native apps in record time with flutter
 
Flutter session 01
Flutter session 01Flutter session 01
Flutter session 01
 
Introduction to the Dart language
Introduction to the Dart languageIntroduction to the Dart language
Introduction to the Dart language
 
FULL stack -> MEAN stack
FULL stack -> MEAN stackFULL stack -> MEAN stack
FULL stack -> MEAN stack
 
Flutter tutorial for Beginner Step by Step
Flutter tutorial for Beginner Step by StepFlutter tutorial for Beginner Step by Step
Flutter tutorial for Beginner Step by Step
 
Google flutter the easy and practical way
Google flutter the easy and practical wayGoogle flutter the easy and practical way
Google flutter the easy and practical way
 
Flutter Intro
Flutter IntroFlutter Intro
Flutter Intro
 
Flutter
FlutterFlutter
Flutter
 
Bloc Pattern - Practical Use Cases - Flutter London - 21JAN2019
Bloc Pattern - Practical Use Cases - Flutter London - 21JAN2019Bloc Pattern - Practical Use Cases - Flutter London - 21JAN2019
Bloc Pattern - Practical Use Cases - Flutter London - 21JAN2019
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Pune Flutter Presents - Flutter 101
Pune Flutter Presents - Flutter 101Pune Flutter Presents - Flutter 101
Pune Flutter Presents - Flutter 101
 
Flutter talkshow
Flutter talkshowFlutter talkshow
Flutter talkshow
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
 
Dart presentation
Dart presentationDart presentation
Dart presentation
 
Maven Introduction
Maven IntroductionMaven Introduction
Maven Introduction
 
Micro-frontend
Micro-frontendMicro-frontend
Micro-frontend
 
Introduction to angular with a simple but complete project
Introduction to angular with a simple but complete projectIntroduction to angular with a simple but complete project
Introduction to angular with a simple but complete project
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
 

Similar to Electron JS | Build cross-platform desktop applications with web technologies

Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3
Opersys inc.
 
IoT: Contrasting Yocto/Buildroot to binary OSes
IoT: Contrasting Yocto/Buildroot to binary OSesIoT: Contrasting Yocto/Buildroot to binary OSes
IoT: Contrasting Yocto/Buildroot to binary OSes
Mender.io
 
OVERVIEW: Chromium Source Tree
OVERVIEW: Chromium Source TreeOVERVIEW: Chromium Source Tree
OVERVIEW: Chromium Source Tree
Chang W. Doh
 
Leveraging Android's Linux Heritage
Leveraging Android's Linux HeritageLeveraging Android's Linux Heritage
Leveraging Android's Linux Heritage
Opersys inc.
 
Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013
Opersys inc.
 
Leveraging Android's Linux Heritage at ELC-E 2011
Leveraging Android's Linux Heritage at ELC-E 2011Leveraging Android's Linux Heritage at ELC-E 2011
Leveraging Android's Linux Heritage at ELC-E 2011
Opersys inc.
 
GeoServer Developers Workshop
GeoServer Developers WorkshopGeoServer Developers Workshop
GeoServer Developers Workshop
Jody Garnett
 
Adding a GUI to Go
Adding a GUI to GoAdding a GUI to Go
Adding a GUI to Go
MatthiasNsner
 
DocDoku: Using web technologies in a desktop application. OW2con'15, November...
DocDoku: Using web technologies in a desktop application. OW2con'15, November...DocDoku: Using web technologies in a desktop application. OW2con'15, November...
DocDoku: Using web technologies in a desktop application. OW2con'15, November...
OW2
 
DocDokuPLM presentation - OW2Con 2015 Community Award winner
DocDokuPLM presentation - OW2Con 2015 Community Award winnerDocDokuPLM presentation - OW2Con 2015 Community Award winner
DocDokuPLM presentation - OW2Con 2015 Community Award winner
DocDoku
 
Leveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IVLeveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IVOpersys inc.
 
Programming for non tech entrepreneurs
Programming for non tech entrepreneursProgramming for non tech entrepreneurs
Programming for non tech entrepreneursRodrigo Gil
 
Node.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleNode.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scale
Dmytro Semenov
 
Introducing chrome apps (ogura)
Introducing chrome apps (ogura)Introducing chrome apps (ogura)
Introducing chrome apps (ogura)
Kazuhiro Ogura
 
Devoxx : being productive with JHipster
Devoxx : being productive with JHipsterDevoxx : being productive with JHipster
Devoxx : being productive with JHipster
Julien Dubois
 
Continuous Delivery: 5 years later (Incontro DevOps 2018)
Continuous Delivery: 5 years later (Incontro DevOps 2018)Continuous Delivery: 5 years later (Incontro DevOps 2018)
Continuous Delivery: 5 years later (Incontro DevOps 2018)
Giovanni Toraldo
 
Voxxed days Vilnius 2015 - Android Reverse Engineering Lab
Voxxed days Vilnius 2015 - Android Reverse Engineering LabVoxxed days Vilnius 2015 - Android Reverse Engineering Lab
Voxxed days Vilnius 2015 - Android Reverse Engineering Lab
Ron Munitz
 
Chromium: NaCl and Pepper API
Chromium: NaCl and Pepper APIChromium: NaCl and Pepper API
Chromium: NaCl and Pepper API
Chang W. Doh
 
Expedia 3x3 presentation
Expedia 3x3 presentationExpedia 3x3 presentation
Expedia 3x3 presentation
Drew Hannay
 
Mobile Controls for IBM Lotus Domino XPages on OpenNTF
Mobile Controls for IBM Lotus Domino XPages on OpenNTFMobile Controls for IBM Lotus Domino XPages on OpenNTF
Mobile Controls for IBM Lotus Domino XPages on OpenNTF
Niklas Heidloff
 

Similar to Electron JS | Build cross-platform desktop applications with web technologies (20)

Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3
 
IoT: Contrasting Yocto/Buildroot to binary OSes
IoT: Contrasting Yocto/Buildroot to binary OSesIoT: Contrasting Yocto/Buildroot to binary OSes
IoT: Contrasting Yocto/Buildroot to binary OSes
 
OVERVIEW: Chromium Source Tree
OVERVIEW: Chromium Source TreeOVERVIEW: Chromium Source Tree
OVERVIEW: Chromium Source Tree
 
Leveraging Android's Linux Heritage
Leveraging Android's Linux HeritageLeveraging Android's Linux Heritage
Leveraging Android's Linux Heritage
 
Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013
 
Leveraging Android's Linux Heritage at ELC-E 2011
Leveraging Android's Linux Heritage at ELC-E 2011Leveraging Android's Linux Heritage at ELC-E 2011
Leveraging Android's Linux Heritage at ELC-E 2011
 
GeoServer Developers Workshop
GeoServer Developers WorkshopGeoServer Developers Workshop
GeoServer Developers Workshop
 
Adding a GUI to Go
Adding a GUI to GoAdding a GUI to Go
Adding a GUI to Go
 
DocDoku: Using web technologies in a desktop application. OW2con'15, November...
DocDoku: Using web technologies in a desktop application. OW2con'15, November...DocDoku: Using web technologies in a desktop application. OW2con'15, November...
DocDoku: Using web technologies in a desktop application. OW2con'15, November...
 
DocDokuPLM presentation - OW2Con 2015 Community Award winner
DocDokuPLM presentation - OW2Con 2015 Community Award winnerDocDokuPLM presentation - OW2Con 2015 Community Award winner
DocDokuPLM presentation - OW2Con 2015 Community Award winner
 
Leveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IVLeveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IV
 
Programming for non tech entrepreneurs
Programming for non tech entrepreneursProgramming for non tech entrepreneurs
Programming for non tech entrepreneurs
 
Node.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleNode.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scale
 
Introducing chrome apps (ogura)
Introducing chrome apps (ogura)Introducing chrome apps (ogura)
Introducing chrome apps (ogura)
 
Devoxx : being productive with JHipster
Devoxx : being productive with JHipsterDevoxx : being productive with JHipster
Devoxx : being productive with JHipster
 
Continuous Delivery: 5 years later (Incontro DevOps 2018)
Continuous Delivery: 5 years later (Incontro DevOps 2018)Continuous Delivery: 5 years later (Incontro DevOps 2018)
Continuous Delivery: 5 years later (Incontro DevOps 2018)
 
Voxxed days Vilnius 2015 - Android Reverse Engineering Lab
Voxxed days Vilnius 2015 - Android Reverse Engineering LabVoxxed days Vilnius 2015 - Android Reverse Engineering Lab
Voxxed days Vilnius 2015 - Android Reverse Engineering Lab
 
Chromium: NaCl and Pepper API
Chromium: NaCl and Pepper APIChromium: NaCl and Pepper API
Chromium: NaCl and Pepper API
 
Expedia 3x3 presentation
Expedia 3x3 presentationExpedia 3x3 presentation
Expedia 3x3 presentation
 
Mobile Controls for IBM Lotus Domino XPages on OpenNTF
Mobile Controls for IBM Lotus Domino XPages on OpenNTFMobile Controls for IBM Lotus Domino XPages on OpenNTF
Mobile Controls for IBM Lotus Domino XPages on OpenNTF
 

More from Bethmi Gunasekara

General Framework for Sentiment Analysis of Twitter Data, with Special Attent...
General Framework for Sentiment Analysis of Twitter Data, with Special Attent...General Framework for Sentiment Analysis of Twitter Data, with Special Attent...
General Framework for Sentiment Analysis of Twitter Data, with Special Attent...
Bethmi Gunasekara
 
Introduction to React JS
Introduction to React JSIntroduction to React JS
Introduction to React JS
Bethmi Gunasekara
 
TestNG - The Next Generation of Unit Testing
TestNG - The Next Generation of Unit TestingTestNG - The Next Generation of Unit Testing
TestNG - The Next Generation of Unit Testing
Bethmi Gunasekara
 
Html 5 - What's new?
Html 5 - What's new?Html 5 - What's new?
Html 5 - What's new?
Bethmi Gunasekara
 
No SQL- The Future Of Data Storage
No SQL- The Future Of Data StorageNo SQL- The Future Of Data Storage
No SQL- The Future Of Data Storage
Bethmi Gunasekara
 
Web Portal for Construction Industry
Web Portal for Construction IndustryWeb Portal for Construction Industry
Web Portal for Construction Industry
Bethmi Gunasekara
 

More from Bethmi Gunasekara (6)

General Framework for Sentiment Analysis of Twitter Data, with Special Attent...
General Framework for Sentiment Analysis of Twitter Data, with Special Attent...General Framework for Sentiment Analysis of Twitter Data, with Special Attent...
General Framework for Sentiment Analysis of Twitter Data, with Special Attent...
 
Introduction to React JS
Introduction to React JSIntroduction to React JS
Introduction to React JS
 
TestNG - The Next Generation of Unit Testing
TestNG - The Next Generation of Unit TestingTestNG - The Next Generation of Unit Testing
TestNG - The Next Generation of Unit Testing
 
Html 5 - What's new?
Html 5 - What's new?Html 5 - What's new?
Html 5 - What's new?
 
No SQL- The Future Of Data Storage
No SQL- The Future Of Data StorageNo SQL- The Future Of Data Storage
No SQL- The Future Of Data Storage
 
Web Portal for Construction Industry
Web Portal for Construction IndustryWeb Portal for Construction Industry
Web Portal for Construction Industry
 

Recently uploaded

RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
Srikant77
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
WSO2
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Jay Das
 

Recently uploaded (20)

RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
 

Electron JS | Build cross-platform desktop applications with web technologies

  • 1.
  • 2. Build cross platform desktop apps with JavaScript, HTML, and CSS
  • 3. Why we need ‘Desktop Applications’? [1/2] 3 ● Secure ● To work ‘Offline’ ○ On premises ○ We are ‘NOT CONSTANTLY CONNECTED’ ● For professional level applications ○ Photoshop, AutoCAD etc. ● Hosting?
  • 4. Why we need ‘Desktop Applications’? [2/2] ● Connect with peripheral devices & other local hardware ● Edit any local files ● Novice users - non tech savvy 4
  • 5. Other Desktop App Development Tools ● JavaFX ● Qt ● Gtk+ ● NW.js ● Kivy ● Lazarus ● Xojo ● Enyo ● Haxe 5
  • 6.
  • 7. If you can build a website, you can build a desktop app. 7
  • 8. Electron ● Open source library ● Developed by GitHub - Led by Cheng Zhao ● Cross-platform desktop applications ● Use web technologies - HTML, CSS & JavaScript. ● Combines Chromium and Node.js into a single runtime ● Mac, Windows, and Linux 8
  • 9. Atom Shell Framework originally written for Atom GitHub's hackable text editor became open-source Lorem ipsum dolor sit amet, consectetur Apps compatible with Mac App Store April 2013 May 2014 April 2015 May 2016 May 2016 August 2016 9 renamed as Electron Electron v1.0.0 Windows Store support
  • 11. ● Electron enables you to create desktop applications with pure JavaScript by providing a runtime with rich native (operating system) APIs. ● Electron is NOT a JavaScript binding to GUI libraries. ● Electron uses web pages as its GUI ○ “Chromium browser, controlled by JavaScript” ● Electron App: Web pages running in a browser that can leverage your OS APIs. 11
  • 12. It takes care of the hard parts. So you can focus on the core of your application 12
  • 13. ● Enable auto update ○ Squirrel/Squirrel.Windows - installation/update framework ● Native Components ○ Create native application menus and context menus, dialogs, system tray & notifications etc. ● Crash reporting ○ Submit crash reports to a remote server. ● Debugging & Profiling ○ Collect tracing data from Chromium's content module for finding performance bottlenecks and slow operations. 13
  • 14. 14 Apps built on Electron
  • 15. Install Electron? ● Recommended: Install as a development dependency ○ Allows you to work on multiple apps with different Electron versions ● Global Installation ● Proxies ● Custom Mirrors & Caches ● Customized 15
  • 16. Install Electron as a development dependency ● npm ○ Package manager/ software registry ○ Open-source building blocks of code (third party packages) ○ Install, update, share & distribute ● npm install --save-dev electron 16
  • 18. ● Create a new empty folder for your new Electron application. ● Run npm init ● npm will guide you to create a basic package.json file 18
  • 19. 19
  • 20. ● Install electron: ○ npm install --save-dev electron 20
  • 21. 21
  • 22. ● Add a start script that instructs node to execute the current package with electron runtime. ○ "start": "electron ." 22
  • 24. 1. package.json { "name": "your-app", "version": "0.1.0", "main": "main.js", "scripts": { "start": "electron ." } } 24
  • 25. 2. main.js const {app, BrowserWindow} = require('electron') function createWindow () { // Create the browser window. win = new BrowserWindow({width: 800, height: 600}) // and load the index.html of the app. win.loadFile('index.html') } app.on('ready', createWindow) 25
  • 26. 3. index.html <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Hello World!</title> </head> <body> <h1>Hello World!</h1> </body> </html> 26
  • 29. Main Process 29 ● Runs package.json's main script. ● The script that runs in the main process can display a GUI by creating web pages. ● An Electron app always has one main process, but never more.
  • 30. Renderer Process 30 ● Based on Chromium's multi-process architecture ● Electron uses Chromium for displaying web pages ● Each web page in Electron runs in its own process
  • 31. 31 ● The main process creates web pages by creating BrowserWindow instances. ● Each BrowserWindow instance runs the web page in its own renderer process. ● When a BrowserWindow instance is destroyed, the corresponding renderer process is also terminated.
  • 32. 32 ● The main process manages all web pages and their corresponding renderer processes. ● Each renderer process is isolated and only cares about the web page running in it.
  • 33. 33 ● In web pages, calling native GUI related APIs is not allowed. ○ Managing native GUI resources in web pages is very dangerous ○ It is easy to leak resources ● If you want to perform GUI operations in a web page, the renderer process of the web page must communicate with the main process to request that the main process perform those operations.
  • 34. 34
  • 35. Demo
  • 36. 36
  • 37. Application Distribution 1. Download Electron's prebuilt binaries 2. Packaging ○ can be done manually ○ Third party packaging tool ■ electron-forge ■ electron-builder ■ Electron-packager 37
  • 38. Pros [1/5] ● Electron Apps Are Similar to Web Apps ○ Relies entirely on web standards ■ HTML, CSS, JS ● Can focus on the core functionality ○ Electron already handles the hard part in software development 38
  • 39. Pros [2/5] ● Reuse of resources ○ Same team working on a web-application can easily implement a desktop application. ○ Several things from the web-application can be reused in the desktop app: ■ Business logic (services, helpers) ■ Design ■ General application structure ○ Saves time and money. 39
  • 40. Pros [3/5] ● Chromium engine for rendering UI ○ Developer tools ■ Don’t have to think of an external debugger ■ easy to measure performance, conduct profiling or detect memory leaks ○ Hot / Live reload ■ See changes instantly ○ Storage access ■ LocalStorage, SessionStorage, IndexedDB to persist application state. 40
  • 41. Pros [4/5] ● Provides various core functionalities: ○ Auto-update ○ crash reporter ○ installer creator ○ system-specific/native-ish features ■ Menu, system dialogs, file selection dialogs, notifications, printer, etc ■ Shortcuts bindings ○ Open file manager & external links ○ Screenshots & PDF 41
  • 42. Pros [5/5] ● Reuse of npm modules, out of the box ● No cross-browser compatibility issues ● No loading of remote assets (then no latency) ● Hardware Access ○ Keyboard shortcuts 42
  • 43. Cons [1/2] ● JavaScript ● No built-in MVC ● Not as feature-rich or mature as NW.js 43
  • 44. Cons [2/2] ● Size & Memory Usage! ○ Node JS + Chromium ○ Electrino - experimental featherweight alternative ● Cross Platform Builds? ○ If your app has native dependencies, it can be compiled only on the target platform. ■ macOS code Signing works only on MacOS. 44
  • 45. 45
  • 47. Resources for learning Electron ● electronjs.org/docs - all of Electron's documentation ● electron/electron-quick-start - a very basic starter Electron app ● electronjs.org/community#boilerplates - sample starter apps created by the community ● electron/simple-samples - small applications with ideas for taking them further ● electron/electron-api-demos - an Electron app that teaches you how to use Electron ● hokein/electron-sample-apps - small demo apps for the various Electron APIs 47
  • 48. References ● https://electronjs.org/ ● https://electronjs.org/docs/faq ● https://www.npmjs.com/package/electron ● https://slides.com/juliamaksimchik/electron-awesome ● https://www.tutorialspoint.com/electron/ ● https://steemit.com/technology/@ryanbaer/getting-started-with-electron-pt-3-how -the-hell-does-this-thing-work ● https://www.arroyolabs.com/2016/08/electron-and-cross-platform-applications/ ● https://ourcodeworld.com/articles/read/259/how-to-connect-to-a-mysql-database -in-electron-framework 48