SlideShare una empresa de Scribd logo
1 de 45
#codesquad Esinniobiwa Quareeb
Esinniobiwa Quareeb
(Dev Esin)
Myself
devesin1
devesin1
devesin1
devesin
What I do
FullStack Developer, Facilitator and
Technical Writer
 Founder, Author & Mobile Apps Developer
at Devplus Evolution
 Web Application Developer at Qingdom
Technologies
 Trainer & Instructor at FoundersHub
#CodeSquad
DO YOU HAVE AN IDEA OF:
HTML
CSS
JAVASCRIPT
Requirement
Passion and Fuel (e.g. Coffee)
Yea, you’re good to go
#CodeSquad
Developers
Meetup
http://bit.ly/codesquadmu
#CodeSquad
Desktop Apps
An application that runs stand
alone in a desktop or laptop
computer. Contrast with "Web-
based application," which
requires the Web browser to
run. The term may be used to
contrast desktop applications
with mobile applications that
run in smartphones and
tablets.
Desktop Apps with Electron
Let Electron do the hard work for you while
you sit back, watch and sip your coffee
Been in existence since 2013
Github released Atom-Shell, the core of its famous
open-source editor Atom, and renamed it
to Electron for the special occasion.
Electron, unlike other competitors in the category of
Node.js-based desktop applications, brings its own
twist to this already well-established market by
combining the power of Node.js (io.js until recent
releases) with the Chromium Engine to bring us the
best of both server and client-side JavaScript.
Imagine a world where we could build performant,
data-driven, cross-platform desktop applications
powered by not only the ever-growing repository of
NPM modules, but also the entire Bower registry to
fulfill all our client-side needs.
Electron
PROS:
• HTML + CSS + JS
• NodeJs + Chrome
• No deplyoment Dependencies
Electron
CONS:
• HTML + CSS + JS
• JavaScript
• Native Module in C/C++
Electron Features
• Rapid Development
• Themes
• Shared Code/UI
• Deployment + Silent Updates
• Native UX
Popular Apps that are built on electron
Let’s get started
Make sure that nodejs is installed as well as
electron. To check, open command line and type
node –v
electron –v
New to node, it is easy, just dive to
https://nodejs.org
And download the latest version of nodejs
Todo 1
• Make sure you’re in the desired directory, In my
own case, I use desktop, so fire up your
command line, navigate to the directory and it
should be something like this
Todo 2
• Create a directory where your project will
reside. On windows you can use mkdir
command like this
mkdir testapps
This will create a folder named testapps on
desktop.
Then go inside the directory using this
command:
cd testapps
So far you should have this
This means
• you’re on desktop
• You’ve successfully created a folder named testapps where your project will
reside and
• You’re inside the testapps folder to begin operation
NOTE: Please don’t close the command line, if you have to test your progress, just
minimize it and go back their later, it doesn’t have effect, it will just save you time to
have to navigate to the directory all over again
Set up your apps
Initialize your apps with this command
npm init
This will ask your information about
your apps and then create
package.json file inside folder testapps
You should have this, once you fill out
the entries:
Keynote 1
• Press enter key if what the command line
suggested is what you want to use, else type
your desired entries.
Example, npm suggested testapps as the name of
my project, since it is okay by me, I pressed enter
key.
You can later change the properties in
package.json file
• So far, package.json file has been created for us,
which contain information about the apps.
• Index.js is the entrypoint, that is where we will
define our project details and initialize electron
Install electron in your current
directory
using command line type:
npm install electron -save --dev --verbose
The command is pretty straight-forward.
--verbose is used to display information about
the installation process since it can take a while,
and you’d want to be sure it hasn’t stopped
working.
If everything worked fine, you should
have this:
Now in your testapps folder, you
should have a file and a folder
• Package.json file
• node_modules folder
You can play around with package.json file
Please don’t touch the node_modules folder
Fire up your text editor to create index.js file
Recall: That’s your project entry point
Put these codes in your index.js file
const electron = require("electron");
const app = electron.app;
const BrowserWindow = electron.BrowserWindow;
var myWindow;
app.on('ready',function(){
myWindow = new BrowserWindow({width: 800,
height: 720});
//myWindow.loadURL('https://google.com');
myWindow.loadURL('file://' + __dirname +
'/index.html');
});
Explanation
• First, we include electron using the require
statement, then electron object returned by the line
1, then we create the app object, this will represent
our application and we can just be assigning values
to it later on.
• Second, we create application window, where the
app will be loaded using BrowserWindow object in
electron.
• Then define window object using
var mainWindow;
• Then, we bind the app with ready event when your
app is loaded
Explanation cont’d
• Then define properties for your myWindow object,
we can give it many properties
Height, Width, "use-content-size": false, resizable:
true, center: true and many more
You can load a webpage using loadURL and you can as
well load your index.html file
NOTE: To load the url, comment out
//mainWindow.loadURL('file://' + __dirname +
'/index.html');
And to load the index.html file, comment out
//mainWindow.loadURL('https://google.com');
Then, modify the package.json file, change the line
"test": "echo "Error: no test specified" && exit 1“
To
"start": "electron . "
This is to execute electron app at the specified
location
Create a sample index.html page
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Electron Apps</title>
</head>
<body>
<header>
<h1 style="text-align: center;">Electron Apps</h1>
</header>
<main>
<p style="text-align: center; font-size: 24px" > I am a sample web page, I
can be built using <b>HTML</b>, <b>CSS</b> and <b>JS</b>, packaged with
<b>Electron</b></p>
</main>
</body>
</html>
Then go to command line and type
npm start
This will execute the “ electron . ” Specified in
package.json
If everything works fine without errors, you will see
the interface in the next slide
To Package the Apps
Use electron-packager, In the command line type:
npm install electron-packager
This may take a while, after successful installation,
start electron-packager using
electron-packager .
The first command will install electron-packager
inside the node_modules folder
The second command will write executable of your
apps targetting the machine you’re building on
“electron-packager .” will build the
executable of your files targetting the
machine you’re working on.
The downside is that, your source code will be
displayed alongside the executable, in order to
make our source code hidden, use
electron-packager . --asar
--asar will create asar files for your source code so
that it won’t be visible to prying eyes
The folder structure should look like
this
“testapps-win32-x64” folder contain the executable file and
other accompanying files
For all platforms deployment
electron-packager . --all
This will deploy for all platforms, although this
may take a while
How To:
Executable
and
Installable
Electron packager build installable for
you
There are quite lots of apps out their to
create installer for your apps. Example
• Install Creator
• Install Forge
And many more
In this case, we’ll be using #Installforge
Let’s go back and Test
If you have an existing web project
that you want to turn desktop apps
• Just open commandline in the directory.
• Initialize npm and follow the procedure
• In no time you will get your executable file.
For more information and documentation,
https://electron.atom.io/
Thanks for Listening
Information about building installable
package for your apps will be made
available on request.
The apps created with electron, with
this slides and detailed information
are on this github repository
https://github.com/devesin/electron-typingmaster
devesindevesindevesin1
Screenshot of the typing practice apps
Cross-platform Desktop Apps development using HTML, CSS, JS with Electron

