0
votes

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?

1

1 Answers

-1
votes

Sei ying there is no special move that is best, it all depends, any move could be best, its up to you when the times right, to move correctly, accurately and with great speed...

To sum it up: you have to choose which methods are best for your use case.

Developing separate Modules doesn't mean they won't share the same session once put into one application. There are already dozen of Authentication Modules out there that are able to connect to authenticate against google, too.

If you develop said modules: "Login", "Calendar", "Gmail" and then you put them all into your "MySuperApplication"-Application, then those will share the same browser-session. You'd however make sure that each of those has the proper interfaces to talk to each other.

It's really difficult to answer your question as it appears that you do not really understand the basics of how ZF2 works, therefore my only suggestion can be to start developing and come up with real questions ;)