PS-4 Autloading custom module
I don't think you need to add any composer.json in your module folders
You have to update the project composer.json file only to let the craft know about custom module so that it can load on each boot.
Folder Structure might be like  (inside module folder at the root)




wruxmodule
└── src
    ├── controllers
    │   └── DefaultController.php
    ├── models
    │   └── WruxModuleModel.php
    ├── variables
    │   └── WruxModuleVariable.php
    └── WruxModule.php



Copy below line to config/app.php




 return [
    'modules' =&gt; [
        'wrux-module' =&gt; [
            'class' =&gt; \modules\wruxmodule\WruxModule::class,
        ],
    ],
    'bootstrap' =&gt; ['wrux-module'],
];



Now update the project composer.json file




"autoload": {
    "psr-4": {
      "modules\\wruxmodule\\": "modules/wruxmodule/src/"
    }
},



Finally run




composer dump-autoload ( at project root)