Skip to content

Latest commit

 

History

History

control-center

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

English | Español

PaseTec – Control Center

Electron-based app with React as frontend that connects to an Arduino using SerialPort.

Setup

You'll need Node AND Yarn installed.

# If you are using Windows
$ yarn global add windows-build-tools

$ cd pasetec/control-center
$ yarn install

File Structure

control-center/
|-- public/
|-- utils/
  |-- listeners.js
  |-- pack.js
|-- src/
  |-- actions/
  |-- components/
  |-- App.js
|-- .env
|-- main.js
  • public/: Public files of Create React App
  • actions/: Is like 'pages'
  • App.js: Create React App home
  • .env: There go the env vars. Follow .env.example to create it
  • main.js: Electron code
  • listeners.js: Electron requests to API
  • pack.js: Electron Packager config

Developing

When developing, you'll run the React server and the Electron app with the same command: $ yarn electron-dev. Also, you need a .env.test file (equal to .env, but with development variables).

Building

Disclaimer: because of the use of native modules, you can only build the app for the same OS you're using. However, you can build for both ia32 and x64. To achieve this, there are two dependencies that will rebuild the modules and other that will pack the app: Electron Rebuild and Electron Packager.

To build the app, you just run this command:

$ yarn electron-pack

If you want to build for a arch different that the one you have on your computer:

$ yarn electron-pack --arch=ARCH