Skip to content

nishant/stock-desktop

Repository files navigation

Maintained Make a pull request License

Linux Build MacOS Build Windows Build


Logo Logo

Yahoo Finance Desktop Client

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

Introduction

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.


Getting Started

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

Building for Development

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.


Running in Browser Mode

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.


Using Electron / NodeJS Libraries

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).


Using Third Party Libraries (Material, Bootstrap, etc)

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.


Using Specific Libraries in Electron Main Thread (rxjs, ngrx, etc)

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.


Included Commands

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.


Roadmap

See the open issues for a list of proposed features and known issues.


Contributing

If you have any feature ideas, feel free to contribute by following these steps.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/MyAwesomeFeature)
  3. Commit your Changes (git commit -m 'Added MyAwesomeFeature')
  4. Push to the Branch (git push origin feature/MyAwesomeFeature)
  5. Open a Pull Request



About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published