Module management

I’m developing an erp, and would like to make a system the user install modules (products, for example) that can contain dependencies. Each module is a folder containing the client and server files. What is the best way to do this?

I wouldn’t do it from the source code level. I will build an app with all those feature then user can enable/disable the features. I will use dynamic import.