From Laravel to Phoenix - umbrella applications as "plugins"

Hi, everyone!

I have an application written in PHP + Laravel that uses this solution for its plugin system. So far so good but, for many many reasons, I’m looking for a replacement for my current stack and of course I’m considering Elixir :slight_smile:

The requirementes for this plugin system are:

  1. Enable/disable plugins - in the perfect world this could be done at runtime, but this is not mandatory since this can involve route registering and asset compilation;
  2. Run database migrations for each plugin individually
  3. Each plugin should have its own dependencies
  4. Use resources from the application core
  5. Define common interfaces in core - this can be used by plugins to extend the core features (like a custom authentication method or a new CMS driver that publishes in a WordPress blog instead of the platform etc.).
  6. Hostspots all over the templates so plugins can add their stuff for the user

So far I imagined the following possibilities using an umbrella app approach, respectively:

  1. Use the config files to choose which application can be started, even though this is done at compile time. Maybe should I write a bootstrap service that reads the configuration to boot the selected apps at runtime?
  2. Solved by umbrella project.
  3. Solved by umbrella project.
  4. Maybe a few GenServer processes could solve this one? Mostly the “core” app would only be used to register and look for these services (authentication, authorization, content publication, event creation etc.)
  5. Behaviours + Registry or ETS + the stuff from item 4 comes to my mind here.
  6. This is the tricky part. Now I have a “base” layout rendered in the server where the plugins can write their stuff, this works fine because everything is rendered in the server - with the exception of some dynamic pieces of the page - and the core and plugins are just a very big monolith. Using a (micro/nano) service approach, how could I implement Hotspots in my templates? Maybe this is a good reason to render the pages in the client side?

I’m already working in a proptotype but any suggestions and ideas are welcomed!

Thanks!

2 Likes