Yii And Angular Seed/ Integration

Hello Yiiers,

First of all keep up the good work guys.

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 wondering why architecture is like this? https://github.com/drumaddict/angular-yii

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…

also in this seed https://github.com/drumaddict/angular-yii it has written we need to install node? why is that? just for the testing purpose?

any one?

I have checked out the code on angular-yii, and found that they way they get yii to load first, is to modify the Controller.php

class Controller extends CController


  public $layout = 'webroot.app.index';


This forces the angular app to load.

This is cool because now you have Yii loading first, then your angular app!