I wonder how you would build an encrypted messenger like like Element (app.element.io) without SPA style.
I think it's not even possible, since you are required to process incoming messages client side and must not send any private keys to the server.