Skip to content

KubaRocks/hello-world-microservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Microservice template

A template for PHP-based microservices in Symfony 6.

Structure

├── config       # Symfony configuration and service definitions for dependency injection
├── bin          # Used for binaries that we want to commit
├── build        # A build directory for code coverage, logs, caches, etc. Ignore by .gitignore
├── docker       # Dockerfiles and associated assets to build images
├── docs         # Documentation, included autogenerated and code metrics
├── features     # Feature definitions written in Gherkin notation
├── public       # Entrypoint file for when the microservice is being used as an API.
├── src
│   ├── api      # Implementations specific to the transport mechanism, e.g. HTTP Controllers and Console Commands.
│   └── app      # The application itself, agnostic to transport medium. Commands, Queries, and Handlers live here
│   ├── domain   # Business-level code which has no concept of the outside world (e.g. HTTP)
│   └── infra    # Implementation-specific application code, ie a `DBALCustomerRepository`
├── tests        # Test suites
│   ├── behat    # Behat Contexts
│   ├── fixtures # Fixtures for tests to use
│   ├── unit     # Unit tests
└── vendor       # Vendor (ignored by git)

Bundled Tooling

Testing

Standard tool for creating unit tests. Each test case should be for an isolated classs (the unit, or the Subject Under Test), with as many dependencies and collaborators mocked as possible. The mocking framework of choice in this template is Prophecy.

Framework for Behavior-driven development (BDD) to create test automation around business expectations. In particular, there are various Contexts that should be created, each one wrapping a particular driver (ie, API or console) or pure service, allowing segregation of business logic from implementation.

Quality & Reporting

phpcs

psalm

phpstan

phpmd

phpmetrics

Make commands

In most cases, the various make targets run the docker container with a specific composer script. Here are some of the core targets:

  • setup - Sets up the project.
  • install - prepares the development environment, runs composer install
  • test - runs the test script defined in composer.json, which will run the entire test suite (e.g. both unit and functional).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published