This tutorial will walk through practicing the Double Loop Workflow to create a small application.
- Docker Desktop
- PHP 7.2
- Composer
composer install
docker-compose up -d
- edit
hosts
file
127.0.0.1 local.chirper.com
127.0.0.1 api.chirper.com
127.0.0.1 db.chirper.com
Note: If you're using docker-machine instead of Docker Desktop (Docker for Mac / Windows), use the correct IP address
- Browse to http://api.chirper.com:3001 and confirm there is a PHP info page
- Browse to http://local.chirper.com:8080 and confirm there is a HTML/JS page with a form: (non-functional)
If you are unable to complete these steps before the tutorial, please message me on Twitter @jessicamauerhan - and we will debug, or we will get it working day of.
- First, follow the steps in the Setup section if you haven't already.
docker-compose exec api vendor/bin/phinx migrate
will setup the database
- Postman App
- Chrome with the JSON Viewer extension
- Tell PHP Storm you're using PHP 7.2
- JSON API - Our API will be implementing JSON API
- UUID Generator - You may want this during testing
- Vue - FYI: The frontend app is built using vuetify via vue-cli. You do not need any Vue knowledge, we will not be editing the frontend, just testing the end-to-end user experience.
One of the things we focus on in this workflow is decoupling dependencies. Any of these can be replaced at any time by another tool. This demo is not meant to be specific to any of these third party libraries, we simply use them to solve a common problem such as routing or validation, unrelated to the business logic code.
- Silex - microframework / router
- Phinx docs - db migrations
- Valitron Validator - http request validation
- Ramsey/Collection - typed collections of objects
- PHP Unit Docs
- Behat
- Behat Mink Extensions - Mink is a browser driver
- Guzzle Documentation - PHP HTTP Client - used in some of our tests
- Faker - Generates fake data