Más contenido relacionado

La actualidad más candente

Reactive Programming in .Net - actorbased computing with Akka.Net
Reactive Programming in .Net - actorbased computing with Akka.NetReactive Programming in .Net - actorbased computing with Akka.Net
Reactive Programming in .Net - actorbased computing with Akka.NetSören Stelzer
 
Electron - Solving our cross platform dreams?
Electron - Solving our cross platform dreams?Electron - Solving our cross platform dreams?
Electron - Solving our cross platform dreams?Chris Ward
 
Maven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable ResultsMaven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable ResultsSteve Keener
 
Best Practice-React
Best Practice-ReactBest Practice-React
Best Practice-ReactYang Yang
 
How to setup jenkins
How to setup jenkinsHow to setup jenkins
How to setup jenkinslinuxdady
 
More Modern Perl - YAPC 2016
More Modern Perl - YAPC 2016More Modern Perl - YAPC 2016
More Modern Perl - YAPC 2016Jason Hall
 
The Price of Fixing One Bug in Our Programs, or Exotic Bugs in PVS-Studio and...
The Price of Fixing One Bug in Our Programs, or Exotic Bugs in PVS-Studio and...The Price of Fixing One Bug in Our Programs, or Exotic Bugs in PVS-Studio and...
The Price of Fixing One Bug in Our Programs, or Exotic Bugs in PVS-Studio and...Andrey Karpov
 
