I honestly don’t know why you think there is an architectural benefit in creating HTML with JS in the browser vs. using whatever programming language you fancy to do so on the server. You can use the same layering, just skip the unnecessary remote API