This API is designed with hexagonal architecture, DDD and CQRS. This boilerplate embeds an authentication and authorization by JWT for a user.
This project can run either with the standard web development sever or with the nginx sever configured in docker which I highly recommend.
Note that this API is not production ready yet
The documentation of the project is available here
- Improvement of the CI
- Avoid to run twice a pipeline when a pr is merged.
- Generate code coverage.
- Increase the amount of tests
- Implement the openApi specs and generate an openApi page with swagger ui
- Implement a CD
- Integration of blackfire for the monitoring of the app performance
- Integration of a tool like sentry to monitor errors
- Refactoring and improve code quality
- First clone the repo
git clone [email protected]:niko-38500/boilerplate-symfony-hexagonal-architecture-CQRS-JWT.git your-project-name
- Install the dependencies
composer install && cd tools/php-cs-fixer && composer install && cd -
You have probably noticed that php cs fixer have its own composer.json file, this is normal, this is what is recommended in the documentation
- Generate the RSA key pair for the JWT package (for dev and test env) there will be stored into
config/jwt/
php bin/console lexik:jwt:generate-keypair && php bin/console lexik:jwt:generate-keypair -e test
- Lunch the server (run on ports 3300, can be changed in docker/docker-compose.yml)
composer up
helper composer script for the full liste refer to this section
composer stan
: Run phpstan analysiscomposer cs
: Run php cs fixercomposer tests
: Run the tests suits within php fpm docker containercomposer qa
: Run the stan and cs command togethercomposer docker
: Get into the php fpm containercomposer up
: Launch the docker nginx servercomposer stop
: Stop the docker nginx servercomposer rebuild-image
: Rebuild the docker imagescomposer test-db
: Purge the test database and load fixtures for the test environmentcomposer reset-db
: Purge the database and load fixtures