Need advice to implement custom extension and template installation in an elixir CMS

Hello folks,
Before explaining the main problems, I have to provide more info about my project. I have been working on an elixir and phoenix CMS, which Phoenix LiveView powers for more than ten months.
When I decided to develop MishkaCMS, I had a good experience with WordPress, especially Joomla. So I searched in elixir, and I did not find a CMS like them, even the better things.
After 11 months, I have been developing this project and preparing tools to create a good site and API; now, I am forced to make a space that gives the developers a custom installation.
Custom installation is essential for the CMS project because it helps developers make everything they want and add them to my CMS without any change in the core of the CMS project. It is compatible with elixir 1.13.



Main problems

As I expected, it should be hard because elixir is a compiler language, so I can’t move some files like PHP to the places I want and tell CMS, which is forced to load my template instead of the default one.
To reduce the impact of these problems on my project, I decided to improve my code and make them more modular. So I created some LiveView components and macros, which are easy to understand for a new programmer or even front developers that they just need to call a simple line with their custom template.

For installation custom template

  1. I reduced all default templates to one or three LiveView components, which are easy for developers to edit or replace these components in their custom templates.

But is there no way to install a custom template and activate it when the CMS project is online?
They are forced to create a hex plug and put their template files in my CMS structure. They should create them based on my CMS.
It depends on stopping server and run mix deps.get and after installation, CMS manager should select a template installed and makes it default. Now I have to find a way to store template module name that I think the best place for storing it is on Mnesia or Genserver state.

Result – 1: In the ways I gave as an example, a manager can install a custom template when he stops his/her server.

Result – 1: We have to store the name of the custom template module in a Genserver or Mnesia state, and my CMS should check it, if there is a template available then loads the template file instead of default CMS template of not just loads as before.

Do you have a suggestion?



For installation custom extension

A custom extension has the same problem as a custom template, but it has more issues than I have no idea.
In fact, the extension is an independent project, then it has its router and router is located in a hex plug which as a CMS, I do not know how can load a custom extension router, and I don’t see how many extensions I have in my project.
I think I can check mix. exs file and check all deps installed and find each deps has _mishka, but I still need to call their router in the main router.

By the way, I created MishkaCms with DDD pattern and each project has an elixir folder.

Result – 1: again we have to stop the server and run mix deps.get and the router problem I said

Do you have a suggestion?


At the end

I have read about JIT, but I don’t know if it is available in elixir 1.13 or not, and it can help me not to stop server when I want to add new hex plug in mix.exs

Unfortunately, I still have not created English documents for my project; after fixing the problems above and implementing RTL/LTR feature.
I prepare the documents as soon as possible and introduce my project in a separate post.
My project could be an excellent choice to create a blog with Elixir and Phoenix. It has many API endpoints to make an application, and my work on the iOS app is an opportunity. It has been created by LiveView and your users will have a good experience to work with your blog.
It is my honor you join me in this project.

4 Likes