Flo
Flo

Reputation: 253

Vaadin WebApplication - Offline Mode possible?

So here's the situation: I recently took over responsibility for a Vaadin8 WebApplication from a former colleague who left the company, meaning I will now be responsible for maintenance and also for developing any enhancements the customer may want to have. The application basically displays a form in which the user can enter his / her personal data which, upon clicking "Submit", will be sent back to the application server which then stores the data in a backend database.

Since the customer is planning on using this application in environments were WiFi connectivity may be very bad / unreliable (e.g. large fairs with thousands of people accessing the WiFi simultaneously) they have requested me to come up with a way the application could be used offline. This means that the appliaction should be available with or without internet connection, and the data should be stored locally until a connection is reestablished.

Now, as far as I understand Vaadin (I am by no means a Vaadin expert, last time I briefly touched Vaadin was 2 years ago), offline operation is not really what Vaadin is meant to do, not leastly because of its server-side architecture.

My question, therefore, would be if there is any good way to achieve the mentioned requirements.

While googling around a bit, I came across Vaadin Touchkit, which more or less seems to do what I want. However, to me (haven't worked with it before) it looks like it's a technology that is pretty deeply integrated into the application, making it difficult for me to get an estimation on the effort it would take to "convert" the existing app to a "touchkit-app".

Any help and / or suggestions on what technologies to look at would be greatly appreciated.

Upvotes: 3

Views: 1227

Answers (1)

Tatu Lund
Tatu Lund

Reputation: 10643

Now, as far as I understand Vaadin (I am by no means a Vaadin expert, last time I briefly touched Vaadin was 2 years ago), offline operation is not really what Vaadin is meant to do, not leastly because of its server-side architecture.

Yes, vanilla Vaadin with Java is stateful architecture, hence offline operation is not supported out of the box.

While googling around a bit, I came across Vaadin Touchkit, which more or less seems to do what I want.

Yes, Touchkit 5 with Vaadin 8 is meant for creating mobile applications. Note, if you have target to create one application that scales between desktop and mobile, including offline support, Touchkit is not very well suited to that purpose. Touchkit it works ok when you want to create two Vaadin UI applications, one for desktop and one for mobile. Those can share some common business logic and backend logic.

Any help and / or suggestions on what technologies to look at would be greatly appreciated.

Our newest version of framework Vaadin 14 is based on different client side tech stack. It does not yet have support for complex offline mode logic. It however have support for simple offline page, which can be customized.

Documentation is here: https://vaadin.com/docs/v13/flow/pwa/tutorial-pwa-offline.html

There is another discussion see how you can try to customize it: PWA offline mode not loading from cache on mobile browsers

Vaadin 15+ onwards there has been possibility to create views also using TypeScript. One of the primary use cases for this is to be able to create views that are stateless by nature and are easier to support offline as well. There is a chapter about creating offline views in Vaadin's documentation.

Upvotes: 4

Related Questions