Skip to content

Create your first app

Create an API project and start its development server:

Terminal window
pam init hello-pam --template http
cd hello-pam
mkdir -p storage && touch storage/database.sqlite
pam composer migrate
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
{"data":{"status":1,"message":"pong","requestId":null}}

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

The starter is structured from its first route: PingController::show orchestrates ReadinessService, returns a readonly snapshot through PingResource, and represents readiness with a sequential integer-backed enum. index.php validates typed port configuration and enables security headers before the listener starts.

Terminal window
pam composer test

The generated test invokes the same named action through PAM API’s in-memory client and asserts the Resource envelope and request ID. It also executes a complete SQLite/Eloquent create-and-list flow through named ProductController::store and ProductController::index actions, Form Request, DTO, service, repository and Resource. Product creation returns 201 Created; its status is transmitted as sequential integer enum value 1.

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 http --no-install

The structured starter installs the published PAM HTTP 2 line directly from Packagist. Use --no-install only when you intentionally want to inspect or modify the generated sources before Composer resolves dependencies.

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

Terminal window
pam init realtime-api --template http --socket

The same project workflow drives every PAM target:

Product Create it First visible result
Persistent HTTP pam init my-api --template http JSON endpoint on port 3000
Laravel pam init my-app --template laravel Warm Laravel route and working Artisan
Native mobile pam init my-app --template native Real Android/iOS controls with hot reload
Native UI pam init my-app --template native-ui Retained Material Design 3 screen
Desktop pam init my-app --template desktop Capability-secured native window
pam doctor → pam dev → pam test → pam build → pam package

Choose one explicitly:

Terminal window
pam init my-laravel-app --template laravel
pam init native-core --template native
pam init native-ui --template native-ui
pam init my-desktop-app --template desktop

Run pam without arguments for the guided launcher. Inside any generated project, prefer the contextual workflow: pam doctor, pam dev, pam test, pam build, and pam package.

Read Choose a target for the exact platform contracts. Use the CLI & project console as the command reference for daily development, automation, Composer, Artisan, generators, and releases.

When the product needs maps, authentication, offline sync, video, payments, observability, hardware, or platform services, continue in the capability catalog.