Build Electron desktop app using Angular, NodeJs


#1

Hi,

We have to develop a offline Desktop application using electron for Windows and mac. We are in progress. Angular 6 is used for all User experience and nodeJs is used for all DB communication. We are using sqlite as a database. For nodeJs we have used express framework and it uses dedicated Port number.

Here are our queries

  1. Is it good to use express framework for desktop apps?
  2. Is there a way we can call nodeJs fucntions from angular without starting the node server in electron?
  3. If we try electron with following commands it works.
    “start”: “npm run postinstall:electron && npm-run-all -p ng:serve electron:serve”,
    But when we try to electron-builder for windows we are getting following error.

• SyntaxError: Unexpected token < in JSON at position 1556
SyntaxError: Unexpected token < in JSON at position 1556
at JSON.parse ()
at then.it (C:\Quiz_Engine\WK-DESKTOP-ENGINE\WK-OFFLINE-ENGINE-USMLE\node_modules\app-builder-lib\src\fileTransformer.ts:35:6)
at tryCatcher (C:\Quiz_Engine\WK-DESKTOP-ENGINE\WK-OFFLINE-ENGINE-USMLE\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (C:\Quiz_Engine\WK-DESKTOP-ENGINE\WK-OFFLINE-ENGINE-USMLE\node_modules\bluebird\js\release\promise.js:512:31)
at Promise._settlePromise (C:\Quiz_Engine\WK-DESKTOP-ENGINE\WK-OFFLINE-ENGINE-USMLE\node_modules\bluebird\js\release\promise.js:569:18)
at Promise._settlePromise0 (C:\Quiz_Engine\WK-DESKTOP-ENGINE\WK-OFFLINE-ENGINE-USMLE\node_modules\bluebird\js\release\promise.js:614:10)
at Promise._settlePromises (C:\Quiz_Engine\WK-DESKTOP-ENGINE\WK-OFFLINE-ENGINE-USMLE\node_modules\bluebird\js\release\promise.js:693:18)
at Promise._fulfill (C:\Quiz_Engine\WK-DESKTOP-ENGINE\WK-OFFLINE-ENGINE-USMLE\node_modules\bluebird\js\release\promise.js:638:18)
at C:\Quiz_Engine\WK-DESKTOP-ENGINE\WK-OFFLINE-ENGINE-USMLE\node_modules\bluebird\js\release\nodeback.js:42:21
at C:\Quiz_Engine\WK-DESKTOP-ENGINE\WK-OFFLINE-ENGINE-USMLE\node_modules\graceful-fs\graceful-fs.js:78:16
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)