docs(articles): English translation of From Magento to Symfony
en/articles/magento-to-symfony/basics/structure.md
new file +51
β0
1
+
# Project structure
2
+
3
+
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.
4
+
5
+
**Magento** Β· module tree
6
+
7
+
```text
8
+
app/
9
+
code/Vendor/Faq/
10
+
registration.php
11
+
etc/module.xml di.xml events.xml
12
+
etc/frontend/routes.xml
13
+
etc/adminhtml/system.xml menu.xml
14
+
etc/acl.xml webapi.xml crontab.xml
15
+
etc/db_schema.xml
16
+
Api/ Api/Data/
17
+
Model/ Model/ResourceModel/
18
+
Controller/ Block/ ViewModel/
19
+
view/frontend/layout/ templates/ web/
20
+
etc/env.php config.php
21
+
bin/magento
22
+
generated/
23
+
pub/index.php pub/static/
24
+
var/ vendor/
25
+
```
26
+
27
+
**Symfony** Β· application tree
28
+
29
+
```text
30
+
bin/console
31
+
config/
32
+
bundles.php
33
+
packages/ doctrine.yaml security.yaml
34
+
messenger.yaml monolog.yaml β¦
35
+
routes.yaml
36
+
services.yaml
37
+
migrations/
38
+
public/index.php
39
+
src/
40
+
Kernel.php
41
+
Controller/ Entity/ Repository/
42
+
Dto/ Message/ MessageHandler/
43
+
EventListener/ Security/
44
+
translations/
45
+
tests/
46
+
var/cache/ var/log/
47
+
vendor/
48
+
.env .env.local .env.test
49
+
```
50
+
51
+
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`.