Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
frankdejonge committed Oct 15, 2022
1 parent c541bcf commit 4b00ff3
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 8 deletions.
6 changes: 2 additions & 4 deletions docs/_data/menu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ Stop Russia's Aggression:
Support Ukraine: https://savelife.in.ua/en/

Getting Started:
1. Create an Aggregate Root: '/docs/event-sourcing/create-an-aggregate-root/'
2. Create Events and Commands: '/docs/event-sourcing/create-events-and-commands/'
3. Configure Persistence: '/docs/event-sourcing/configure-persistence/'
4. Bootstrap: '/docs/event-sourcing/bootstrap/'
Intro and install: '/docs/getting-started/introduction/'
1. Create an Aggregate Root: '/docs/getting-started/create-aggregate-root/'

Serialization:
Object Mapper: '/docs/serialization/object-mapper/'
Expand Down
1 change: 0 additions & 1 deletion docs/docs/event-sourcing/1-creating-an-aggregate-root.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
permalink: /docs/event-sourcing/create-an-aggregate-root/
redirect_from: /docs/getting-started/create-an-aggregate-root/
title: Creating an Aggregate Root
---

Expand Down
1 change: 0 additions & 1 deletion docs/docs/event-sourcing/2-create-events-and-commands.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
permalink: /docs/event-sourcing/create-events-and-commands/
redirect_from: /docs/getting-started/create-events-and-commands/
title: Create events and commands
---

Expand Down
1 change: 0 additions & 1 deletion docs/docs/event-sourcing/3-configure-persistence.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
permalink: /docs/event-sourcing/configure-persistence/
redirect_from: /docs/getting-started/configure-persistence/
title: Configure Persistence
---

Expand Down
1 change: 0 additions & 1 deletion docs/docs/event-sourcing/4-bootstrap.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
permalink: /docs/event-sourcing/bootstrap/
redirect_from: /docs/getting-started/bootstrap/
title: Bootstrap
alternate_title: Bootstrapping EventSauce
---
Expand Down
29 changes: 29 additions & 0 deletions docs/docs/getting-started/0-getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
permalink: /docs/getting-started/introduction/
redirect_from: /docs/getting-started/
title: Getting Started
---

EventSauce is a pragmatic yet robust event sourcing library for PHP. At the heart of the library
are a set of simple interfaces that make it easy to adapt many types of infrastructure. A set of
ready-made components is there to speed up implementation. This guide will walk you through
the steps needed to set yourself up to start event sourcing. The guide will only focus on
what is relevant to setting up the library. Although there are some framework bindings available,
this guide will use a framework-agnostic point of view. You are expected to make the translation
on how to configure this in your framework of choice.

In this guide we'll walk to initial setup, setting up tests for your aggregates, and wiring it
to infrastructure. Let's get started!

## Installation

To get started, first install EventSauce into your PHP project using
[composer](https://getcomposer.org).

```bash
composer require eventsauce/eventsauce
```

This package contains the core of EventSauce, the interfaces, and generic tools.

Next up, create your first [aggregate root](/docs/getting-started/create-aggregate-root/)!
22 changes: 22 additions & 0 deletions docs/docs/getting-started/1-create-your-aggregate-root.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
permalink: /docs/getting-started/create-aggregate-root/
title: Create an Aggregate Root
---

Our first step is to create an event-sourced aggregate root. This is the software model
we'll create that internally uses events. The aggregate root has functionality to rebuild
itself from stored events. It also has functionality to record and expose new events.

EventSauce represents an aggregate root internally as an interface. Your model will be an
implementation of that interface. To make it easy, a default implementation is supplied in
the form of a trait, preventing you from having to write some boilerplate code.

```php
use EventSauce\EventSourcing\AggregateRoot;
use EventSauce\EventSourcing\AggregateRootBehaviour;

class YourAggregateRoot implements AggregateRoot
{
use AggregateRootBehaviour;
}
```

0 comments on commit 4b00ff3

Please sign in to comment.