AML VIEW + API + DATA

Oracle Arena

A compact game demonstrating a complete PHPAML workflow, from reactive interaction to persistent leaderboard.

What this demo validates

Reactive state and effects without handwritten JavaScript, same-origin API calls with CSRF protection, server-side game rules, SQLite migrations, and client navigation without full reloads.

Stack

01AML View02AML Engine03PHPAML API04PHPAML Data05SQLite06Automated tests
REACTIVE VIEWGamePage.php
phpaml — zsh
final class GamePage extends Page
{
    #[State] public int $playerScore = 0;
    #[State] public string $gameId = '';

    private function startGame(): ClientInstruction
    {
        return Api::post('/api/games', [
            'player_name' => StateRef::to('playerName'),
        ])->storeIn('gameId', 'id');
    }
}