Should I divide the app into separate modules, for example:
I am wondering because even if I dive app into smaller modules there no chance that if I swith off for example messages that whole aplication will work, because if the first appointment is made the message is being send, and I am using there a model form messages.
I think that modules should be totaly separate, and one can work without another. Is it the convention of modules? On the other hand if I will not divide it It could be quite big module Admin and a bit messy. Offcourse there is way to achieve that, I could replicate the code so that ecah module colud work alone. But replication code? I don't think it's a good idea.
I know my question is a bit theoretical but I want learn good practice I have that question all the time in the back of my head .Should I create new module or just another controller ?
It doesnot matter how many module you have, but keep your business logic out of controller, as services/model/repositories, so that you can access it from any controller.
Generally Devs. build "admin" , "application", "front" module. But it is not limited here.
Modules are just for organising your files,code, logic so that your fellow developer can easily follow.
Create a new module if you think a lot of things is going for that and it is smething special.
For Ex:
suppose you have two module "Admin", "Application".
You can create a third module "Basic", containg logic/modal/services for both "admin", "application".
see module structure strategy on ZF page, https://docs.zendframework.com/zend-modulemanager/intro/
I think it will more helpfull to understanding you.