Evented applications with RabbitMQ and CakePHP
Evented applications with RabbitMQ and CakePHPEvented applications with RabbitMQ and CakePHP
Evented applications with RabbitMQ and CakePHPmarkstory
 
Meet Puppet's new product lineup 12/7/2017
Meet Puppet's new product lineup 12/7/2017Meet Puppet's new product lineup 12/7/2017
Meet Puppet's new product lineup 12/7/2017Puppet
 
Continuous integration of_puppet_code
Continuous integration of_puppet_codeContinuous integration of_puppet_code
Continuous integration of_puppet_codeDevoteam Revolve
 
Our Puppet Story (Linuxtag 2014)
Our Puppet Story (Linuxtag 2014)Our Puppet Story (Linuxtag 2014)
Our Puppet Story (Linuxtag 2014)DECK36
 
Writing a npm module
Writing a npm moduleWriting a npm module
Writing a npm moduleHarsh Joshi
 
Building and Deployment of Drupal sites with Features and Context
Building and Deployment of Drupal sites with Features and ContextBuilding and Deployment of Drupal sites with Features and Context
Building and Deployment of Drupal sites with Features and ContextSvilen Sabev
 
Concurrent Rendering Adventures in React 18
Concurrent Rendering Adventures in React 18Concurrent Rendering Adventures in React 18
Concurrent Rendering Adventures in React 18Maurice De Beijer [MVP]
 
Selenium Training in Chennai Demo Part-2
Selenium Training in Chennai Demo Part-2 Selenium Training in Chennai Demo Part-2
Selenium Training in Chennai Demo Part-2 Thecreating Experts
 

La actualidad más candente (20)

Reactive Programming in .Net - actorbased computing with Akka.Net
Reactive Programming in .Net - actorbased computing with Akka.NetReactive Programming in .Net - actorbased computing with Akka.Net
Reactive Programming in .Net - actorbased computing with Akka.Net
 
Electron - Solving our cross platform dreams?
Electron - Solving our cross platform dreams?Electron - Solving our cross platform dreams?
Electron - Solving our cross platform dreams?
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
Kruize
KruizeKruize
Kruize
 
Maven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable ResultsMaven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable Results
 
Best Practice-React
Best Practice-ReactBest Practice-React
Best Practice-React
 
How to setup jenkins
How to setup jenkinsHow to setup jenkins
How to setup jenkins
 
More Modern Perl - YAPC 2016
More Modern Perl - YAPC 2016More Modern Perl - YAPC 2016
More Modern Perl - YAPC 2016
 
The Price of Fixing One Bug in Our Programs, or Exotic Bugs in PVS-Studio and...
The Price of Fixing One Bug in Our Programs, or Exotic Bugs in PVS-Studio and...The Price of Fixing One Bug in Our Programs, or Exotic Bugs in PVS-Studio and...
The Price of Fixing One Bug in Our Programs, or Exotic Bugs in PVS-Studio and...
 
Evented applications with RabbitMQ and CakePHP
Evented applications with RabbitMQ and CakePHPEvented applications with RabbitMQ and CakePHP
Evented applications with RabbitMQ and CakePHP
 
Meet Puppet's new product lineup 12/7/2017
Meet Puppet's new product lineup 12/7/2017Meet Puppet's new product lineup 12/7/2017
Meet Puppet's new product lineup 12/7/2017
 
Continuous integration of_puppet_code
Continuous integration of_puppet_codeContinuous integration of_puppet_code
Continuous integration of_puppet_code
 
