How do I manage custom modules?
The contributed modules are in web/sites/all/modules/contrib/.

So, the suggested directory for the custom modules is web/sites/all/modules/custom/.

The other way to manage custom modules is to separate repository for the custom modules.

You can add your custom repositories to your composer.json in project root directory. Composer will look in all your repositories to find the packages your project requires. See Use PHP composer to clone git repo. Add your repositories under default Drupal.

After you add your repository to composer.json you have to tell Composer to install your custom modules to web/sites/all/modules/custom/. Add this line to installer-paths

"web/sites/all/modules/custom/{$name}/": ["type:drupal-custom-module"],


When you create your custom module, you must set type of your custom module in composer.json  to drupal-custom-module.