SILLBEAM HANDBOOK

Projects

Organize interfaces within one Symfony application using shared and private modules.

Overview

BASH
php bin/console sillbeam:make:project Shop

The generator creates no configuration. Once multiple Projects exist, configure their hosts before the next boot. Further generator rules also apply to private modules.

Projects group application surfaces within a shared Symfony application. The descriptor owns its directory; its services, controllers and entities are integrated directly. A Project must be neither inside a module nor another Project. Project descriptors must not share a directory. Private modules may be located anywhere within the Project as long as their directories do not overlap other modules.

PHP
<?php

namespace App\Project\Shop;

#[\Sillbeam\Core\Project\Attribute\SillbeamProject(
    modules: [\App\Module\Billing\BillingModule::class],
)]
final class ShopProject {}

Private Modules are identified by their physical location within a Project. Enabled private Modules form automatic roots of its active graph; disabled ones are not included automatically. A Module under a configured Project boundary requires a Project descriptor as owner. Private Module IDs are unique per Project; their configuration address is project:<project-id>:<module-id>.

YAML
sillbeam:
    projects:
        shop: { hosts: [shop.example.com] }
        admin: { hosts: [admin.example.com] }

With multiple Projects, each needs at least one unique host. The first entry is the canonical host. Routes receive the prefix <project-id>.; shared module routes are imported for every assigned interface. A single Project can run without a host filter.

ProjectContextInterface provides current(), id(), is(id) and hasModule(class) in a request. CLI has no current Project without a request. All Projects share the container, database and event system. Host filters are routing rules, not process, tenant or security isolation. Global subscribers and handlers are not automatically scoped to one host.

Unknown Projects or unassigned hosts cause registry and context lookups to throw OutOfBoundsException. Without Projects or a request, current() and id() return null, and is() returns false. Without a current Project context, hasModule() checks only the application graph, which is empty in Project mode. Native Hybrid routes on other hosts must handle the exception when querying context. The context also follows subrequests.

Technical reference: published Core tag v0.2.0, commit cf2f4102ad7c15db30ad5c5af21852bc2aaec99a in the Core repository. Historical verification records identify their own source snapshots separately. The unchanged contracts were checked against the published Core v0.3.0.