Hello!
I have been searching the web for some resources on this topic but have fallen short. I am in the process of creating a web and mobile application that will utilize Phoenix Channels for realtime communication. After some prototyping, I have decided that rather than use LiveView, I will use Phoenix Channels to handle realtime connections and build out the application in React.
In the best case scenario, I’d like to use something like Next.js or Remix for my web application. The added benefit for me is that it can handle both static and dynamic web pages.
My thinking was that I could use Next.js as both a CRUD API for various actions on the site and use it as a reverse proxy to Phoenix for any realtime communication.
My concern is that doing this will take away some benefits of talking to Phoenix directly as I would have to do an additional network hop. Also, I’m not sure that Next.js supports proxying websocket requests, so that might not even be an option.
Does anyone know what the right approach here would be? I found this article that sort of summarizes my approach but I don’t know if there are other ways of going about this.