This project is an experiment to use bazel
to build a web application and create deployment artifacts.
It uses rules_closure, rules_boost and rules_python to build the following features:
-
The Javascript is compressed and minified using the Advanced Compilation mode of Google Closure Compiler.
-
UI components are pulled from Google Closure Library
-
The CSS is minified, and the class names are renamed to shorten them
-
Soy templates are used to render the (single page) app.
-
A dummy 'server' application in C++ is built against the Boost Beast Http library.
-
A static PDF is generated from HTML5 input at build time using weasyprint.
In development mode, the local site is served up using php in 'serve the local directory' mode. It can be run with:
bazel run //web_app:run-httpd
Alternatively, it can be served with Boost Beast using:
bazel run //server:server firefox http://localhost:8080/web_app/index.php
The unit tests can be run with:
bazel test //...
For production, a debian package is created containing the built artefacts.
bazel build //web_app:bazeltest dpkg-deb -c bazel-bin/web_app/bazeltest.deb