Project anatomy
As you might have noticed, Symfony's folder tree looks big the first week. Most days you live in five places.
The map (FE brain edition)
bash
symfony-playground/
bin/console # CLI entry (like artisan)
config/
packages/ # Flex-installed package config
routes/ # route imports (attributes often live on controllers)
services.yaml # DI wiring / defaults
public/ # web root - index.php lives here
src/
Controller/
Entity/ # Doctrine entities (when you add them)
Repository/
# Kernel.php, etc.
templates/ # Twig templates
assets/ # AssetMapper entrypoints (CSS/JS)
migrations/ # Doctrine migrations
tests/
var/ # cache, logs (like storage/)
vendor/ # Composer - like node_modules
.env # defaults
.env.local # your machine overrides (gitignored)
composer.json
importmap.php # AssetMapper import map (when present)Compared to what you know
| Front-end / PHP tutorial | Symfony |
|---|---|
src/ | src/ (honest naming 🙌) |
public/index.php | public/index.php |
| router file | attributes on controllers (+ config/routes/) |
| templates | templates/ |
Vite resources/ | assets/ + AssetMapper (or Encore if the project uses it) |
.env | .env + .env.local |
vendor/autoload.php | required by public/index.php for you |
Where to look when debugging
- URL weird? →
php bin/console debug:router/ controller#[Route] - HTML weird? →
templates/… - DB weird? →
src/Entity/…+migrations/ - 500 / exception? →
var/log/dev.log(or the profiler toolbar) - Service weird? →
php bin/console debug:container/config/services.yaml
Services vs "new" (don't panic)
You'll see constructors full of type-hints and almost no new Service() in controllers. Symfony's container auto-wires classes under src/ by default - the DI story from the PHP tutorial runway chapter, now automatic.
php
<?php
public function __construct(
private PostRepository $posts,
) {}As you can see, it feels like Nest/Angular injectables more than Laravel Facades. Same idea, different aesthetic.
The profiler (dev)
When APP_ENV=dev, the web debug toolbar at the bottom is gold: route name, queries, timed events. Click it when something feels slow or mysterious.
Next up: what happens when a request hits public/index.php.
Best,
-- ł.