Skip to content

A starting point for building React and Electron application with both frontend and backend(database, fs) capabilities.

Notifications You must be signed in to change notification settings

alanzhaonys/react-electron-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Screenshot

Tutorials:

Electron and React

Customize create-react-app:


Node v14 and react-scripts-electron-by-alanzhao 4.0.4 are required.

react-scripts-electron-by-alanzhao 4.0.4 has cutomizations in config/webpack.config.js for node environment

  • Set minimize: false

  • Add target: process.env.TARGET_ELECTRON ? 'electron-renderer' : 'web', after the node: block

  • To publish react-scripts-electron-by-alanzhao to npm, checkout latest react-scripts in npm, find out the git head number, clone the react-scripts, checkout the git head and modify script, finally go to packages/react-scripts/ directory and do npm publish


How to use this project?

  • Fork and clone
  • Edit app info in package.json
  • Edit port # in package.json
  • Edit app info public/manifest.json
  • Edit title in public/index.html
  • Update src/images/logo.svg and splash screen design in public/index.html

Prerequisites

  • Run yarn install

To start development in Electron

  • Run yarn dev

To start development in browser. This is not possible if you're using modules like fs and mysql

  • Run yarn start

To build

  • Run yarn build

To test

  • Run yarn test

To generate coverage report

  • Run yarn cover

To package

  • Run yarn package

Trouble shooting If you run into build error, try following:

  • Remove yarn.lock file
  • Remove node_modules/ directory
  • Remove build/ directory
  • Run yarn build
  • Run yarn install

About

A starting point for building React and Electron application with both frontend and backend(database, fs) capabilities.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published