GithubHelp home page GithubHelp logo

udaycode / electron-angular-quick-start Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sourcygen/electron-angular-quick-start

0.0 0.0 0.0 7.7 MB

An Electron and Angular Quick-starter

Home Page: https://sourcygen.github.io/electron-angular-quick-start/

License: MIT License

Shell 1.15% JavaScript 5.72% TypeScript 58.60% CSS 0.21% HTML 33.82% SCSS 0.50%

electron-angular-quick-start's Introduction

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 :

  • This project is based on last Angular 15 version with required dependencies for Electron 24.
  • This project is also written in Typescript 4/5 and includes test samples (WebdriverIO and Jasmine).
  • The app is runnable on desktop (with live-reload in development mode).
  • The app is also runnable on browser but without Electron features.
  • You can generate your platform distributables thanks to electron-forge.
  • You are also granted a minimal size for your app thanks to the packaging based on itswebpack-template.

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:

# Upgrade to the latest version of npm (if necessary)
npm install -g npm@latest

# Upgrade to the latest version of Angular CLI (if necessary)
npm install -g @angular/cli@latest

# 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 :

  • electron-app npm install --save <dependency>
  • angular-app npm install --save <dependency> -w angular-app
  • shared-lib npm install --save <dependency> -w shared-lib

Listing outdated dependencies

  • electron-app npm run outdated-deps:electron-app
  • angular-app npm run outdated-deps:angular-app
  • shared-lib npm run outdated-deps:shared-lib
  • all of them npm run outdated-deps

Updating dependencies

  • electron-app npm run update-deps:electron-app
  • angular-app npm run update-deps:angular-app
  • shared-lib npm run update-deps:shared-lib
  • all of them npm run update-deps

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

  • ./workspaces/electron-app/main/assets/icons/icon.png for Linux
  • ./workspaces/electron-app/main/assets/icons/icon.icns for MacOs
  • ./workspaces/electron-app/main/assets/icons/icon.ico for Windows

Resources

Electron

Angular

electron-angular-quick-start's People

Contributors

aadiene avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.