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.
NOTE: To make an executable for python, look into pyinstaller or similar type libraries (pathing may have to be automated in some places to differentiate runtime and built file locations)
- Run script
build_reactto re-build the React project and run the pyhton 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 - Copy or make your own vfs functions similar to how it's done in main.py
- Build the react-app portion with
npm run build; This step must be done for every change you make to the react portion of the app - Now, run
python main.pyor whatever your main entry script is.
- Coming soon...
