Download the PHP package blurrywindows/yii2-api-kit without Composer
On this page you can find all versions of the php package blurrywindows/yii2-api-kit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download blurrywindows/yii2-api-kit
More information about blurrywindows/yii2-api-kit
Files in blurrywindows/yii2-api-kit
Package yii2-api-kit
Short Description Yii 2 based kit that may be used to quickly start building an api from it.
License BSD-3-Clause
Informations about the package yii2-api-kit
Yii 2 API Kit
Heavily inspired by trntv/yii2-starter-kit, this API kit may be used to quickly start building your Yii2-based API and not waste any time on initializing your project.
This kit is in development. Please do not use it yet! Would you like to contribute?
TABLE OF CONTENTS
- Features
- Installation
- Configuration
- Testing
- Console commands
- How to contribute?
- Issues
- Read more
FEATURES
- Migrations for initial database with user-functionality
- AutoController which generates ActiveRecords models and API documentation based on apidoc
- Pre-created account functionality (register & login)
- Authentication based on HTTP-header
- Json support
- dotenv support
- Test-ready
- blurrywindows/yii2-key-helper functionality
REQUIREMENTS
- PHP >= 5.6.0
- Composer >= 1.1.2 (https://getcomposer.org/)
- Node.js >= 8.1.0 (https://nodejs.org/en/)
INSTALLATION
CONFIGURATION
Please follow these instructions carefully to quickly start building your own API. The instructions must be executed in the order in which they are presented here to prevent errors.
Composer
- Install all required Composer packages ().
- When deploying to production, only install production packages ().
Node.js
- Install all required Node.js packages ().
- When deploying to production, only install production packages ().
Database
- Create a database you will use for your API.
- Make sure that a user with read/write access exists for this database.
Environment
- Rename to in your project root and alter the variables to your current environment.
- Make sure that the variable has a trailing slash (/).
Migrate
- Migrate (let Yii create initial database tables) using the command.
- If this command doesn't work, try adding to the command: .
Webserver
- Follow the instruction in the Yii2 guide to make your API available to the internet (or to your local development environment).
TESTING
This api-kit is test-ready. The controllers and models are included in both acceptance and unit testing based on Codeception. They are located in . To execute the tests, run .
CONSOLE COMMANDS
AutoController
These actions should normally not run on a production server. The actions mentioned here generate files and data that may be used in development or testing. When executing these actions in a production environment, the controller will generate a warning prompt that you may override.
./yii auto/all
Executes all the actions in the AutoController.
./yii auto/gii-models
Generates ActiveRecords for all the tables in your database in the folder. It automatically overwrites the ActiveRecords if they exist. The ActiveRecords are named and extend . It also creates a class which extends for custom code, extra validation rules, etc. The class will not be overridden when executing the action again.
./yii auto/apidoc
Generates API documentation based on apidoc from the comments in the folder. It outputs the documentation in the Git-ignored folder . You may include this folder in Git manually if you want to export the documentation to a production server. Please note, apidoc is a dev-dependency in Node.js. It will only be installed when using the command.
HOW TO CONTRIBUTE
You may contribute in any way you want, but please contact me beforehand to prevent merge-conflicts by creating an issue.
ISSUES
If you have any questions or experience any issues with this kit, please submit an issue.
READ MORE
All versions of yii2-api-kit with dependencies
yiisoft/yii2 Version ~2.0.5
yiisoft/yii2-bootstrap Version ~2.0.0
yiisoft/yii2-swiftmailer Version ~2.0.0
vlucas/phpdotenv Version ^2.4