i am planning to make a SPA(single page application) with the use of angular as a frontend and YII framework as a backend (probably i can make a rest API for the data) so everything(routing, calling, binding) will takes place at angular side and data fetching will be from YII and here is my problem, i know both framework on their respective side but i am confused how they both fit together and what will be the architecture or file structure it should have so that both works comfortable and with the security in mind.
i have seen angular yii demo app which is here https://github.com/drumaddict/angular-yii and my question is first will it send request to YII index.php? how it will load angular views then? how this both is working out of the box? i am confused. can some shed some lights on it so that i can have light bulb moment?
i am trying the architecture like below attached image
all the folders except "bi" will contain angularjs related files and "bi" folder which i am calling it business intelligence will be a backend where YII files are placed. is it right way to do it?
cause this way whenever i will make a request in the browser like youdomain.com/adminindex.php it will directly load angular app no YII loading at first request… it will only call YII for the data when any action will occur in the angular…