Three zones not to confuse.
PUBLICpublic/
The only Web-exposed root: index.php, public images, and static files.
YOUR CODEsrc/ · routes/
Controllers, models, views, components, services, and route declarations.
REBUILDABLEruntime/
Installed framework, dependencies, cache, logs, and runtime storage.
The manifest connects the project to AML.
phpaml.json lets AML recognize the project root, structure, and compatible versions. When you run aml serve from a subfolder, AML walks upward to this manifest.
project/
├── phpaml.json
├── public/
│ └── index.php
├── routes/
│ └── WebApp.php
├── src/
│ ├── controllers/
│ ├── models/
│ ├── middleware/
│ └── views/
└── runtime/Where should a new file go?
An image available by URL
public/A URL rule
routes/An HTTP action
src/controllers/A business rule or data object
src/models/A PHP interface
src/views/An installed dependency
runtime/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.
SUMMARY
What to remember
- public/ is the only Web root.
- src/ and routes/ contain your application.
- runtime/ can be rebuilt.
- phpaml.json identifies and describes the project.