project-root/
├── public/ # Publicly accessible files (web server document root)
│ ├── index.php # Single entry point
│ ├── css/ # Compiled CSS files
│ ├── js/ # Compiled JavaScript files
│ └── images/ # Images and other static assets
├── src/ # PHP source code (application logic)
│ ├── Controller/ # Handles HTTP requests and responses
│ ├── Model/ # Represents data entities (e.g., User, Product)
│ ├── Service/ # Encapsulates business logic
│ ├── Repository/ # Abstracts database queries
│ └── Utils/ # Reusable helper classes
├── vendor/ # Third-party libraries managed by Composer (ignored by Git)
├── tests/ # Unit and integration tests
├── config/ # Application configuration files
├── var/ # Temporary files (cache, logs)
├── .env # Environment variables (ignored by Git)
├── .gitignore # Specifies files to be ignored by Git
├── composer.json # Composer dependencies and autoloading configuration
├── phpunit.xml # PHPUnit configuration
└── README.md # Project documentation and setup instructions
This is how Symfony does it
your_project/
├─ assets/
├─ bin/
│ └─ console
├─ config/
│ ├─ packages/
│ ├─ routes/
│ └─ services.yaml
├─ migrations/
├─ public/
│ ├─ build/
│ └─ index.php
├─ src/
│ ├─ Kernel.php
│ ├─ Command/
│ ├─ Controller/
│ ├─ DataFixtures/
│ ├─ Entity/
│ ├─ EventSubscriber/
│ ├─ Form/
│ ├─ Repository/
│ ├─ Security/
│ └─ Twig/
├─ templates/
├─ tests/
├─ translations/
├─ var/
│ ├─ cache/
│ └─ log/
└─ vendor/