Yii 2 Advanced Application Template is a skeleton Yii 2 application best for developing complex Web applications with multiple tiers.
The template includes three tiers: front end, back end, and console, each of which is a separate Yii application.
The template is designed to work in a team development environment. It supports deploying the application in different environments.
common
config/ contains shared configurations
mail/ contains view files for e-mails
models/ contains model classes used in both backend and frontend
console
config/ contains console configurations
controllers/ contains console controllers (commands)
migrations/ contains database migrations
models/ contains console-specific model classes
runtime/ contains files generated during runtime
backend
assets/ contains application assets such as JavaScript and CSS
config/ contains backend configurations
controllers/ contains Web controller classes
models/ contains backend-specific model classes
runtime/ contains files generated during runtime
views/ contains view files for the Web application
web/ contains the entry script and Web resources
api
assets/ contains application assets such as JavaScript and CSS
config/ contains backend configurations
controllers/ contains Web controller classes
models/ contains backend-specific model classes
runtime/ contains files generated during runtime
views/ contains view files for the Web application
web/ contains the entry script and Web resources
frontend
node_modules contains dependent 3rd-party node modules
bower_components contains dependent 3rd-party bower components
test contains test files
app contains frontend application
node
node_modules contains dependent 3rd-party node modules
vendor/ contains dependent 3rd-party packages
environments/ contains environment-based overrides
tests contains various tests for the advanced application
codeception/ contains tests developed with Codeception PHP Testing Framework
The minimum requirement by this application template that your Web server supports PHP 5.4.0.
If you do not have Composer, you may install it by following the instructions at getcomposer.org.
If you do not have NodeJS, you may install it by following the instructions at wiki.
If you do not have npm, you may install it by following the instructions at docs.npmjs.com.
If you do not have bower, you may install it by following the instructions at bower.io.
After you install the application, you have to conduct the following steps to initialize the installed application. You only need to do these once for all.
- Run command
init
to initialize the application with a specific environment. - Install elasticsearch 1.4.4 on server
- Composer update
- Run command from
/path/to/yii-application/frontend/
pathnpm install
bower install
- Run command from
/path/to/yii-application/node/
pathnpm install
- Run command from
/path/to/yii-application/frontend/
pathgrunt serve
- Run command from
/path/to/yii-application/api/
pathphp -S localhost:8092
- Set document roots of your Web server:
- for frontend
/path/to/yii-application/frontend/
and using the URLhttp://localhost:8081/
- for backend
/path/to/yii-application/node/
and using the URLhttp://localhost:8080/
- for api
/path/to/yii-application/api/web/
and using the URLhttp://localhost:8092/