Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve readme, index and getting started docs #440

Merged
merged 6 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ A lightweight but also all-inclusive event sourcing library with a focus on deve
* Everything is included in the package for event sourcing
* Based on [doctrine dbal](https://github.com/doctrine/dbal) and their ecosystem
* Developer experience oriented and fully typed
* [Snapshots](https://patchlevel.github.io/event-sourcing-docs/latest/snapshots/) system to quickly rebuild the aggregates
* Allow to [Split-Stream](https://patchlevel.github.io/event-sourcing-docs/latest/split_stream/) for big aggregates
* [Pipeline](https://patchlevel.github.io/event-sourcing-docs/latest/pipeline/) to export,import and migrate events
* [Projectionist](https://patchlevel.github.io/event-sourcing-docs/latest/projection/) to manage versioned projections
* [Upcast](https://patchlevel.github.io/event-sourcing-docs/latest/upcasting/) old events
* [Scheme management](https://patchlevel.github.io/event-sourcing-docs/latest/store/) and [doctrine migration](https://patchlevel.github.io/event-sourcing-docs/latest/migration/) support
* Dev [tools](https://patchlevel.github.io/event-sourcing-docs/latest/watch_server/) such as a realtime event watcher
* Automatic [snapshot](https://patchlevel.github.io/event-sourcing-docs/latest/snapshots/)-system to boost your performance
* [Split](https://patchlevel.github.io/event-sourcing-docs/latest/split_stream/) big aggregates into multiple streams
* Build-in [pipeline](https://patchlevel.github.io/event-sourcing-docs/latest/pipeline/) to export, import and migrate event streams
* Versioned and managed lifecycle of [projections](https://patchlevel.github.io/event-sourcing-docs/latest/projection/)
* Smooth [upcasting](https://patchlevel.github.io/event-sourcing-docs/latest/upcasting/) of old events
* Simple setup with [scheme management](https://patchlevel.github.io/event-sourcing-docs/latest/store/) and [doctrine migration](https://patchlevel.github.io/event-sourcing-docs/latest/migration/)
* Dev [tools](https://patchlevel.github.io/event-sourcing-docs/latest/watch_server/) like realtime event watcher
* Built in [cli commands](https://patchlevel.github.io/event-sourcing-docs/latest/cli/) with [symfony](https://symfony.com/)
* and much more...

Expand Down
29 changes: 14 additions & 15 deletions docs/pages/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ final class GuestIsCheckedOut

## Define aggregates

Next we need to define the aggregate. So the hotel and how the hotel should behave.
We have also defined the `create`, `checkIn` and `checkOut` methods accordingly.
These events are thrown here and the state of the hotel is also changed.
Next we need to define the hotel aggregate.
How you can interact with it, what events happen and what the business rules are.
For this we create the methods `create`, `checkIn` and `checkOut`.
In these methods the business checks are made and events are recorded.
Last but not least, we need the associated apply methods to change the state.

```php
use Patchlevel\EventSourcing\Aggregate\AggregateChanged;
Expand Down Expand Up @@ -298,10 +300,10 @@ $mailer = /* your own mailer */;
$serializer = DefaultEventSerializer::createFromPaths(['src/Domain/Hotel/Event']);
$aggregateRegistry = (new AttributeAggregateRootRegistryFactory)->create(['src/Domain/Hotel']);

$store = new DoctrineDbalStore(
$eventStore = new DoctrineDbalStore(
$connection,
$serializer,
$aggregateRegistry
$aggregateRegistry,
);

$hotelProjector = new HotelProjector($connection);
Expand All @@ -313,25 +315,22 @@ $projectorRepository = new ProjectorRepository([
$projectionStore = new DoctrineStore($connection);

$projectionist = new DefaultProjectionist(
$store,
$eventStore,
$projectionStore,
$projectorRepository
$projectorRepository,
);

$eventBus = SyncProjectionistEventBusWrapper::createWithDefaultLockStrategy(
DefaultEventBus::create([
new SyncProjectorListener($projectionist),
new SendCheckInEmailProcessor($mailer),
]),
$projectionist
$projectionist,
);

$repositoryManager = new DefaultRepositoryManager(
$aggregateRegistry,
$store,
SyncProjectionistEventBusWrapper::createWithDefaultLockStrategy(
$eventBus,
$projectionist
)
$eventStore,
$eventBus,
);

$hotelRepository = $repositoryManager->get(Hotel::class);
Expand All @@ -353,7 +352,7 @@ use Patchlevel\EventSourcing\Schema\DoctrineSchemaDirector;
$schemaDirector = new DoctrineSchemaDirector(
$connection,
new ChainSchemaConfigurator([
$store,
$eventStore,
$projectionStore
])
);
Expand Down
18 changes: 11 additions & 7 deletions docs/pages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ A lightweight but also all-inclusive event sourcing library with a focus on deve
* Everything is included in the package for event sourcing
* Based on [doctrine dbal](https://github.com/doctrine/dbal) and their ecosystem
* Developer experience oriented and fully typed
* [Snapshots](snapshots.md) system to quickly rebuild the aggregates
* Allow to [Split-Stream](split_stream.md) for big aggregates
* [Pipeline](pipeline.md) to export,import and migrate events
* [Projectionist](projection.md) to manage versioned projections
* [Upcast](upcasting.md) old events
* [Scheme management](store.md) and [doctrine migration](migration.md) support
* Dev [tools](watch_server.md) such as a realtime event watcher
* Automatic [snapshot](snapshots.md)-system to boost your performance
* [Split](split_stream.md) big aggregates into multiple streams
* Build-in [pipeline](pipeline.md) to export, import and migrate event streams
* Versioned and managed lifecycle of [projections](projection.md)
* Smooth [upcasting](upcasting.md) of old events
* Simple setup with [scheme management](store.md) and [doctrine migration](migration.md)
* Dev [tools](watch_server.md) like realtime event watcher
* Built in [cli commands](cli.md) with [symfony](https://symfony.com/)
* and much more...

Expand All @@ -27,3 +27,7 @@ composer require patchlevel/event-sourcing

* [Symfony](https://github.com/patchlevel/event-sourcing-bundle)
* [Psalm](https://github.com/patchlevel/event-sourcing-psalm-plugin)

!!! tip

Start with the [quickstart](./getting_started.md) to get a feeling for the library.
Loading