_ _ ______ _
| \ | | | ____| | |
| \| | ___ | |__ _ __ __ _ _ __ ___ _____ _____ _ __| | __
| . ` |/ _ \ | __| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ /
| |\ | (_) | | | | | | (_| | | | | | | __/\ V V / (_) | | | <
|_| \_|\___/ |_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\
This is just for study case, use by your own risk!!!
Run ./nofw init
to build the application 🚀
I used the follow packages to compose the API:
- Zend Diactoros A PSR-7 HTTP Message implementation
- Zend Stratigility A PSR-7 middleware foundation for building and dispatching middleware pipelines
- PHP-DI A container for dependency injection
- FastRoute A request router
- Illuminate Database An activeRecord style ORM, and schema builder
- Phinx Tool to migrate and seed the database
- Respect Validation A validation engine to validate incoming requests
- Illuminate Pagination An component to paginate the ORM results
- League Fractal Helps to output complex RESTful data structures
- Monolog A simple logger to the API
- Lcobucci JWT Provide a JWT implementation
- Predis PHP Redis client
For dev:
- PHPUnit Unit tests
- PHPUnit Pretty Result Printer A pretty printer for PHPUnit
- Mockery PHP mock object framework for use in unit testing with PHPUnit
- Behat A BDD framework
- Guzzle A HTTP client to make request in BDD tests
- Faker Generates fake data for dev environment and unit tests
- Swagger PHP A PHP swagger annotation and parsing library
- PHP CodeSniffer A tool ensure the coding standards
- PHP-CS-Fixer A tool to automatically fix PHP coding standards issues
- Symfony VarDumper Provides a better dump() function
I create a utility tool for command line, run the application simply run ./nofw init
.
Run ./nofw
to see another options.
The application ships with Swagger docs, go to ttp://localhost:4000 to see.
Some endpoints require authentication, go to the http://localhost:4000/#/auth/post_auth and send the request to get the JWT token, now click in button Authorize
in right superior corner, and put the token there.
The application already ships with a simple container of SonarQube, to see the application stats, first you need run the Unit tests in order to generate the coverage, simply run ./nofw tests
, after the tests finish, run ./nofw sonar-runner
, now go to the http://localhost:9000/dashboard?id=App.