2017 © Pedro Peláez
 

library zf3-apigilty-oauth2

Start API Development using ZF3, Apigility with OAuth2 support

image

aqilix/zf3-apigilty-oauth2

Start API Development using ZF3, Apigility with OAuth2 support

  • Thursday, March 8, 2018
  • by dollyaswin
  • Repository
  • 8 Watchers
  • 8 Stars
  • 104 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 16 Forks
  • 0 Open issues
  • 14 Versions
  • 6 % Grown

The README.md

API Development using ZF3, Apigility with OAuth2 support

Requirements

Please see the composer.json file., (*1)

Installation

Via Composer (create-project)

You can use the create-project command from Composer to create the project in one go (you need to install composer):, (*2)

$ curl -s https://getcomposer.org/installer | php -- --filename=composer
$ ./composer create-project -sdev aqilix/zf3-apigilty-oauth2 path/to/install

Via Git (clone)

First, clone the repository:, (*3)

# git clone https://github.com/aqilix/zf3-apigilty-oauth2.git # optionally, specify the directory in which to clone
$ cd path/to/install

I have prepare docker-compose.yml, so you can use docker-compose to build this application., (*4)

docker-compose up -d

Install dependencies via the container:, (*5)

docker-compose run api composer install

Manipulate dev mode from the container:, (*6)

docker-compose run api composer development-enable
docker-compose run api composer development-status

Creating Database, (*7)

docker-compose run api composer development-db-create

Importing Data Fixtures, (*8)

docker-compose run api composer development-db-data-fixture-import

Or if you don't want to use Docker, you need to use Composer to install dependencies. Assuming you already have Composer:, (*9)

$ ./composer install

Configuration

There are several configuration files in config/autoload/*.local.php.dist need to be configured to use this application. And please remove .dist extension on the files. Example:, (*10)

mv config/autoload/local.php.dist config/autoload/local.php

Database Configuration

For database configuration, the related files need to be configured are:, (*11)

Email Transport Configuration

To configure mail transport, please modify this file mailtransport.local.php.dist. For this example, I use Mailgun you can use another mail service by configure host, username and password., (*12)

Email Configuration

At the moment, there are 3 events send emails from this application., (*13)

  • Signup (Welcome Email)
  • Account Activated
  • Request Reset Password

You can configure the From, Sender Name, and Subject from this file user.local.php.dist, (*14)

Project Configuration

For project configuration, there are 2 sections configuration. Those are sites and php_process. I think you just need to configure sites section to adjust with url on your site. And php_process is purposed to configure cli., (*15)

CORS Configuration

You can configure zfr-cors on this file zfr_cors.local.php.dist, (*16)

Run Application

After configure all configs, you can access this application from browser http://localhost:8080 (I configure this container using port 8080)., (*17)

If you have set this as dev mode you will see Apigility Admin on this url http://localhost:8080/apigility/ui#/, (*18)

API Testing

I use Swagger for built in API Documentation. You can see it on dev mode by access this URL http://localhost:8080/apigility/swagger. You also can try the API Resources by using this Swagger, (*19)

The Versions