HTTP Software Application Template
HTTP application template for quickly creating simple but powerful web applications and APIs. «Out of the box», the application template is configured to work with JSON for rapid REST API development.
The core of this application template is the httpsoft/http-basis microframework. By default, the devanych/di-container that implements PSR-11 and the monolog/monolog logger that implements PSR-3 are also used. You can easily change the container and logger to your preferred implementations of the corresponding PSRs.
This project template requires PHP version 7.4 or later.
composer create-project --prefer-dist httpsoft/http-app <app-dir>
To verify the installation, go to
<app-dir> and start the PHP built-in web server:
cd <app-dir> composer run serve
After that, open
http://localhost:8080 in your browser.
The following commands are run in the application directory:
composer run test— runs tests.
composer run static— runs static analysis code.
composer run cs-check— runs checking coding standards.
composer run cs-fix— runs automatic correction of violations of encoding standards.
composer run check— runs checking coding standards, static analysis code and tests.
By default, the application template has the following structure:
bin/ Executable console scripts. chmod-var.php Recursively changing the "var/" directory mode. config/ Configuration files. config.php Main configuration. container.php Dependency injection. pipeline.php Middleware pipeline. routes.php HTTP request routes. public/ Files publically accessible from the Internet. index.php Entry script. src/ Application source code. Http/ HTTP application classes (actions, middelware, etc.). Infrastructure/ Helper classes (factories, listeners, etc.). Model/ Domain model classes (entities, repositories, etc.). tests/ A set of tests for the application. vendor/ Installed Composer packages. var/ Temporary files (logs, cache, etc.).
You can change the structure of the application template as you like.