https://github.com/busfactor/busfactor
[No longer maintained --> see https://github.com/backslashphp/backslash] CQRS and Event Sourcing infrastructure for modern PHP
https://github.com/busfactor/busfactor
aggregate command command-bus cqrs domain-driven-design event event-bus event-sourcing event-store event-stream php projection
Last synced: about 2 months ago
JSON representation
[No longer maintained --> see https://github.com/backslashphp/backslash] CQRS and Event Sourcing infrastructure for modern PHP
- Host: GitHub
- URL: https://github.com/busfactor/busfactor
- Owner: busfactor
- License: mit
- Created: 2019-07-22T11:56:15.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-10-20T01:54:47.000Z (over 3 years ago)
- Last Synced: 2025-10-26T10:51:54.802Z (5 months ago)
- Topics: aggregate, command, command-bus, cqrs, domain-driven-design, event, event-bus, event-sourcing, event-store, event-stream, php, projection
- Language: PHP
- Homepage:
- Size: 98.6 KB
- Stars: 9
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BusFactor
[](https://github.com/busfactor/busfactor/releases)
[](LICENSE)
BusFactor is a modern PHP library providing several components you can mix and match to implement the CQRS and Event Sourcing patterns in your application.
## Install
Using [Composer](https://getcomposer.org/):
```
$ composer require busfactor/busfactor
```
## Requirements
- PHP >=7.3 with `json` and `pdo` extensions enabled.
## Components
| Component | Description |
| --- | --- |
| `Aggregate` | Interfaces and traits for plain DDD aggregates and domain events. |
| `AggregateStore` | Persistence for aggregates. |
| `CacheProjectionStoreMiddleware` | Caching middleware for `ProjectionStore`. |
| `CommandBus` | Implementation of the Command Bus pattern. |
| `EventBus` | Implementation of the Publish-Subscribe pattern for event streams. |
| `EventSourcedAggregate` | Interface and trait for event-sourced aggregates. |
| `EventSourcedAggregateStore` | `AggregateStore` adapter for event-sourced aggregates persistence. |
| `EventStore` | Persistence for event streams. |
| `EventStoreReductionInspection` | Output single value from `EventStore` inspection. |
| `EventStream` | Event streams for event-sourced aggregates. |
| `LaravelCacheProjectionStore` | Laravel Cache adapter for `ProjectionStore`. |
| `MemcachedProjectionStore` | Memcached adapter for `ProjectionStore`. |
| `ObjectSerializer` | Interface for object serialization. |
| `Pdo` | Decorating interface for PHP Data Objects (PDO). |
| `PdoAggregateStore` | PDO adapter for `AggregateStore`. |
| `PdoEventStore` | PDO adapter for `EventStore`. |
| `PdoProjectionStore` | PDO adapter for `ProjectionStore`. |
| `PdoProxy` | Lazy-connecting PDO proxy. |
| `Problem` | Interface for Problem Details aware exceptions. |
| `Projection` | Interface for projections. |
| `ProjectionStore` | Persistence for projections. |
| `ReflectionObjectSerializer` | Reflection-based adapter for `ObjectSerializer`. |
| `Scenario` | Testing infrastructure on top of PHPUnit. |
| `SnapshotAggregateStoreMiddleware` | `AggregateStore` middleware for event-sourced aggregate snapshots. |
| `StreamEnricher` | Interface for event stream enrichers. |
| `StreamEnricherEventBusMiddleware` | `EventBus` middleware for event stream enrichment with `StreamEnricher`. |
| `StreamEnricherEventStoreMiddleware` | `EventStore` middleware for event stream enrichment with StreamEnricher`. |
| `StreamPublishingInspection` | Publish event streams from `EventStore` inspection. |
| `Uuid` | Universally Unique IDentifier (UUID) generation. |
## Testing
```bash
$ vendor/bin/phpunit
```
## Credits
- [Maxime Gosselin](https://github.com/maximegosselin)
## License
The MIT License (MIT). Please see [License File](LICENSE) for more information.