Skyii (pronounced as Sky) is a pre-configured Yii2 Advanced Template with a lot of features out of the box.
The default Yii2 Advanced Template does not provide all the necessary and development and production ready configurations. We have to put some efforts to get it ready.
Why would you do that? Why waste your time setting up everything from environments to pretty URL and API structure, if you can get it already done for you?
To minimize these efforts and make your development experience easy and painless, we created Skyii. It includes all the necessary configurations out of the box.
If you have any suggestions or complaints, feel free to open an issue here.
- Pretty URLs enabled for frontend, backend, API and modules.
- Configurations managed according to 'dev' and 'prod' environment.
- Backend can be accessed by /admin.
- Gii is enabled for frontend and backend in 'dev' environment.
- Debug bar is enabled for frontend and backend in 'dev' environment.
- RESTful API structure and API versioning is configured.
- JSON formatter for API response is enabled out of the box.
- User module with ready to use RBAC (Role Based Access Control).
All above features can save hours of work and frustration.
The minimum requirement by this project template is that your Web server supports PHP 5.4.0.
You can install this template with below command in your terminal:
git clone https://github.com/foqat/yati.git
Extract the archive file downloaded from this repository to your Web root.
Then follow the instructions given below.
After you have downloaded or ran git clone, you have to follow below steps to initialize the installed application.
-
Explore the environments directory and change your desired configuration files according to environment. For example if you are starting development then set configurations in the files given in
environment/dev
directory. -
Yii2 provides full control over application configurations. If you wish to apply a configuration globally on backend and frontend then you have to put it in common configurations and if you wish to manage different configurations for backend and frontend then you can set them separately in respective configurations.
-
Execute the
init
command and selectdev
as environment.php /path/to/yii-application/init
Otherwise, in production execute
init
in non-interactive mode.php /path/to/yii-application/init --env=Production --overwrite=All
-
To connect your application to a database, change the configurations of
db
component inenvironments/dev/common/config/main-local.php
accordingly. -
Apply migrations with console command
yii migrate
. -
If your project is installed in a root directory then remove /yati from
enviroments/dev/.htaccess
. If it is in a subfolder then replace /yati with your folder name. -
Set a cookie validation key in frontend and backend main-local.php. If it is already set then make sure to change it.
-
For Server configurations please see server_configurations.md
-
For List of commonly used and recommended plugins in Yii2, please see list of plugins
-
Finally update your composer.
php composer update
You are Done!
To login into the application, you need to first sign up, with any of your email address, username and password. Then, you can login into the application with same username and password at any time.
The following table compares the difference among the advanced template, basic template and YATI:
Feature | Basic | Advanced | YATI |
---|---|---|---|
Project structure | ✓ | ✓ | ✓ |
Site controller | ✓ | ✓ | ✓ |
User login/logout | ✓ | ✓ | ✓ |
Forms | ✓ | ✓ | ✓ |
DB connection | ✓ | ✓ | ✓ |
Console command | ✓ | ✓ | ✓ |
Asset bundle | ✓ | ✓ | ✓ |
Codeception tests | ✓ | ✓ | ✓ |
Twitter Bootstrap | ✓ | ✓ | ✓ |
Front-end and back-end apps | ✓ | ✓ | |
Ready to use User model | ✓ | ✓ | |
User signup and password restore | ✓ | ✓ | |
Pretty Url | ✓ | ||
REST API | ✓ | ||
API versioning ready | ✓ | ||
XML or JSON response formatting | ✓ | ||
Custom error handling | ✓ | ||
User module with RBAC | ✓ |
master - Always use this branch for your work.
dev-master - Should not be used as it may have broken changes
Pankaj Sanam
Rajat Jain
-
My Composer Update is not working.
Make sure to run this in your terminal- composer global require "fxp/composer-asset-plugin:^1.3.1"
-
I am still having issue with setting it up.
Feel free to contact me or open an issue here.