I'm currently working on a labor management project where one of the key requirements is to ensure that certain features (like clocking out) are accessible even when the user's device is temporarily offline. While this is a rare case, I want to future-proof the application by enabling additional offline functionality as needed.
Spring Boot with Thymeleaf and HTMX:My preferred stack. I like to build using TDD, and this combination aligns well with my experience. I already built a little demo project using a service-worker.js to cache and resent POST requests. I'm not sure if this is the best choice to continue adding offline functionality in the future.
Vaadin Flow:I'm intrigued by Vaadin Flow for its strong focus on building business applications entirely in Java. However, I'm concerned about its ability to support offline functionality since it dynamically updates views. From what I understand, this would make it impossible to just cache an entire page for offline viewing. I'm aware of Hilla, but then I would need create all of the views in Typescript and that sort of defeats the purpose of using Vaadin, in my opinion.
PWA Starter:I looked into PWA Starter, but it seems to focus on creating single-page apps (SPAs) in languages like Angular or React, which doesn't fit my preference for staying within the Spring Boot ecosystem.
Quarkus or JHipster:I also considered Quarkus and JHipster, but JHipster typically uses Angular or Vue for the frontend, it seems, which I'm not very interested in. I'm looking for something that stays closer to a Java full-stack approach. Quarkus seems like it focuses on micro-services?
I'm looking for advice on how to approach this, considering my preference to stay within the Java ecosystem and avoid adding significant new front-end technologies. I'm sure there are many questions I have not considered. Any insights or recommendations would be greatly appreciated!
The above is the detailed content of How to Build a PWA with Java and Spring Boot: Best Practices for Offline Functionality?. For more information, please follow other related articles on the PHP Chinese website!