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.
Because building a desktop app with Electron and Angular shouldn't be difficult.
- This project is based on last Angular version with required dependencies for Electron.
- This project is also written in Typescript and includes test samples (Jasmine and Spectron).
- The app is runnable
on desktop
(with live-reload indevelopment mode
). - The app is also runnable
on browser
but without Electron features. - You are granted a minimal size for your app thanks to
electron-webpack
. - You can also generate your platform packages thanks to
electron-builder
.
electron-angular-quick-start
├── README.md
├── angular.json
├── browserslist
├── e2e
│ ├── angular # Angular end-to-end test directory
│ └── electron # Electron end-to-end test directory
├── electron-builder.json
├── electron-webpack.json
├── karma.conf.js
├── package-lock.json
├── package.json
├── src
│ ├── angular # Angular source directory (web part)
│ ├── electron # Electron source directory (desktop part)
│ └── shared # Shared source directory (common part)
├── tsconfig.app.json
├── tsconfig.json
├── tsconfig.spec.json
└── tslint.json
To clone and run this repository, you'll need Git, Node.js and Angular-CLI installed on your computer. And then from your command line:
# First, 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
Command | Description |
---|---|
npm run install |
Install dependencies |
npm run start |
Run the app on desktop (dev mode) |
npm run ng:serve |
Run the app on browser (dev mode) |
npm run e2e |
Run glogbal end-to-end tests |
npm run ng:e2e |
Run angular end-to-end tests |
npm run electron:e2e |
Run electron end-to-end tests |
npm run build |
Build artifact content |
npm run package |
Generate platform packages (dist/release) |
- electronjs.org/docs - Electron's documentation
- electron/simple-samples - Small applications with ideas to take further
- electron/electron-api-demos - Sample app that teaches you how to use Electron
- angular.io/start - Getting started with Angular
- angular.io/docs - Angular's documentation
- cli.angular.io - Angular CLI documentation