|
| 1 | +# Yii 2 Ninja Application Template |
| 2 | + |
| 3 | +Yii 2 Ninja Application Template is a skeleton Yii 2 application best for |
| 4 | +developing complex Web applications with multiple tiers. |
| 5 | + |
| 6 | +The template includes three tiers: frontend, backend and console, each of which |
| 7 | +is a separate Yii application. |
| 8 | + |
| 9 | +The template is designed to work in a team development environment. It supports |
| 10 | +deploying the application in different environments. |
| 11 | + |
| 12 | +## Installation |
| 13 | + |
| 14 | +The preferred way to install this extension is through [composer](http://getcomposer.org/download/). |
| 15 | + |
| 16 | +You can then install the application using the following command |
| 17 | + |
| 18 | +```bash |
| 19 | +$ php composer.phar global require fxp/composer-asset-plugin |
| 20 | +$ php composer.phar create-project --prefer-dist creocoder/yii2-app-ninja |
| 21 | +``` |
| 22 | + |
| 23 | +## Getting started |
| 24 | + |
| 25 | +After you install the application, you have to conduct the following steps to initialize |
| 26 | +the installed application. You only need to do these once for all. |
| 27 | + |
| 28 | +1. Run command `init` to initialize the application with a specific environment. |
| 29 | +2. Create a new database and adjust the `.env` configuration file accordingly. |
| 30 | +3. Apply migrations with console command `yii migrate`. This will create tables needed for the application to work. |
| 31 | +4. Set document roots of your Web server: |
| 32 | + |
| 33 | +- for frontend `/path/to/yii2-app-ninja/frontend/web/` and using the URL `http://frontend/` |
| 34 | +- for backend `/path/to/yii2-app-ninja/backend/web/` and using the URL `http://backend/` |
| 35 | + |
| 36 | +To login into the application, you need to first sign up, with any of your email address, username and password. |
| 37 | +Then, you can login into the application with same email address and password at any time. |
| 38 | + |
| 39 | +## Directory structure |
| 40 | + |
| 41 | +``` |
| 42 | +common |
| 43 | + config/ contains shared configurations |
| 44 | + mail/ contains view files for e-mails |
| 45 | + models/ contains model classes used in both backend and frontend |
| 46 | +console |
| 47 | + config/ contains console configurations |
| 48 | + controllers/ contains console controllers (commands) |
| 49 | + migrations/ contains database migrations |
| 50 | + models/ contains console-specific model classes |
| 51 | + runtime/ contains files generated during runtime |
| 52 | +backend |
| 53 | + assets/ contains application assets such as JavaScript and CSS |
| 54 | + config/ contains backend configurations |
| 55 | + controllers/ contains Web controller classes |
| 56 | + models/ contains backend-specific model classes |
| 57 | + runtime/ contains files generated during runtime |
| 58 | + views/ contains view files for the Web application |
| 59 | + web/ contains the entry script and Web resources |
| 60 | +frontend |
| 61 | + assets/ contains application assets such as JavaScript and CSS |
| 62 | + config/ contains frontend configurations |
| 63 | + controllers/ contains Web controller classes |
| 64 | + models/ contains frontend-specific model classes |
| 65 | + runtime/ contains files generated during runtime |
| 66 | + views/ contains view files for the Web application |
| 67 | + web/ contains the entry script and Web resources |
| 68 | + widgets/ contains frontend widgets |
| 69 | +vendor/ contains dependent 3rd-party packages |
| 70 | +environments/ contains environment configurations |
| 71 | +tests contains various tests for the advanced application |
| 72 | + codeception/ contains tests developed with Codeception PHP Testing Framework |
| 73 | +``` |
| 74 | + |
| 75 | +## Donating |
| 76 | + |
| 77 | +Support this project and [others by creocoder](https://gratipay.com/creocoder/) via [gratipay](https://gratipay.com/creocoder/). |
| 78 | + |
| 79 | +[](https://gratipay.com/creocoder/) |
0 commit comments