I'm playing around with an architecture for a new suite of products using phx 1.3 and umbrella apps.
I have an existing Phoenix based enterprise class WebRTC soft phone (many keys, a display, multiple input and output audio device selection, and more). I have developed a Slack clone messaging app prototype with Phoenix. Both applications are fairly large I need to integrate the phone with the chat app into one front end that may be either just the phone, just the chat client, and both. I will need to add a lot of new features to the chat client moving forward I also want the architecture to support using the same client to provision additional setting on the call server (user based) and potentially a large number of admin level settings. I may also be adding other applications in the future like an operator panel, log viewer, and the list goes on... The client side JS is pretty simple, no front end framework. I render templates server side and push the html out over channels.
I would like to build this pluggable. Same endpoint and database. One common UX.
I think there will be two common apps in the umbrella, one for the Phoenix endpoint and a couple controllers and another for the main Repo and a couple schemas. I'm trying to figure out how difficult it will be to use two or more additional apps for each application. One for context and schema, another for controllers, views, templates, and brunch resource. Possibly another for 3rd party APIs.
To make this work, I'll need a dynamic dispatch for routers in each of the apps. A method for handling migrations contained in each of the apps, and probably more that I have not thought of yet.
As anyone tried this? Are there any open source projects with a similar structure?
mount
approach. I had this issue in the past. Did not think of your approach. However, I tried a quick spike with this ` Application.get_env(:app, :routers) |> Enum.map(&(forward "/", &1))`. I put that at the end of my main router and it seems to work. Can you think of any issues with that approach? – Tsuda