Start with only three areas.
What the browser can request directly: the entry point, images, and public files.
The code you write: controllers, models, routes, services, and views.
Technical elements prepared by AML. You use them, but do not place your pages there.
File, folder, and extension: what is the difference?
A file contains information or code. A folder groups several files. The extension after the dot helps identify the content: .php for PHP code, .css for visual styling, and .json for structured information.
HomeController.phpa PHP code file
home.cssa file describing appearance
phpaml.jsona configuration file read by AML
Other files you will often encounter.
composer.jsonCONFIGURATIONDeclares the PHP packages used by the project.
composer.lockVERSIONSRecords exact installed versions so the same environment can be reproduced.
.envLOCAL SECRETSContains machine-specific settings. Do not publish it when it contains secrets.
tests/VERIFICATIONContains code that automatically checks application behavior.
storage/RUNTIME DATAMay contain logs, cache, or files produced while running, depending on the project.
What you edit and what tools manage.
src/ · public/ · tests/ · phpaml.json · composer.json
runtime/ · composer.lock · cache
This separation does not forbid all advanced changes. It mainly shows where a beginner should work without editing generated files that may later be replaced.
BEGINNER QUESTIONS
You may be wondering…
Should I edit runtime/?
Usually no. AML installs and rebuilds this folder. Your own code mainly lives in src/.
Why is public/ special?
The Web server exposes it to the browser. Secrets and internal code must stay outside it.
Can I create my own folders in src/?
Yes. As the application grows, you can organize services, components, or other responsibilities there.
One file tells AML: “the project starts here.”
This file is named phpaml.json. It contains a few details about the project. The word manifest simply means this identity card. It lets AML find the project even when your terminal is inside a subfolder.
project/
├── phpaml.json ← la fiche d’identité
├── public/ ← ce que le Web peut voir
├── src/ ← votre code, y compris src/routes/
└── runtime/ ← les outils installésWhere should a new file go?
public/src/routes/src/controllers/src/models/src/views/runtime/Apply the map to our library.
public/images/covers/clean-code.jpg
src/routes/WebApp.php
src/controllers/BookController.php
src/models/Book.php
src/views/books/show.phpThe cover is public because the browser must download it. The route knows the address. The controller orchestrates the lookup. Book represents the book. The view knows how to display its title and cover. No file performs two jobs.
CHECK YOUR UNDERSTANDING
Why should .env and src/ never be placed under public/?
Show the answer
Because public/ is exposed to the Web server. Secrets and internal code must remain outside that root.
YOUR TURN
Place these files: logo.svg, CheckoutController.php, User.php, WebApp.php, and a rebuildable cache file.
Show a hint
Use public/, src/controllers/, src/models/, src/routes/, and runtime/.
SUMMARY
What to remember
- public/ is the only Web root.
- src/ contains your application, including src/routes/.
- runtime/ can be rebuilt.
- phpaml.json identifies and describes the project.