https://github.com/nikhilsarvaiye/starter-electron-nodejs-angular
A starter project demonstrating how to spawn an Express app from Electron, node JS best practices and angular on front
https://github.com/nikhilsarvaiye/starter-electron-nodejs-angular
angular electron email-template jwt jwt-authentication nodejs
Last synced: 3 months ago
JSON representation
A starter project demonstrating how to spawn an Express app from Electron, node JS best practices and angular on front
- Host: GitHub
- URL: https://github.com/nikhilsarvaiye/starter-electron-nodejs-angular
- Owner: nikhilsarvaiye
- License: gpl-3.0
- Created: 2017-07-27T16:52:17.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2023-03-01T10:42:10.000Z (over 3 years ago)
- Last Synced: 2025-01-17T02:14:57.534Z (over 1 year ago)
- Topics: angular, electron, email-template, jwt, jwt-authentication, nodejs
- Language: CSS
- Homepage:
- Size: 5.85 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 26
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# starter-electron-nodejs-angular
A starter project demonstrating how to spawn an Express app from Electron, node JS best practices and angular on front
Express App:
## How to run
1. Clone the code repository.
2. Open terminal to code repository.
3. Make sure a copy of `Node.exe` and `Node.lib` are copied to the root of the
code repository.
4. Run `npm install`. (See Dependencies above)
5. Change directories to the express-app folder and run `npm install`.
6. Change directories back to the root of the code repository.
7. Run `npm start` to start the application.
## Package with Electron-Packager
If you would like to package this using `electron-packager` you'll need to
make the following change:
In index.html (line ~65):
```javascript
app = require('electron').remote.app,
node = spawn(".\\node.exe", ["./express-app/bin/www"], { cwd: app.getAppPath() })
```
This makes sure the path to our local copy of `node.exe` is correct when we run
electron to start the app.
That said, I'm assuming the platform is Windows. If other platforms are desirable
additional changes are required.
## Running on Linux
Download standalone distribution of Node:
[https://nodejs.org/dist/latest-v7.x/node-v7.10.0-linux-x64.tar.gz](https://nodejs.org/dist/latest-v7.x/node-v7.10.0-linux-x64.tar.gz)
Unpack it into the root of the cloned repository. Then create a symbolic link called 'node' at the same location.
```
ln -sf node-v7.10.0-linux-x64/bin/node node
```
Here is a screenshot of what it should look like:

Change line 65 in index.html to the following:
```javascript
node = spawn("./node", ["./express-app/bin/www"], { cwd: process.cwd() })
```
Then you can run it like this:
```
./node start-electron.js &
```
Or edit the scripts section in 'package.json' and change it to:
```json
"scripts": {
"start": "./node start-electron.js"
},
```
Then run
```
npm start
```