Laravel Passsport – Oauth2

Laravel makes API authentication a breeze using Laravel Passport, which provides a full OAuth2 server implementation for your Laravel application in a matter of minutes. Passport is built on top of the League OAuth2 server that is maintained by Andy Millington and Simon Hamp.

Continuous Integration and Continuous Development

Fast development and Integration according to David Raleche – Process

 

 

 

QA

  • Introducing new bugs after making a change (No proper regression test)
  • Increase Automation overall
  • Lack of transparency
  • Improve quality and testability
  • No Proper Api documentation (Swagger)

Developers

  • Duplicate code throughout the program
  • Reading or writing code which is difficult to understand (PSR-2)
  • No Peer Programming (Code Review) in place (Pull Request)

 

  • CLEAN CODE

 

  • DRY do not repeat yourself
  • KISS – Keep it Stupid Simple
  • PSR-2 Code Styling
  • PSR-3 Log for debug purposes
  • PSR-4 Comment Code Properly
  • Function no exceeding 40 lines

 

  • No ERRORS

 

  • PHP Code
    • No Errors
    • No Warnings
    • No Notices
  • Unit Testing – 2 per api calls

 

  • CREATE Functional API Test

 

    • 3 positive tests
    • 3 negatives

 

 

  • Final API Documentation (swagger)

 

 

  • Check PHP logs (Nagios)
    • PHP Code
      • No Errors
      • No Warnings
      • No Notices

 

  • Execute Regression Testing

  • Make sure unit testing reach out full Code coverage

CORS ISSUE NGINX SWAGGER FETCH ERROR SOLUTION – Jeeezzz !

CORS Solution for NGINX SWAGGER

set $origin $http_origin; 

if ($origin !~ '^https?://(docs-mapi)\.4over\.com) {
 set $origin 'https://yourdomain.com';
 }

add_header 'Access-Control-Allow-Origin' "$origin" always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, DELETE, PUT, PATCH, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'Authorization, Access Control-Allow-Headers, Origin,Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers, api_key' always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';

give information regarding yum installed packages

sudo repoquery –list php72-php-pecl-xdebug.x86_64

/etc/opt/remi/php72/php.d/15-xdebug.ini
/opt/remi/php72/root/usr/bin/debugclient
/opt/remi/php72/root/usr/lib64/php/modules/xdebug.so
/opt/remi/php72/root/usr/share/doc/pecl/xdebug
/opt/remi/php72/root/usr/share/doc/pecl/xdebug/CREDITS
/opt/remi/php72/root/usr/share/doc/pecl/xdebug/LICENSE
/opt/remi/php72/root/usr/share/doc/pecl/xdebug/README.rst
/opt/remi/php72/root/usr/share/doc/pecl/xdebug/contrib
/opt/remi/php72/root/usr/share/doc/pecl/xdebug/contrib/tracefile-analyser.php
/opt/remi/php72/root/usr/share/doc/pecl/xdebug/contrib/xt.vim
/opt/remi/php72/root/usr/share/doc/pecl/xdebug/xdebug.ini
/var/opt/remi/php72/lib/pear/pkgxml/php72-php-pecl-xdebug.xml

Slim Vs Silex – API performance

Slim php framework is faster than Silex

 

Silex Framework

[[email protected] silex]$ ab -n500 -c11 ‘http://silex.davidr.sbx.over.com/hello/raleche/’
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking silex.davidr.sbx.over.com (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Finished 500 requests

Server Software: Apache
Server Hostname: silex.davidr.sbx.over.com
Server Port: 80

Document Path: /hello/raleche/
Document Length: 300 bytes

Concurrency Level: 11
Time taken for tests: 5.648 seconds
Complete requests: 500
Failed requests: 0
Write errors: 0
Non-2xx responses: 500
Total transferred: 259000 bytes
HTML transferred: 150000 bytes
Requests per second: 88.52 [#/sec] (mean)
Time per request: 124.261 [ms] (mean)
Time per request: 11.296 [ms] (mean, across all concurrent requests)
Transfer rate: 44.78 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 61 122 20.2 120 226
Waiting: 61 122 20.2 120 226
Total: 61 122 20.2 120 226

Percentage of the requests served within a certain time (ms)
50% 120
66% 128
75% 133
80% 137
90% 146
95% 161
98% 170
99% 173
100% 226 (longest request)

 

Slim framework

[email protected] silex]$ ab -n500 -c11 ‘http://slim.davidr.sbx.over.com/hello/raleche/’
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking slim.davidr.sbx.over.com (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Finished 500 requests

Server Software: Apache
Server Hostname: slim.davidr.sbx.over.com
Server Port: 80

Document Path: /hello/raleche/
Document Length: 890 bytes

Concurrency Level: 11
Time taken for tests: 4.672 seconds
Complete requests: 500
Failed requests: 0
Write errors: 0
Non-2xx responses: 500
Total transferred: 536500 bytes
HTML transferred: 445000 bytes
Requests per second: 107.02 [#/sec] (mean)
Time per request: 102.781 [ms] (mean)
Time per request: 9.344 [ms] (mean, across all concurrent requests)
Transfer rate: 112.14 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 41 85 38.1 83 869
Waiting: 41 85 38.1 83 868
Total: 41 85 38.1 83 869

Percentage of the requests served within a certain time (ms)
50% 83
66% 89
75% 93
80% 96
90% 101
95% 109
98% 115
99% 126
100% 869 (longest request)

 

 

 

David Raleche – Professional Traits

o For Engineering Managers Specifically: I managed teams of 5+ engineers on product development. Don’t need to be hands on themselves, but need to have managed a team where the engineers were building a product built in PHP

· Experience with highly-transactional systems

· Experience with distributed systems

· Experience with RESTful web services and API experience

· Database platforms experience

· Understanding of AWS