Little plugin system for the backend


#1

I am currently thinking about what is the best way to implement a simple plugin system.
I want to create additional features for my app, which are living in a private git repo / npm registry.

If you install a plugin Adonis should npm install this in the background, automatically add necessary service providers and run migration commands etc.

Do you have any tips on how to archive this?
Would i start with node’s child-processes?

And i didn’t found any tutorials on how to create additional packages for AdonisJs, does anybody know such a tutorial?


#2

Is there no way to write additional AdonisJs packages like within laravel for example? With migrations etc.?


#3

Have you looked at the service providers documentation? That includes a basic example of creating a package.

This repo is worth looking at, https://github.com/adonisjs/adonis-sink

And this: https://github.com/adonisjs/adonis-addon

This page also talks about why it’s good to install packages with adonis install: https://adonisjs.com/recipes/4.1/why-adonis-install

tl;dr – you can use the instructions.js file to populate config files, and migrations and so forth.