Pupper is a Twitter clone, built for the purpose of demonstrating basic Laravel functionality (as well as automated testing).
The project comes pre-packaged with a Laravel Homestead instance, which contains everything needed to run the project.
- Composer — PHP package manager, used for installing dependencies
- Vagrant — Virtual Machine manager
- At least one of the following virtualization platforms:
- Vagrant Host Manager plugin (required in some environments)
Once those dependencies are satisfied, clone the project from GitHub and install its dependencies:
# Clone the project to a local directory
$ git clone git@github.com:stevegrunwell/pupper.git
# Move into the project directory
$ cd pupper
# Install Composer dependencies
$ composer install --ignore-platform-reqs
Don't worry about the version of PHP you're running locally, the composer.json
file tells Composer to install as though we're using PHP 7.3 (which will be pre-configured in the Homestead virtual machine).
Once the project has been cloned and its dependencies installed, it's time to start up our Laravel Homestead virtual machine!
This process has been heavily-scripted for you, so getting up and running with the project should be as simple as:
# Create the necessary Homestead files
$ composer homestead
# Provision the virtual machine
$ vagrant up
If everything worked properly, Pupper should be accessible via https://pupper.test.
The application test suite is written using PHPUnit, installed via Composer. The test suite may be run at any time by running the following from within the VM:
$ ./vendor/bin/phpunit
You may also use the following Composer script from within the Homestead VM to run all tests (PHPUnit, coding standards, static code analysis, etc.):
$ composer test
Pupper is written according to the PSR-2 coding standard and ships with configurations for PHP_CodeSniffer and PHP Coding Standards Fixer for verifying adherence to these standards.
You may run the coding standards checks at any time by running the following Composer script from within the VM:
$ composer coding-standards
The Pupper repository also includes a PHPStan configuration for performing static code analysis:
$ composer static-analysis
A custom Composer script has been registered to generate HTML code coverage reports, which help highlight areas that may be under-tested.
To generate the reports, run the following:
$ composer test-coverage
The reports will be available at https://pupper.test/test-coverage.
Iconography for the application comes from The Noun Project, and is used under a Creative-Commons License: