httpsoft / http-app
HTTP Software Application Template
Installs: 104
Dependents: 0
Suggesters: 0
Security: 0
Stars: 14
Watchers: 3
Forks: 1
Open Issues: 1
Type:project
Requires
- php: ^7.4|^8.0
- devanych/di-container: ^2.1
- httpsoft/http-basis: ^1.1
- monolog/monolog: ^2.3|^3.3
Requires (Dev)
- filp/whoops: ^2.15
- phpunit/phpunit: ^9.5
- roave/security-advisories: dev-latest
- squizlabs/php_codesniffer: ^3.7
- symfony/var-dumper: ^5.4|^6.2
- vimeo/psalm: ^4.9|^5.2
This package is auto-updated.
Last update: 2024-10-22 00:27:20 UTC
README
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.
Documentation
Installation
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.
Testing and checking
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.
Directory structure
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.