An open API service indexing awesome lists of open source software.

https://github.com/borisskert/ng-electron

Code which shows how to integrate an Angular-based app into Electron
https://github.com/borisskert/ng-electron

angular angular-cli autoupdater electron electron-builder macos windows

Last synced: 7 months ago
JSON representation

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

Awesome Lists containing this project

README

          

# ng-electron [![Build Status](https://travis-ci.com/borisskert/ng-electron.svg?branch=master)](https://travis-ci.com/borisskert/ng-electron)

This project shows how to integrate a standard [Angular](https://angular.io)-Application into [Electron](https://electronjs.org).

![image](doc/mainscreen.png)

## 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](https://github.com/angular/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](https://karma-runner.github.io).
* Run `npm run test:ci` to execute unit tests in a CI environment.

## Build and run (Electron way)

This project uses [Electron](https://electronjs.org) 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

* To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
* To get more help how to build and run the app via Electron go check out the [official Electron-Website](https://electronjs.org).