This is a basic example of how to use WebUI with React to generate a portable single executable program. WebUI will run the internal web server and use any installed web browser as GUI to show the React UI.
A simple Python script vfs.py is used to generate vfs.h to embed the whole react's build folder into the portable single executable program.
- Run script
build_reactto re-build the React project and compile the C file
- Run
npx create-react-app my-react-appto create a React app using NPM - Add
<script src="webui.js"></script>intopublic/index.htmlto connect UI with the backend - Run
python vfs.py "./my-react-app/build" "vfs.h"to embed the build folder - Now, use any C compiler to compile
main.cinto a portable executable program
- Coming soon...
