This project was bootstrapped with Create React App.
NOTE This project requires Node.js 10.x. Not 12 (some native dependencies do not compile).
This is best installed with nvm install 10.20.1
, because the systemd service expects the binary in /home/pi/.nvm/versions/node/v10.20.1/bin/node
.
In the project directory, you can run:
Runs an Express app with the websocket endpoint on port 80. The app also serves the React SPA from the build
directory (i.e. whatever had last been built with yarn build
). This is for "production" use.
Sets up a systemd service for the Express app. This only needs to be run once.
Restarts the systemd service.
Trails the journal of the systemd service.
Runs the SPA app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
NOTE: the SPA connects back to the websocket endpoint on port 80, so you also need to run yarn server
.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.