code-camp-meteor
code-camp-meteorcode-camp-meteor
code-camp-meteor
 
Web Hooks
Web HooksWeb Hooks
Web Hooks
 
Our Puppet Story (Linuxtag 2014)
Our Puppet Story (Linuxtag 2014)Our Puppet Story (Linuxtag 2014)
Our Puppet Story (Linuxtag 2014)
 
Writing a npm module
Writing a npm moduleWriting a npm module
Writing a npm module
 
Building and Deployment of Drupal sites with Features and Context
Building and Deployment of Drupal sites with Features and ContextBuilding and Deployment of Drupal sites with Features and Context
Building and Deployment of Drupal sites with Features and Context
 
Puppet - an introduction
Puppet - an introductionPuppet - an introduction
Puppet - an introduction
 
Concurrent Rendering Adventures in React 18
Concurrent Rendering Adventures in React 18Concurrent Rendering Adventures in React 18
Concurrent Rendering Adventures in React 18
 
Selenium Training in Chennai Demo Part-2
Selenium Training in Chennai Demo Part-2 Selenium Training in Chennai Demo Part-2
Selenium Training in Chennai Demo Part-2
 

Destacado

Muammar al-Gaddafi - Das Grüne Buch
Muammar al-Gaddafi - Das Grüne BuchMuammar al-Gaddafi - Das Grüne Buch
Muammar al-Gaddafi - Das Grüne BuchMCExorzist
 
Politische Ponerologie
Politische PonerologiePolitische Ponerologie
Politische PonerologieMCExorzist
 
Real History - The Bad War (english 115s)
Real History - The Bad War (english 115s)Real History - The Bad War (english 115s)
Real History - The Bad War (english 115s)MCExorzist
 
Gerd Honsik - Freispruch für Hitler - 1988 - 233S
Gerd Honsik - Freispruch für Hitler - 1988 - 233SGerd Honsik - Freispruch für Hitler - 1988 - 233S
Gerd Honsik - Freispruch für Hitler - 1988 - 233SMCExorzist
 
Thomas Goodrich - Hellstorm The Death Of Nazi Germany
Thomas Goodrich - Hellstorm The Death Of Nazi GermanyThomas Goodrich - Hellstorm The Death Of Nazi Germany
Thomas Goodrich - Hellstorm The Death Of Nazi GermanyMCExorzist
 
JavaScript - The Universal Platform?
JavaScript - The Universal Platform?JavaScript - The Universal Platform?
JavaScript - The Universal Platform?Jonas Bandi
 
From Drupal 7 to Drupal 8 - Drupal Intensive Course Overview
From Drupal 7 to Drupal 8 - Drupal Intensive Course OverviewFrom Drupal 7 to Drupal 8 - Drupal Intensive Course Overview
From Drupal 7 to Drupal 8 - Drupal Intensive Course OverviewItalo Mairo
 
Angela Merkel - Doktorarbeit
Angela Merkel - DoktorarbeitAngela Merkel - Doktorarbeit
Angela Merkel - DoktorarbeitMCExorzist
 
Cross-Platform Desktop Apps with Electron (JSConf UY)
Cross-Platform Desktop Apps with Electron (JSConf UY)Cross-Platform Desktop Apps with Electron (JSConf UY)
Cross-Platform Desktop Apps with Electron (JSConf UY)David Neal
 
Cross-Platform Desktop Apps with Electron (CodeStock Edition)
Cross-Platform Desktop Apps with Electron (CodeStock Edition)Cross-Platform Desktop Apps with Electron (CodeStock Edition)
Cross-Platform Desktop Apps with Electron (CodeStock Edition)David Neal
 
JavaScript and Desktop Apps - Introduction to Electron
JavaScript and Desktop Apps - Introduction to ElectronJavaScript and Desktop Apps - Introduction to Electron
JavaScript and Desktop Apps - Introduction to ElectronBrainhub
 
