In this short story I’ll show you how to deploy GWT / J2CL web apps on Microsoft Azure Static Web Apps Service. There are some advantages if you implement your web apps with Full CSR (Client Side Rendering) so that the web apps just run on your web browser and embrace the client computing power. The cost of cloud computing is one of it. In this case the cloud provider just has to deliver the static files without doing much processing on their side.
If you want to see why you should embrace the power of web browser you could take a look at my talk:
For the deployment I just create a simple GWT web app with Domino UI from DominoKit.
GitHub Repo for the demo: https://github.com/lofidewanto/gwt-azure-static-webapp
To deploy the static web apps this Quickstart Documentation helps a lot. You need to have a GitHub and Azure account to be able to deploy the web apps. Many of us owns already a GitHub account, so this shouldn’t be a problem. To get an Azure account you need to have a credit card (at least in Germany) and this is not so easy. Heroku doesn’t ask for a credit card for a free service. For a personal project Azure Static Web Apps Service should be free of charge: Azure Static Web App Plans.
After getting some helps from Bruno Borges and Anthony Chu I manage to make the GWT web app deployed. The main problem was to add Maven build step into the GitHub Actions. For this purpose I need to do following:
- Add a step to build the GWT web app with Maven
GitHub Action Workflow file for the demo: https://github.com/lofidewanto/gwt-azure-static-webapp/blob/main/.github/workflows/azure-static-web-apps-lively-pebble-036bda903.yml
The whole steps of the GitHub action can be shown as a list.
You can also take a look at the Azure Management Console to manage the deployed web app.
The result of the deployment can be directly seen at: https://lively-pebble-036bda903.azurestaticapps.net
… and here is the result!
Summary and Next Step…
The advantages using GWT / J2CL is that the web apps will run completely on the web browser and this means that the cloud provider just simply needs to deliver the files without much processing. Azure Static Web Apps Service offers such a functionality. On the same time Java developers can still work with their well known tools and frameworks thanks to GWT / J2CL transpiler.
The combination of GitHub and Azure feels very nice. Using GitHub Actions is also very straight forward. This is my first time using it, so it can’t be so hard. I’m using Visual Studio Code for Java to develop the simple GWT example and add the Azure Static Web Apps plugin to my VSC. They work pretty good together.
The next step would be to test the Azure Functions to add some server-side functionalities to the client-side GWT web app. In this case I’m curious since Azure Functions does not support Java yet?
For now: have fun running GWT / J2CL web apps on Azure Static Web Apps Service!