I've done a lot of research and before I get into this new project I wan to ask you for opinon of arhitecture I should take.
I am creating an application that is build with multiple modules that are not connected and I want to sperate them as modules. They will be developed separately. Now I want to find a best way to create this in ZF. First idea was to just change path to zf library to external resource and put every project seperate but then session and variables that needs to be common are seprate wich isnt good. What I want is single authentication point (like sign-in on google) and then have this modules (like gmail, calendar, google search etc.).
Next idea is to build subdomains and based on them do some routing: api.example.com -> api module, account.example.com -> another module etc. I found this here: Zend Framework 2 Routing subdomains to module or here Adding sub domain based routes in Zend framework .If this is the right way wich is better?
Another idea is to switch settings in bootstrap. So if request comes from api subdomain set APLICATION_PATH to api/ else to something else. But I dont think I could use same session then.
Third is to create rest auth service and then use the second way to achive this.
Any suggestions or ideas how could I achive this?