Skip to main content

Quickstart

Zero to actors in three commands.

create-project scaffolds a Symfony-style project, an interactive wizard wires your runtime and modules, and make:actor writes the boilerplate. No config spelunking on day one.

 composer create-project nexus-actors/skeleton my-app
 cd my-app

Answer a handful of questions.

The wizard runs automatically after create-project (and any time later via bin/console nexus:setup). It installs only what you pick and labels experimental modules honestly.

  • Fiber runtime for development, Swoole for production — swap later by re-running the wizard
  • Persistence, OpenTelemetry, TCP cluster, and Messenger are opt-in modules
  • Experimental modules print an explicit warning — no surprises in production
Nexus project setup
===================

Application architecture [minimal]:
 [0] minimal
> minimal

Runtime [fiber]:
 [0] fiber
 [1] swoole
> swoole

Add the HTTP server (Swoole)? (yes/no) [no]:
> yes

Persistence store [none]:
 [0] none  [1] memory  [2] dbal  [3] doctrine
> none

Observability [none]:
 [0] none  [1] otel
> otel

Add TCP clustering (experimental)? (yes/no) [no]:
> no

Add the Symfony Messenger bridge (experimental)?
(yes/no) [no]:
> no

[OK] Project configured.

 * Create your first actor:  bin/console make:actor Greeter
 * Run the actor system:     bin/console run
 bin/console make:actor Payment --with-message

[OK] Created src/Actor/PaymentActor.php
[OK] Created src/Message/PaymentMessage.php

Generate, don't copy-paste.

make:actor writes an #[AsActor] handler the Kernel auto-spawns at boot; make:message writes the readonly message class. Prefer closures? make:actor --functional scaffolds a Behavior::receive() factory instead. Generated code matches the style of everything else in the project.

Run it.

bin/console run boots the container, spawns every#[AsActor] handler, greets the bundled actor so you see a message flow on first boot, and blocks until shutdown. What you get is a small, comprehensible tree:

project layout
my-app/
├── bin/console            command-line entry point
├── config/
│   ├── services.php       DI container (autowires src/)
│   └── packages/          per-module config — runtime.php picks your Runtime
└── src/
    ├── Actor/             #[AsActor] handlers, auto-spawned at boot
    ├── Message/           readonly message classes
    └── Kernel.php         boots the container and ActorSystem
 bin/console run

Booting Nexus actor system… (app: my-app)
  greeter  App\Actor\GreeterActor
[info] Hello, Nexus! The greeter actor received its first message.

Scaffold your first actor.

The full guide walks through every wizard question and generator flag in detail.

composer create-project nexus-actors/skeleton my-app