A desktop client to query stock data from Yahoo Finance.
Bootstrapped and packaged with Angular 11 and Electron 12.
Report Bug · Request Feature
Table of Contents
A desktop client to query stock data from Yahoo Finance, bootstrapped and packaged with Angular 11 and Electron 12.
Currently runs with:
- Angular v11
- Electron v12
- Electron Builder v22
This application can be:
- Run in a local development environment with Electron & Hot reload
- Hot reload only pertains to the renderer process. The main electron process is not able to be hot reloaded, only restarted.
- Run in a production environment
- Packaged into an executable for Linux, Windows & Mac
Note: Angular 11.x CLI needs Node 10.13 or later to work correctly.
Clone this repository locally:
git clone https://github.com/nishant/stock-desktop.git
Install dependencies with npm:
npm install
There is an issue with yarn
and node_modules
when the application is built
by the packager. Use npm
as dependencies manager.
If you want to generate Angular components with Angular CLI , you MUST
install @angular/cli
in npm global context. Follow Angular's
documentation if you had installed a
previous version of angular-cli
.
npm install -g @angular/cli
Run the start script to use the application local development environment with hot reload.
npm start
The application code is managed by main.ts
. The app runs with a simple Angular
App (http://localhost:4200) and an Electron window.
You can disable "Developer Tools" by setting the boolean flag openDevTools
to
false
in main.ts
.
To execute the application in the browser with hot reload, run
npm run ng:serve:web
.
Alternatively, the application can still run in-browser at
https://localhost:4200 even when npm start
is used.
This project runs in both web and desktop mode. To make this work, you have to import your dependencies the right way.
Check providers/electron.service.ts
to see how to conditionally import
libraries when using electron / NodeJS / 3rd party libraries in renderer context
(i.e. Angular).
3rd party libraries used in electron's renderer process (like angular material)
have to be added in devDependencies
of package.json
.
They are already added in the final package during webpack's compilation phase. Otherwise, it will significantly increase the size of your final package.
Import your library in npm dependencies section (not devDependencies) with
npm install --save
.
It will be loaded by electron during the build phase and added to your final package.
Use your library by importing it in main.ts
.
Command | Description |
---|---|
npm run start |
Execute the app in the desktop and browser |
npm run ng:serve |
Execute the app in the browser |
npm run build |
Build the app. Built files are located in the /dist folder |
npm run build:dev |
Build the app for the development environment. Built files are located in the /dist folder |
npm run build:prod |
Build the app for the production environment with Angular AOT. Built files are located in the /dist folder |
npm run electron:local |
Builds your application and start electron |
npm run electron:build |
Builds your application and creates an app consumable based on your operating system |
npm run test |
Execute the unit tests |
npm run e2e |
Execute the end-to-end tests |
npm run lint |
Run the linter |
The application is optimized. Only the /dist folder and node dependencies are included in the executable.
See the open issues for a list of proposed features and known issues.
If you have any feature ideas, feel free to contribute by following these steps.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/MyAwesomeFeature
) - Commit your Changes (
git commit -m 'Added MyAwesomeFeature'
) - Push to the Branch (
git push origin feature/MyAwesomeFeature
) - Open a Pull Request