I have tried using YiiBoilerplate extension (maybe it’s quite complex, there are also other alternatives), basically they separate the directories into ‘frontend’, ‘backend’ and ‘common’. Frontend and Backend can represent separate sites and both are using common models, extensions, modules etc in the ‘common’ directory. It’s just a matter of setting the configs and some changes in the bootstrap file, and it works very well.