RESTful application with Drupal 8
RESTful application with Drupal 8RESTful application with Drupal 8
RESTful application with Drupal 8Patrick Morin
 
Drupal 8: frontend development
Drupal 8: frontend developmentDrupal 8: frontend development
Drupal 8: frontend developmentsparkfabrik
 
NativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
NativeScript: Cross-Platform Mobile Apps with JavaScript and AngularNativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
NativeScript: Cross-Platform Mobile Apps with JavaScript and AngularTodd Anglin
 
Audiobooks and the Sound of Sales - Noah Genner - Tech Forum 2017
Audiobooks and the Sound of Sales - Noah Genner - Tech Forum 2017Audiobooks and the Sound of Sales - Noah Genner - Tech Forum 2017
Audiobooks and the Sound of Sales - Noah Genner - Tech Forum 2017BookNet Canada
 
Electron - Build cross platform desktop apps
Electron - Build cross platform desktop appsElectron - Build cross platform desktop apps
Electron - Build cross platform desktop appsPriyaranjan Mohanty
 

Destacado (20)

Muammar al-Gaddafi - Das Grüne Buch
Muammar al-Gaddafi - Das Grüne BuchMuammar al-Gaddafi - Das Grüne Buch
Muammar al-Gaddafi - Das Grüne Buch
 
JS Class 2016
JS Class 2016JS Class 2016
JS Class 2016
 
Politische Ponerologie
Politische PonerologiePolitische Ponerologie
Politische Ponerologie
 
Real History - The Bad War (english 115s)
Real History - The Bad War (english 115s)Real History - The Bad War (english 115s)
Real History - The Bad War (english 115s)
 
Gerd Honsik - Freispruch für Hitler - 1988 - 233S
Gerd Honsik - Freispruch für Hitler - 1988 - 233SGerd Honsik - Freispruch für Hitler - 1988 - 233S
Gerd Honsik - Freispruch für Hitler - 1988 - 233S
 
Thomas Goodrich - Hellstorm The Death Of Nazi Germany
Thomas Goodrich - Hellstorm The Death Of Nazi GermanyThomas Goodrich - Hellstorm The Death Of Nazi Germany
Thomas Goodrich - Hellstorm The Death Of Nazi Germany
 
JavaScript - The Universal Platform?
JavaScript - The Universal Platform?JavaScript - The Universal Platform?
JavaScript - The Universal Platform?
 
From Drupal 7 to Drupal 8 - Drupal Intensive Course Overview
From Drupal 7 to Drupal 8 - Drupal Intensive Course OverviewFrom Drupal 7 to Drupal 8 - Drupal Intensive Course Overview
From Drupal 7 to Drupal 8 - Drupal Intensive Course Overview
 
Angela Merkel - Doktorarbeit
Angela Merkel - DoktorarbeitAngela Merkel - Doktorarbeit
Angela Merkel - Doktorarbeit
 
Cross-Platform Desktop Apps with Electron (JSConf UY)
Cross-Platform Desktop Apps with Electron (JSConf UY)Cross-Platform Desktop Apps with Electron (JSConf UY)
Cross-Platform Desktop Apps with Electron (JSConf UY)
 
Cross-Platform Desktop Apps with Electron (CodeStock Edition)
Cross-Platform Desktop Apps with Electron (CodeStock Edition)Cross-Platform Desktop Apps with Electron (CodeStock Edition)
Cross-Platform Desktop Apps with Electron (CodeStock Edition)
 
Electron
ElectronElectron
Electron
 
JavaScript and Desktop Apps - Introduction to Electron
JavaScript and Desktop Apps - Introduction to ElectronJavaScript and Desktop Apps - Introduction to Electron
JavaScript and Desktop Apps - Introduction to Electron
 
RESTful application with Drupal 8
RESTful application with Drupal 8RESTful application with Drupal 8
RESTful application with Drupal 8
 
Drupal 8: frontend development
Drupal 8: frontend developmentDrupal 8: frontend development
Drupal 8: frontend development
 
NativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
NativeScript: Cross-Platform Mobile Apps with JavaScript and AngularNativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
NativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
 
Audiobooks and the Sound of Sales - Noah Genner - Tech Forum 2017
Audiobooks and the Sound of Sales - Noah Genner - Tech Forum 2017Audiobooks and the Sound of Sales - Noah Genner - Tech Forum 2017
Audiobooks and the Sound of Sales - Noah Genner - Tech Forum 2017
 
Presentation laravel 5 4
Presentation laravel 5 4Presentation laravel 5 4
Presentation laravel 5 4
 
Electron - Build cross platform desktop apps
Electron - Build cross platform desktop appsElectron - Build cross platform desktop apps
Electron - Build cross platform desktop apps
 
JS class slides (2016)
JS class slides (2016)JS class slides (2016)
JS class slides (2016)
 

Similar a Cross-platform Desktop Apps development using HTML, CSS, JS with Electron

How create react app help in creating a new react applications
How create react app help in creating a new react applications How create react app help in creating a new react applications
How create react app help in creating a new react applications Concetto Labs
 
TiConf NYC - Documenting Your Titanium Applications
TiConf NYC - Documenting Your Titanium ApplicationsTiConf NYC - Documenting Your Titanium Applications
TiConf NYC - Documenting Your Titanium ApplicationsJamil Spain
 
Documenting apps ti confnyc
Documenting apps   ti confnycDocumenting apps   ti confnyc
Documenting apps ti confnycJamil Spain
 
How to install ReactJS software
How to install ReactJS software How to install ReactJS software
How to install ReactJS software VigneshVijay21
 
ReactJS software installation
ReactJS software installationReactJS software installation
ReactJS software installationHopeTutors1
 
Start your adventure with docker
Start your adventure with dockerStart your adventure with docker
Start your adventure with dockerSagar Dash
 
JavaScript development methodology
JavaScript development methodologyJavaScript development methodology
JavaScript development methodologyAleksander Fabijan
 
Electron - cross platform desktop applications made easy
Electron - cross platform desktop applications made easyElectron - cross platform desktop applications made easy
Electron - cross platform desktop applications made easyUlrich Krause
 
Gaganjot Kaur- The Nx Workspace.docx
Gaganjot Kaur- The Nx Workspace.docxGaganjot Kaur- The Nx Workspace.docx
Gaganjot Kaur- The Nx Workspace.docxGaganjot kaur
 
Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docx
Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docxPart 4 Scripting and Virtualization (due Week 7)Objectives1. .docx
Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docxkarlhennesey
 
E2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
E2E testing Single Page Apps and APIs with Cucumber.js and PuppeteerE2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
E2E testing Single Page Apps and APIs with Cucumber.js and PuppeteerPaul Jensen
 
Overview of Node JS
Overview of Node JSOverview of Node JS
Overview of Node JSJacob Nelson
 

Similar a Cross-platform Desktop Apps development using HTML, CSS, JS with Electron (20)

How create react app help in creating a new react applications
How create react app help in creating a new react applications How create react app help in creating a new react applications
How create react app help in creating a new react applications
 
Database Management Assignment Help
Database Management Assignment Help Database Management Assignment Help
Database Management Assignment Help
 
How java works
How java worksHow java works
How java works
 
How java works
How java worksHow java works
How java works
 
Class 1
Class 1Class 1
Class 1
 
Class 1
Class 1Class 1
Class 1
 
TiConf NYC - Documenting Your Titanium Applications
TiConf NYC - Documenting Your Titanium ApplicationsTiConf NYC - Documenting Your Titanium Applications
TiConf NYC - Documenting Your Titanium Applications
 
Documenting apps ti confnyc
Documenting apps   ti confnycDocumenting apps   ti confnyc
Documenting apps ti confnyc
 
How to install ReactJS software
How to install ReactJS software How to install ReactJS software
How to install ReactJS software
 
ReactJS software installation
ReactJS software installationReactJS software installation
ReactJS software installation
 
Start your adventure with docker
Start your adventure with dockerStart your adventure with docker
Start your adventure with docker
 
