Mishka Installer - A system plugin manager and run time installer for elixir

Mishka Installer is a system plugin(event) manager and run time installer for Elixir

Imagine you are going to make an application that will have many plugins built for it in the future.
But the fact that many manipulations will be made on your source code makes it difficult to maintain the application. For example, you present a content management system for your users, and now they need to activate a section for registration and SMS; the system allows you to present your desired input/output absolutely plugin oriented to your users and makes it possible for the developers to write their required applications beyond the core source code.

This library is divided into the following main sections:

Events and Hook

In this section, you can define a series of plugins for each event, for example: after successful registration or unsuccessful purchase from “the store”, and for each event, put a set of callbacks in one module.

After completing this step, when the user wants to create his own plugin, the Macro behaviour and Hook module will call you in its action module.

This helps you have a regular and error-free system, and the library uses an almost integrated structure in all of its events.


Plugin management system theory and installation of Elixir libraries at runtime

The functionality of this library can be conceptualized as an architectural potential that is composed of two primary components, which are as follows:

  1. Event management (Plugin Hook powered by Elixir Macro)
  2. Managing removal and installation of Elixir libraries at runtime.

When a programmer uses this library for his own software development, we sought to ensure that in addition to the established capabilities, he also has access to a set of appropriate standards for software development that are based on preset behaviors that can be applied; This was our goal.

It streamlines and organizes the work of a group working on a project while also facilitating the creation of software. Error control and tree structure, which enable us to develop a system that is robust and trustworthy, are two of the guiding ideas behind the construction of this library, which has garnered attention from people all around the world.

The MishkaInstaller library can be created in various systems, and it provides fundamental capabilities such as the management of plugin states and the application of standard behaviors. These features can all be accessed by specified hooks in the library.

The installer part is in beta mode, use it carefully and some of its functionality may not work in the Elixir release.

Installing the library:


It should be noted that this library must be installed in two parts of the plugin and the software that wants to display the plugins, and due to its small dependencies, it does not cause any problems. To install, just add this library to your “mix.exs” in the “deps” function as follows:

def deps do
  [
    {:mishka_installer, "~> 0.1.0"}
  ]
end

The library has many facilities that require you to read the document completely. But for a brief look at one of the parts of this library called Hook, a LiveBook has been created

Run in Livebook


Links

Hex: mishka_installer | Hex
Documentation: Mishka installer v0.1.0 — Documentation
Changelog: Changelog for MishkaInstaller 0.1.0 — Mishka installer v0.1.0
Github: GitHub - mishka-group/mishka_installer: Mishka Installer is a system plugin manager and run time installer for elixir

1 Like

I took a look at livebook, but honestly is very hard to follow.

Do these plugins involve around a single process? If yes, than that is a very hard limitation that will most probably not be a good fit for a lot of use-cases.

1 Like

Thank you for sharing this.

  1. Can a plugin be any Elixir OTP application or it is limited to a module?
  2. Does the plug have access to other application modules and packages. For example, if it needs to talk to the database, can It access the Repo in the application without having to define its own repo.
  3. How does it work with authentication and authorization? Let’s say if it requires its own set of permission to perform certain actions in the newly installed plugin.
1 Like

Thank you @D4no0 for your time.

No there is no genserver or ETS and Mnesia directly for the places you want to call a plugin or plugins of an event.
As you can see this lib is optimized for read-only (I created document for it inside hex you can read), but has not problem for updating.

This module is a read-only in-memory storage optimized for the fastest possible read times not for write strategies.

Mnesia is used just for saving plugins when you reset the project and want to create state again for them.

Sorry for LiveBook, I just put one module inside it not whole project

This system is very expandable and customizable, and the process management strategy, except for a small part, is with the programmer herself/himself


Update

For distributed systems, I have no plane and need to research more, but you can create plugin to handle it. because it handles the compile module in runtime

1 Like

Hello @kamaroly than you for your time.

This simple library does not limit you to put authentication event you can create an event for authentication and enable in your project. but each place of the doc in hex has security consideration.

In installer part which is beta, it just do a very simple job for you. it download the hex plugin which is mix not rebar. and build in diffrent directory and build it. after these task it move all files

ِYour plugin has own project and isolate you can do what ever you want. is it very simple macro and functions to clear your requirement.
I will create a video and add to this post

Changelog for MishkaInstaller 0.1.1

In this version, tests were conducted for Elixir 1.17.2, and the installed packages were updated. The most significant change is the addition of the guarded_struct library, which was recently separated from the mishka_developer_tools library.

Global

  • Add guarded_struct dep
  • Update all deps and test for Elixir 1.17.2

Improvement:

  • Add callbacks and behaviour to Hook macro Link

Links

Hex: mishka_installer | Hex
Documentation: Mishka installer v0.1.1 — Documentation
Changelog: mishka_installer/CHANGELOG.md at master · mishka-group/mishka_installer · GitHub
Github: GitHub - mishka-group/mishka_installer: Mishka Installer is a system plugin manager and run time installer for elixir