/ng-electron

Code which shows how to integrate an Angular-based app into Electron

Primary LanguageTypeScriptApache License 2.0Apache-2.0

ng-electron Build Status

This project shows how to integrate a standard Angular-Application into Electron.

image

Persistence

Environment Persistence layer
Angular Saves content value to browser's indexedDB level-js-ng-electron by key example-data
Electron Saves content value into a level-DB on filesystem in directory ${HOME}/Library/Application Support/ng-electron/ng-electron.db (macos) respectively %APPDATA%\ng-electron/ng-electron.db (windows)

Build and run (default Angular way)

This project was generated with Angular CLI version 7.3.3.

Development server

  • Run npm run start for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Build

  • Run npm run build:web to build the project. The build artifacts will be stored in the dist/ directory.
  • Run npm run build:web:prod for a production build.

Running unit tests

  • Run npm run test to execute the unit tests via Karma.
  • Run npm run test:ci to execute unit tests in a CI environment.

Build and run (Electron way)

This project uses Electron version 4.0.0 to build a desktop app.

Development server

  • Run electron:serve to serve your app via Electron. Notice that you have to serve your app via the Angular-way before that.

Build

  • Run build:electron to build the project.
  • Run npm run build:electron:prod for a production build.
  • Run npm run electron:windows to build the windows app. The build artifacts will be stored in the release/ directory.
  • Run npm run electron:mac to build the windows app. Notice that you need a macos-based OS to run this step. The build artifacts will be stored in the release/ directory.

Run

  • Run npm run electron:local to run the Electron-based app locally.

Further help