JavaScript development methodology
JavaScript development methodologyJavaScript development methodology
JavaScript development methodology
 
Electron - cross platform desktop applications made easy
Electron - cross platform desktop applications made easyElectron - cross platform desktop applications made easy
Electron - cross platform desktop applications made easy
 
Android app upload
Android app uploadAndroid app upload
Android app upload
 
Android programming-basics
Android programming-basicsAndroid programming-basics
Android programming-basics
 
Gaganjot Kaur- The Nx Workspace.docx
Gaganjot Kaur- The Nx Workspace.docxGaganjot Kaur- The Nx Workspace.docx
Gaganjot Kaur- The Nx Workspace.docx
 
Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docx
Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docxPart 4 Scripting and Virtualization (due Week 7)Objectives1. .docx
Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docx
 
E2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
E2E testing Single Page Apps and APIs with Cucumber.js and PuppeteerE2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
E2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
 
Overview of Node JS
Overview of Node JSOverview of Node JS
Overview of Node JS
 
Class 1 blog
Class 1 blogClass 1 blog
Class 1 blog
 

Último

AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 

Último (20)

AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 

Cross-platform Desktop Apps development using HTML, CSS, JS with Electron

  • 3. What I do FullStack Developer, Facilitator and Technical Writer  Founder, Author & Mobile Apps Developer at Devplus Evolution  Web Application Developer at Qingdom Technologies  Trainer & Instructor at FoundersHub #CodeSquad
  • 4. DO YOU HAVE AN IDEA OF: HTML CSS JAVASCRIPT Requirement Passion and Fuel (e.g. Coffee) Yea, you’re good to go #CodeSquad
  • 6. Desktop Apps An application that runs stand alone in a desktop or laptop computer. Contrast with "Web- based application," which requires the Web browser to run. The term may be used to contrast desktop applications with mobile applications that run in smartphones and tablets.
  • 7. Desktop Apps with Electron
  • 8. Let Electron do the hard work for you while you sit back, watch and sip your coffee
  • 9. Been in existence since 2013 Github released Atom-Shell, the core of its famous open-source editor Atom, and renamed it to Electron for the special occasion. Electron, unlike other competitors in the category of Node.js-based desktop applications, brings its own twist to this already well-established market by combining the power of Node.js (io.js until recent releases) with the Chromium Engine to bring us the best of both server and client-side JavaScript. Imagine a world where we could build performant, data-driven, cross-platform desktop applications powered by not only the ever-growing repository of NPM modules, but also the entire Bower registry to fulfill all our client-side needs.
  • 10.
  • 11. Electron PROS: • HTML + CSS + JS • NodeJs + Chrome • No deplyoment Dependencies
  • 12. Electron CONS: • HTML + CSS + JS • JavaScript • Native Module in C/C++
  • 13. Electron Features • Rapid Development • Themes • Shared Code/UI • Deployment + Silent Updates • Native UX
  • 14.
  • 15. Popular Apps that are built on electron
  • 16. Let’s get started Make sure that nodejs is installed as well as electron. To check, open command line and type node –v electron –v New to node, it is easy, just dive to https://nodejs.org And download the latest version of nodejs
  • 17. Todo 1 • Make sure you’re in the desired directory, In my own case, I use desktop, so fire up your command line, navigate to the directory and it should be something like this
  • 18. Todo 2 • Create a directory where your project will reside. On windows you can use mkdir command like this mkdir testapps This will create a folder named testapps on desktop. Then go inside the directory using this command: cd testapps
  • 19. So far you should have this This means • you’re on desktop • You’ve successfully created a folder named testapps where your project will reside and • You’re inside the testapps folder to begin operation NOTE: Please don’t close the command line, if you have to test your progress, just minimize it and go back their later, it doesn’t have effect, it will just save you time to have to navigate to the directory all over again
  • 20. Set up your apps Initialize your apps with this command npm init This will ask your information about your apps and then create package.json file inside folder testapps
  • 21. You should have this, once you fill out the entries:
  • 22. Keynote 1 • Press enter key if what the command line suggested is what you want to use, else type your desired entries. Example, npm suggested testapps as the name of my project, since it is okay by me, I pressed enter key. You can later change the properties in package.json file • So far, package.json file has been created for us, which contain information about the apps. • Index.js is the entrypoint, that is where we will define our project details and initialize electron
  • 23. Install electron in your current directory using command line type: npm install electron -save --dev --verbose The command is pretty straight-forward. --verbose is used to display information about the installation process since it can take a while, and you’d want to be sure it hasn’t stopped working.
  • 24. If everything worked fine, you should have this:
  • 25. Now in your testapps folder, you should have a file and a folder • Package.json file • node_modules folder You can play around with package.json file Please don’t touch the node_modules folder Fire up your text editor to create index.js file Recall: That’s your project entry point
  • 26. Put these codes in your index.js file const electron = require("electron"); const app = electron.app; const BrowserWindow = electron.BrowserWindow; var myWindow; app.on('ready',function(){ myWindow = new BrowserWindow({width: 800, height: 720}); //myWindow.loadURL('https://google.com'); myWindow.loadURL('file://' + __dirname + '/index.html'); });
  • 27. Explanation • First, we include electron using the require statement, then electron object returned by the line 1, then we create the app object, this will represent our application and we can just be assigning values to it later on. • Second, we create application window, where the app will be loaded using BrowserWindow object in electron. • Then define window object using var mainWindow; • Then, we bind the app with ready event when your app is loaded
  • 28. Explanation cont’d • Then define properties for your myWindow object, we can give it many properties Height, Width, "use-content-size": false, resizable: true, center: true and many more You can load a webpage using loadURL and you can as well load your index.html file NOTE: To load the url, comment out //mainWindow.loadURL('file://' + __dirname + '/index.html'); And to load the index.html file, comment out //mainWindow.loadURL('https://google.com');
  • 29. Then, modify the package.json file, change the line "test": "echo "Error: no test specified" && exit 1“ To "start": "electron . " This is to execute electron app at the specified location
  • 30. Create a sample index.html page <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Electron Apps</title> </head> <body> <header> <h1 style="text-align: center;">Electron Apps</h1> </header> <main> <p style="text-align: center; font-size: 24px" > I am a sample web page, I can be built using <b>HTML</b>, <b>CSS</b> and <b>JS</b>, packaged with <b>Electron</b></p> </main> </body> </html>
  • 31. Then go to command line and type npm start This will execute the “ electron . ” Specified in package.json If everything works fine without errors, you will see the interface in the next slide
  • 32.
  • 33.
  • 34. To Package the Apps Use electron-packager, In the command line type: npm install electron-packager This may take a while, after successful installation, start electron-packager using electron-packager . The first command will install electron-packager inside the node_modules folder The second command will write executable of your apps targetting the machine you’re building on
  • 35. “electron-packager .” will build the executable of your files targetting the machine you’re working on. The downside is that, your source code will be displayed alongside the executable, in order to make our source code hidden, use electron-packager . --asar --asar will create asar files for your source code so that it won’t be visible to prying eyes
  • 36. The folder structure should look like this “testapps-win32-x64” folder contain the executable file and other accompanying files
  • 37. For all platforms deployment electron-packager . --all This will deploy for all platforms, although this may take a while
  • 39. Electron packager build installable for you There are quite lots of apps out their to create installer for your apps. Example • Install Creator • Install Forge And many more In this case, we’ll be using #Installforge
  • 40.
  • 41. Let’s go back and Test
  • 42. If you have an existing web project that you want to turn desktop apps • Just open commandline in the directory. • Initialize npm and follow the procedure • In no time you will get your executable file. For more information and documentation, https://electron.atom.io/
  • 43. Thanks for Listening Information about building installable package for your apps will be made available on request. The apps created with electron, with this slides and detailed information are on this github repository https://github.com/devesin/electron-typingmaster devesindevesindevesin1
  • 44. Screenshot of the typing practice apps