An entity that serves as the entry point to a cluster of related objects. It has a repository interface and enforces invariants across its children. Example: Album is an aggregate root — it manages its own fields and rules.
Anti-Corruption Layer
A set of adapters that isolate domain code from external libraries. Baander applies it to League OAuth2 Server, which only validates access tokens; Auth issues tokens with its own handlers. The domain only knows internal interfaces, not League's.
Bounded Context
A distinct area of the codebase that models a specific business capability with its own domain language, rules, and data. Example: the Playlist context knows nothing about Transcoding.
Command
A CQRS write operation — a DTO that carries input data to a handler. Commands are immutable (final readonly class). Example: CreatePlaylistCommand.
Domain Event
A signal that something happened in the domain. Events are dispatched by handlers and listened to by other contexts. Example: TranscodeJobCompleted.
Domain Model
A PHP class in Domain/Model/ that encapsulates business rules. Aggregate roots use a state object pattern; value objects are immutable with a public constructor.
Four-Layer Architecture
Domain, Application, Infrastructure, Interface. Dependencies flow inward: Interface depends on Application, Application depends on Domain. Domain has no framework dependencies.
Port
An interface in the Application layer that defines a capability (e.g., PlaylistPortInterface). Controllers inject ports; infrastructure implements them. This decouples the API layer from domain logic.
Repository Interface
A contract in Domain/Repository/ for persisting and retrieving aggregates. The implementation lives in Infrastructure/Doctrine/Repository/.
State Object
A mutable class ({Entity}State) that holds all fields of an aggregate root. It keeps the create() and reconstitute() constructors in sync and is used by the repository for persistence.
Value Object
An immutable object identified by its value rather than an identity. Defined as final readonly class with a public constructor. Example: Uuid, PublicId, Email.
Command Query Responsibility Segregation. Write operations (commands) are handled separately from read operations (queries) via Symfony Messenger.
Doctrine Entity
An ORM mapping class in Infrastructure/Doctrine/Entity/ that represents a database row. Separate from the domain model — repositories convert between the two.
Messenger
Symfony's message bus system. Routes commands to handlers, supports async processing via Redis transport.
PGroonga
A PostgreSQL extension for fast full-text search, used by the PgroongaSearchTrait in repositories.
Port Pattern
The canonical dependency inversion pattern in Baander. Application ports define interfaces; infrastructure implements them; controllers depend on ports.
Process Pool
A Swoole-managed pool of worker processes used for CPU-bound tasks like FFmpeg transcoding.
WebSocket
Bidirectional real-time communication and Baander's only real-time transport: watch-party sync and member events, listening-session sync, and server pushes to a user's connections.
A 21-character NanoID matching ^[0-9a-zA-Z_-]{21}$, for example V1StGXR8_Z5jdHi6B-myT. Used by many URL parameters and response fields, separately from UUID identity; not every endpoint uses it.
UUID v7
A time-sortable universally unique identifier generated by default by the Uuid value object for aggregate identity. Existing UUIDs can have other versions; database keys and API identifiers also include integers, text keys and protocol identifiers.