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
The requirementes for this plugin system are:
- 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;
- Run database migrations for each plugin individually
- Each plugin should have its own dependencies
- Use resources from the application core
- 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.).
- 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:
- 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?
- Solved by umbrella project.
- Solved by umbrella project.
- 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.)
- Behaviours + Registry or ETS + the stuff from item 4 comes to my mind here.
- 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!