Skip to content

This project is sample stack with Symfony 5 into Docker containers using Docker-compose, using MySQL 8 as a database.

Notifications You must be signed in to change notification settings

acostasg/symfony-ddd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Symfony Project with Domain Driven Design (DDD)

Description

This project is sample stack Domain Driven Design (DDD) with Symfony 5 into Docker containers using Docker-compose, using MySQL 8 as a database.

DDD

Installation

  1. Run docker-compose up -d
Creating symfony-ddd_db_1    ... done
Creating symfony-ddd_php_1   ... done
Creating symfony-ddd_nginx_1 ... done
  1. Use this value for the DATABASE_URL environment variable of Symfony:
DATABASE_URL=mysql://user:sample@db:3306/app_db?serverVersion=5.7

User and password of the database is the env file at the root of the project.

  1. In your dev environment add this line in your hosts file:
127.0.0.1 dev.app.com

4.- Execute composer install

docker exec -ti symfony-ddd_php_1 composer update
docker exec -ti symfony-ddd_php_1 composer install

5.- Execute migrations

View status:

docker exec -ti symfony-ddd_php_1 php bin/console doctrine:migrations:status

execute all migrations pending:

docker exec -ti symfony-ddd_php_1 php bin/console doctrine:migrations:migrate 

Default path for bundle:

http://dev.app.com/user/
http://dev.app.com/order/

6.- Tools for testing, fixed and evalute code.

For execute PHPUnit, PHPStan, Psalm and PHP-cs-fixer in development time

  • for execute PHPUnit
docker exec -ti symfony-ddd_php_1 php vendor/bin/phpunit
  • execute PHPStan
docker exec -ti symfony-ddd_php_1 php vendor/bin/phpstan
  • execute Psalm
docker exec -ti symfony-ddd_php_1 php vendor/bin/psalm --show-info=true
  • execute PHP-cs-fixer
docker exec -ti symfony-ddd_php_1 php vendor/bin/php-cs-fixer fix src

Project: PHPStorm

References

https://www.fabian-keller.de/blog/domain-driven-design-with-symfony-a-folder-structure/

About

This project is sample stack with Symfony 5 into Docker containers using Docker-compose, using MySQL 8 as a database.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published