Can you tell me what are the best practice when you create a custom module for a project. I would say to put the custom module related to the project in app/code/MyNamespace/MyModule and all Generic Module should be in vendor. Or should I put all in vendor folder and call my modules with composer ?
I would suggest using app/code approach if your main goal to create the module is for customization. Rather than storing it directly in the vendor folder.
Magento puts all core modules in the vendor folder allowing you to create your customization in app/code without the risk of being overwritten during Magento update/upgrade.