Our engagement
Devico's full-stack developers initiated the development of a progressive web application for Castrol that would work in fully functional offline modes. First of all, they designed a proper architecture for maintaining all data in sync with local IndexedDB on the frontend. Also, they implemented the ability to log changes and new entries in order to update the system as soon as a user reconnects online. A solution for solving merge conflicts was developed as well so that data could be uploaded to a server even before reconnecting to the net. All in all, our team undertook significant efforts to ensure the accessibility of the entire application in the offline mode.
A need to implement a client-side validation according to the same rules that were applied for the validation on the backend introduced one more challenge. To address it, we offered to use JSON Schema with the same validation applied to both the client side and the backend.

The authentication required an out-of-the-box approach as well because we had to call their API, which was not designed to work in the needed way, especially in the offline mode. So, we decided to encrypt credentials on the fly using dynamically generated RSA keys. We stored those encrypted credentials in the user JWT token, the public key stored on the backend. With each token refresh, a new pair of keys was generated. This ensured that credentials couldn't be retrieved without both parts, providing robust security.
