Documentation · Chapter 01

Create the right
project type.

The create command installs the project automatically: aml install is not a routine step after creation.

Choose for your use case

aml createClassic application

MVC, routes, controllers, and PHP views.

aml create-viewAML View

Reactive interface written directly in PHP.

aml create-apiAPI

JSON service without a graphical interface.

aml create-consoleConsole

Pure PHP program in the terminal.

HOW DO YOU CHOOSE?

Start from the expected result.

The four commands do not represent four quality levels. They prepare different structures. A server-rendered store may start as a classic application. A highly interactive dashboard suits View. A mobile application consuming JSON uses an API. A programming exercise without a browser uses Console.

I want classic Web pagesaml create
I want a reactive interfaceaml create-view
I want to provide JSON dataaml create-api
I want to learn PHP in the terminalaml create-console

Create a classic application

NEW FOLDER
phpaml — zsh
aml create my-first-project
cd my-first-project
CURRENT EMPTY FOLDER
phpaml — zsh
mkdir my-first-project
cd my-first-project
aml create .
Important

Creation already installs the runtime. Use aml install only to rebuild an existing project, or after --no-install.

Created structure

phpaml — zsh
public/       Web entry point
src/          your application code
routes/       route declarations
runtime/      rebuildable private engine
phpaml.json   PHPAML manifest

Read the structure like a map.

public/ is the Web-facing entry point. routes/ connects an address to an action. src/ contains what you develop. phpaml.json describes the project to AML. runtime/ contains execution tools and can be rebuilt.

Important rule

Work in src/, routes/, and the intended configuration files. Never fix a problem by editing a library inside runtime/: rebuilding it would erase your change.

CHECK YOUR UNDERSTANDING

You are creating a small program that asks for an age in the terminal. Which command should you choose?

Show the answer

aml create-console

SUMMARY

What to remember

  • The project type depends on the expected result.
  • Creation installs the runtime automatically.
  • src/ contains your code; runtime/ contains the engine.
  • aml install is not required after successful creation.