Yii2-app is Fast and Ready-to-production advanced project template.
Dockerized, for development (mysql, nginx, php-fpm)
Please, enable php intl extension for better work.
Default, the template includes three tiers: frontend
, backend
, and console
, each of which is a separate Yii application.
NOTE: Template is in initial development. Anything may change at any time.
adminus
, password adminus
)dektrium/yii2-user
)queue
), but you can use Redis-queue or other yii2-queue docs/queuemanager/default/index
) using ignatenkovnikita/yii2-queuemanager/log/index
) - simply view log messagesfrontend/config/urls.php
, hostInfo in common/config/params.php
)common/messages
with config (current only English and Russian, language translation are welcome!)common/models/EmailForm
Model), optionally send message to Viber messenger via bot
(install requirements Bogdaan/viber-bot-php and config, uncomment code in Model)These modules can be easy installed to Yii2-App using Composer:
Yii2-app template can be installed using composer. Run following command to download and install Yii2-app:
composer create-project --prefer-dist akiraz2/yii2-app my-site
After installation run init
Install yii2-app using Docker:
docker run --rm --interactive --tty \
--volume $PWD:/app \
--volume ${COMPOSER_HOME:-$HOME/.composer}:/tmp \
composer create-project --prefer-dist akiraz2/yii2-app my-site
.env-dist
to .env
, configure if needed. You can change DB from mysql to postgresql - just change docker-compose.yml (and common/config/main-local.php after init)/mysql/docker-entrypoint-initdb.d/createdb.sql.example
to createdb.sql
if you have ready DB (so dont run migrations)docker-compose build
(you can configure Docker PHP in /php/Dockerfile-debian before building, for example, add mongodb)docker-compose up -d
docker-compose exec php bash
, in terminal run composer install
, then php init
, then run other migrations (see next)Access to Console App: docker-compose exec php bash
and php yii mycommand/action
NOTE: Make sure that you have properly configured
db
application component and run the following command
php yii migrate/up --migrationPath=@vendor/dektrium/yii2-user/migrations
php yii migrate --migrationPath=@yii/log/migrations/
php yii migrate --migrationPath=vendor/ignatenkovnikita/yii2-queuemanager/migrations/
php yii migrate/up
login: adminus
password: adminus
For newbies, I will recommend reading these instructions yiisoft/yii2-app-advanced/start-installation.md (apache, nginx, etc\hosts
Change in common/config/main.php
'language' => 'ru-RU',
'sourceLanguage' => 'en-US',
Add your language in common/messages/config.php
'languages' => [
'ru-RU',
],
In shell
php yii message/extract common/messages/config.php
If you have any questions or problems with Yii2-App you can ask them directly
by using following email address: akiraz@bk.ru
.
If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome. +PSR-2 style coding.
I can apply patch, PR in 2-3 days! If not, please write me akiraz@bk.ru
Yii2-App is released under the BSD License. See the bundled https://github.com/akiraz2/yii2-app/blob/master/LICENSE.md for details.
Comments