A pyrig plugin to build web applications.
pyrig-webapp is a pyrig plugin that scaffolds a Reflex web application and packages it with a Caddy reverse proxy for local or production use.
In addition to pyrig's requirements, you will also need the requirements for
pyrig-containers.
For local composing port forwarding from ports 80/443 to 8080/8443 is required,
you may use the forward-ports.sh script to set it up.
You may need to trust Caddy's local certificate authority in your browser or
operating system for local HTTPS to work without warnings.
- Reflex application — a starter app module and
rxconfig.pyare generated for the project. The default page displays “Hello, World!” and can be customized in the generated app module. - Framework tooling — Reflex is added as a runtime dependency, its generated files are ignored by version control, and pyrig compiles the app after project synchronization and in a pre-push hook.
- Caddy configuration — a
caddy/Caddyfilereverse-proxies requests to the Reflex application.SITE_ADDRESSconfigures the site address; it defaults tolocalhost. - Container configuration — the container and Compose configuration runs the app alongside Caddy, with health checks, persistent Caddy data, and HTTP, HTTPS, and HTTP/3 ports published on higher host ports 8080 and 8443. to GHCR on release.
- Port forwarding —
forward-ports.shsets up permanent forwarding from ports 80/443 to the Compose-published ports 8080/8443.
uv add pyrig-webapp --dev
uv run pyrig sync
sudo bash forward-ports.shAfter synchronization, edit the generated app module to build your application. Start the application and proxy together from the project root:
bash compose-up.sh build
# or to use the published image
bash compose-up.sh pullFull documentation is available on the documentation site.