What should be my front facing server, Vue or Phoenix?

With decoupled I was thinking of using Phoenix as a pure API, with no Vue in it whatsoever. This way the backend and the frontend don’t need to know anything about each other’s implementation details, and they can be in different repos. All that connects them is some communication protocol, usually REST.

The advantage of this is the decoupling. You can now make changes in either the frontend or the backend, and as long as you don’t change the communication interface – the API – the other part of your application is not affected.

If you want to do this I suggest you start by builiding a pure API Phoenix app that only serves JSON over rest, no HTML. You do the routing in Vue. All you need is a Phoenix API backend and something like Nuxt.js to give you SSR.

1 Like