docs(articles): explain the project trees with tables instead of a dense list
en/articles/magento-to-symfony/basics/structure.md
+25
β3
Project structure
A new project: symfony new faq --webapp (Symfony CLI) or composer create-project symfony/skeleton faq for a minimal set. Flex adds packages together with their config: composer require orm creates config/packages/doctrine.yaml and the DATABASE_URL variable.
Magento Β· project tree with a module
<magento-root>/
βββ app/
β βββ code/
β β βββ Vendor/
β β βββ Faq/
β β βββ registration.php
β β βββ composer.json
β β βββ Api/
β β β βββ Data/
β β βββ Block/
β β βββ Controller/
β β βββ Model/
β β β βββ ResourceModel/
β β βββ Observer/
β β βββ Plugin/
β β βββ Setup/
β β βββ ViewModel/
β β βββ etc/
β β β βββ module.xml
β β β βββ di.xml
β β β βββ events.xml
β β β βββ acl.xml
β β β βββ webapi.xml
β β β βββ crontab.xml
β β β βββ db_schema.xml
β β β βββ frontend/
β β β β βββ routes.xml
β β β βββ adminhtml/
β β β βββ menu.xml
β β β βββ system.xml
β β βββ i18n/
β β βββ view/
β β βββ frontend/
β β βββ layout/
β β βββ templates/
β β βββ web/
β βββ etc/
β βββ config.php
β βββ env.php
βββ bin/
β βββ magento
βββ generated/
βββ pub/
β βββ index.php
β βββ static/
βββ var/
βββ vendor/
Symfony Β· application tree
<project>/
βββ bin/
β βββ console
βββ config/
β βββ bundles.php
β βββ preload.php
β βββ routes.yaml
β βββ services.yaml
β βββ packages/
β β βββ cache.yaml
β β βββ framework.yaml
β β βββ doctrine.yaml
β β βββ messenger.yaml
β β βββ monolog.yaml
β β βββ security.yaml
β βββ routes/
β βββ framework.yaml
βββ migrations/
βββ public/
β βββ index.php
βββ src/
β βββ Kernel.php
β βββ Controller/
β βββ Entity/
β βββ Repository/
β βββ EventListener/
β βββ Message/
β βββ MessageHandler/
β βββ Security/
β βββ Dto/
βββ templates/
βββ translations/
βββ tests/
βββ var/
β βββ cache/
β βββ log/
βββ vendor/
βββ .env
βββ .env.dev
βββ .env.test
βββ .env.local
βββ composer.json
βββ symfony.lock
- Magento: only
registration.phpandetc/module.xmlare required, the other module folders appear when you need them.app/etc/config.phplists enabled modules,env.phpholds the DB, cache and environment keys,generated/holds the generated Factory, Proxy and Interceptor classes. - Symfony:
symfony/skeletoncreatesbin/,config/(bundles.php,preload.php,routes.yaml,services.yaml,packages/cache.yaml,packages/framework.yaml),public/index.php,src/Kernel.phpandsrc/Controller/,.envand.env.devwithAPP_SECRET. Everything else comes from packages (Flex recipes:doctrine.yaml,migrations/,src/Entity/,templates/,.env.test) and MakerBundle commands (make:message,make:listener,make:voter).Dto/is a project convention, and you create.env.localyourself; it is not committed.
What is in the Magento tree
| Path | What it is |
|---|---|
registration.php, etc/module.xml |
Required module files. The other folders appear when you need them. |
app/etc/config.php |
The list of enabled modules. |
app/etc/env.php |
DB, cache and environment keys. |
generated/ |
Generated Factory, Proxy and Interceptor classes. |
Where the Symfony tree comes from
| Path | Created by |
|---|---|
bin/, config/, public/index.php, src/Kernel.php, src/Controller/ |
symfony/skeleton |
.env, .env.dev with APP_SECRET |
the framework-bundle recipe |
config/packages/doctrine.yaml, migrations/, src/Entity/, src/Repository/ |
composer require orm |
templates/ |
composer require twig |
tests/, .env.test |
composer require --dev symfony/test-pack |
src/Message/, src/MessageHandler/ |
make:message |
src/EventListener/ |
make:listener |
src/Security/Voter/ |
make:voter |
src/Dto/ |
a project convention |
.env.local |
you create it yourself; it is not committed |
Laying out src/ by technical layers (Controller, Entityβ¦) is only a starting template. For a large project you can group by domain (src/Faq/β¦, src/Catalog/β¦), the framework doesn't restrict this: services.yaml registers everything in src/, and Doctrine looks for entities wherever you point it in doctrine.yaml.