@intus/raspberry-server package is a FeathersJS WebSocket/HTTP server, and @intus/raspberry-frontend is a React application, which is served by the HTTP server, and communicats with it through the WebSocket server.
First the server is build to a build/ folder, then the frontend as well, which will copy the built files to the public folder of the server folder. Then, using
vercel/pkg
, the server will be packaged to a binary containing the built frontend and the configuration files used by the server.
MUST: in order for the build to work, must follow the steps from the vercel/pkg
docs, where it says:
To be able to generate executables for all supported architectures and platforms, run pkg on a Linux host with binfmt (QEMU emulation) configured and ldid installed.
So, we can install it using tonistiigi/binfmt arm64
platform and then build.
When building for staging and production, must be sure that all the values inside the config folder are correct, because they'll be used by the packaged application.
After build, must push the new build package to the intus-kiosk-app repository with key in the correct branch. Eg.: If build for staging, push to staging branch.
Then, must clone from specif branch.
- Production:
NODE_ENV=production DISPLAY_ID=<DISPLAY_ID> DISPLAY_API_TOKEN="<DISPLAY_API_TOKEN>" ./raspberry-server
- Staging:
NODE_ENV=staging DISPLAY_ID=<DISPLAY_ID> DISPLAY_API_TOKEN="<DISPLAY_API_TOKEN>" ./raspberry-server
- Development:
NODE_ENV=development DISPLAY_ID=<DISPLAY_ID> DISPLAY_API_TOKEN="<DISPLAY_API_TOKEN>" ./raspberry-server