Skip to the content.

CI Status Maintenance Status License MIT PRs Welcome Tweet Watch on GitHub Star on GitHub

Electron Angular Quick Start

Overview

Depending on your need, putting up Electron and Angular may require a lot of setup. Fortunately, this simple project will help you go fast and directly start building desktop apps in Typescript with live reload.

Because building a desktop app with Electron and Angular shouldn’t be difficult.

Main features :

Project structure :

├── ./CHANGELOG.md
├── ./LICENSE
├── ./README.md
├── ./_config.yml
├── ./commitlint.config.js
├── ./package-lock.json
├── ./package.json
├── ./tsconfig.json
├── ./webpack.main.config.js
├── ./webpack.plugins.js
├── ./webpack.renderer.config.js
├── ./webpack.rules.js
└── ./workspaces
    ├── ./workspaces/angular-app       # Angular source directory (web renderer part)
    ├── ./workspaces/electron-app      # Electron source directory (main & preload part)
    ├── ./workspaces/electron-e2e      # Electron end-to-end test directory
    └── ./workspaces/shared-lib        # Shared source directory (common part)

Getting started

To clone and run this repository, you’ll need installed on your computer at least :

Then from your command line:

# Clone this repository
git clone https://github.com/sourcygen/electron-angular-quick-start.git

# Then go into the repository
cd electron-angular-quick-start

# After that, install dependencies
npm install

# And finally run the app (dev mode)
npm start

How to use

Command Description
npm run install Install dependencies
npm run start Run the app on desktop (dev mode)
npm run start:angular-app Run the app on browser (dev mode)
npm run test:angular Run angular unit tests
npm run test:angular-e2e Run angular end-to-end tests
npm run test:electron-e2e Run electron end-to-end tests
npm run package Build and prepare application content
npm run make Generate platform distributables (./out)
npm run clean Delete generated outputs

Behind a proxy

After settings HTTP_PROXY and HTTPS_PROXY environment variables :

# Install dependencies
npx cross-env ELECTRON_GET_USE_PROXY=true GLOBAL_AGENT_HTTPS_PROXY=%HTTPS_PROXY% npm install

Adding dependencies

This project architecture is based on npm workspaces. This allows having different version of the same dependency depending on your workspace :

Listing outdated dependencies

Updating dependencies

Customizing app icons

# Install the icon generator globally
npm i -g electron-icon-maker

# Run following command from anywhere you have your input file (1024px at least) to generate platforms icons
electron-icon-maker --input=icon.png --output=./out

Rename and move files to match with next config

Resources

Electron

Angular