devscast / symfony-hexa-skeleton
A symfony skeleton project with Onion Architecture
Installs: 9
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 0
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=8.3
- ext-ctype: *
- ext-iconv: *
- beberlei/doctrineextensions: ^1.5.0
- cweagans/composer-patches: ^1.7.3
- devscast/symfony-hexa-bundle: ^1.0
- doctrine/doctrine-bundle: ^2.12.0
- doctrine/doctrine-migrations-bundle: ^3.3.1
- doctrine/orm: ^2.16.0
- endroid/qr-code-bundle: ^5.0.1
- erusev/parsedown: ^1.7.4
- knplabs/knp-paginator-bundle: ^6.4.0
- knpuniversity/oauth2-client-bundle: ^2.18.1
- phpdocumentor/reflection-docblock: ^5.3
- phpstan/phpdoc-parser: ^1.15
- presta/sitemap-bundle: ^4.1.1
- symfony/asset: 7.1.*
- symfony/console: 7.1.*
- symfony/doctrine-messenger: 7.1.*
- symfony/dotenv: 7.1.*
- symfony/expression-language: 7.1.*
- symfony/flex: ^2
- symfony/form: 7.1.*
- symfony/framework-bundle: 7.1.*
- symfony/http-client: 7.1.*
- symfony/intl: 7.1.*
- symfony/lock: 7.1.*
- symfony/mailer: 7.1.*
- symfony/mime: 7.1.*
- symfony/monolog-bundle: ^3.0
- symfony/notifier: 7.1.*
- symfony/process: 7.1.*
- symfony/property-access: 7.1.*
- symfony/property-info: 7.1.*
- symfony/rate-limiter: 7.1.*
- symfony/runtime: 7.1.*
- symfony/security-bundle: 7.1.*
- symfony/serializer: 7.1.*
- symfony/stimulus-bundle: ^2.18
- symfony/string: 7.1.*
- symfony/translation: 7.1.*
- symfony/twig-bundle: 7.1.*
- symfony/uid: 7.1.*
- symfony/ux-autocomplete: ^2.3
- symfony/ux-chartjs: ^2.3
- symfony/ux-dropzone: ^2.3
- symfony/ux-turbo: ^2.3
- symfony/validator: 7.1.*
- symfony/web-link: 7.1.*
- symfony/webpack-encore-bundle: ^2.1
- symfony/yaml: 7.1.*
- twig/cssinliner-extra: ^3.10.0
- twig/extra-bundle: ^3.10.0
- twig/markdown-extra: ^3.10.0
- twig/string-extra: ^3.10.0
- twig/twig: ^2.16|^3.10
- vich/uploader-bundle: ^2.4.0
Requires (Dev)
- dama/doctrine-test-bundle: ^8.2.0
- doctrine/doctrine-fixtures-bundle: ^3.6.1
- hautelook/alice-bundle: ^2.13.0
- nelmio/alice: ^3.13.6
- phpstan/phpstan: ^1.11.7
- phpstan/phpstan-doctrine: ^1.4.5
- phpstan/phpstan-phpunit: ^1.4.0
- phpstan/phpstan-symfony: ^1.4.5
- phpunit/phpunit: ^9.6.20
- rector/rector: ^1.2.0
- squizlabs/php_codesniffer: ^3.10.1
- symfony/browser-kit: *
- symfony/css-selector: *
- symfony/debug-bundle: *
- symfony/maker-bundle: ^1.60
- symfony/panther: ^2.0
- symfony/phpunit-bridge: ^7.1
- symfony/stopwatch: *
- symfony/web-profiler-bundle: *
- symplify/easy-coding-standard: ^12.3.1
- theofidry/alice-data-fixtures: ^1.7.2
Conflicts
README
This is a skeleton symfony project with Onion (hexagonal) Architecture, instead of the traditional layered architecture. we use the following layers:
- application : contains the application services, which are the use cases of the application, commands, and queries and their handlers.
- domain : contains the domain entities, value objects, repositories (interfaces), and domain services.
- infrastructure : contains implementations of the domain repositories, and other infrastructure services like mailers, notifiers, etc.
each layer is independent of the other layers, and the dependencies are injected from the outer layer to the inner layer. each layer contains a bounded context, which is a group of related use cases and entities.
Note : this architecture is inspired by the book "Domain-Driven Design: Tackling Complexity in the Heart of Software" by Eric Evans. it's a simplified version of the onion architecture, which is a more general concept and thus no meant to be a strict implementation, we adapt it to our needs and the needs of ours projects.
why Hexa instead of Onion? because it's shorter and sounds cool 😎
Usage
composer create-project devscast/symfony-hexa-skeleton my_project
installed packages
Support template generation with symfony/ux-twig-component
As for now, symfony/ux-twig-component
does not support {{ "<twig:component />" }}
syntax.
which is used when generating templates with bin/console hexa:make:template [index|show]
.
To make it work, we need to patch the symfony/ux-twig-component
package.
{ "extra": { "patches": { "symfony/ux-twig-component": { "printed raw component": "./patches/ux-twig-component.patch" } }, "composer-exit-on-patch-failure": true } }
create patch file ./patches/ux-twig-component.patch
with the following content
--- a/vendor/symfony/ux-twig-component/src/Twig/TwigPreLexer.php 2024-02-29 18:20:59.000000000 +0200 +++ b/vendor/symfony/ux-twig-component/src/Twig/TwigPreLexer.php 2024-05-09 13:37:06.643585125 +0200 @@ -70,6 +70,17 @@ } } + if ($this->consume('{{ "')) { + $output .= '{{ "'; + $output .= $this->consumeUntil('" }}'); + $this->consume('" }}'); + $output .= '" }}'; + + if ($this->position === $this->length) { + break; + } + } + if ($this->consume('{% embed')) { $inTwigEmbed = true; $output .= '{% embed';