Skip to content

5-Minute Quickstart

This quickstart walks through the Aegean Voyages (aegeanvoyages.example) charter member portal from site/modules/Account/examples/real-world/.

  1. Verify the virtual routes are active

    Open Setup -> Account -> Settings and confirm Frontend Rendering Engine is set to Interactive App Views (Default) (inertia), with Authentication Route Prefix set to /auth and Account Hub Route Prefix set to /account.

    Visit /auth/login in an incognito browser window to confirm the sign-in screen renders with zero custom template files.

  2. Invite your first member via CLI

    Issue a single-use invitation link for Claire Beaumont at Riviera Yacht Brokerage:

    Terminal window
    php vendor/bin/wire account:invite [email protected] \
    --role=member \
    --ttl=86400 \
    --json

    Pass --dry-run first to preview the payload or --no-mail to print the invitation URL without dispatching email.

  3. Dispatch a real notification from PHP or CLI

    Test the built-in account-activity template from the terminal:

    Terminal window
    php vendor/bin/wire account:notify-test account-activity \
    --channel=email \
    --data='{"member_name":"Claire Beaumont","activity":"New passkey enrolled on Safari 18"}' \
    --sync \
    --json

    Or call $account->notifications()->send() inside your application code (see site/modules/Account/examples/real-world/notifications-and-flow.php):

    <?php namespace ProcessWire;
    $account = Account::requireInstance($wire);
    $result = $account->notifications()->send('account-activity', [
    'user' => $user,
    'email' => $user->email,
    'data' => [
    'member_name' => 'Claire Beaumont',
    'activity' => 'Charter berth confirmed in Gocek Marina',
    'ip' => $input->ip(),
    ],
    ]);
  4. Add a declarative Save / Favorite toggle button

    Enqueue Account’s classic frontend assets and add data-account-save-toggle to any yacht card (works for both signed-in members and guests via the signed account_saved cookie):

    <?php namespace ProcessWire;
    $account = Account::requireInstance($wire);
    foreach ($account->getFrontendStyleAssets() as $css) {
    echo '<link rel="stylesheet" href="' . $sanitizer->entities($css) . '">';
    }
    foreach ($account->getFrontendScriptAssets() as $js) {
    echo '<script type="module" src="' . $sanitizer->entities($js) . '"></script>';
    }
    ?>
    <button
    type="button"
    data-account-save-toggle
    data-account-list="favorites"
    data-account-type="page"
    data-account-key="<?= (int) $yacht->id ?>"
    >
    Save Yacht
    </button>
  5. Inspect live telemetry in Setup -> Account

    Open Setup -> Account -> Delivery Log and Audit Log to see the dispatched notification and security trail immediately.

Next steps