Skip to content

Create your first app

Create an API project and start its development server:

Terminal window
pam init hello-pam --template api
cd hello-pam
pam dev index.php

The generated project exposes GET /api/ping on port 3000.

Terminal window
curl http://127.0.0.1:3000/api/ping
{"message":"pong"}

This is already a persistent PHP application. PAM loaded the Composer autoloader and application once; subsequent requests execute inside isolated Fibers.

The initializer creates a normal Composer project, selects the first-party packages required by the preset, and installs them using Composer inside PAM’s Embed SAPI. There is no PAM-specific dependency lockfile.

Use --no-install when you want source generation without dependency resolution:

Terminal window
pam init hello-pam --template api --no-install

The socket preset enables PAM’s native WebSocket transport on the same listener:

Terminal window
pam init realtime-api --template api --socket
Terminal window
pam init my-laravel-app --template laravel
pam init native-core --template mobile
pam init native-ui --template mobile-ui
pam init my-desktop-app --template desktop

Read Choose a target before committing to native mobile or desktop: their platform support differs from the server runtime.