PHPackages                             broadway/broadway-demo - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. broadway/broadway-demo

ActiveLibrary[Framework](/categories/framework)

broadway/broadway-demo
======================

Demo application that uses Broadway

0.3.0(6y ago)871929[1 PRs](https://github.com/broadway/broadway-demo/pulls)MITPHPPHP &gt;=7.2CI passing

Since Nov 30Pushed 7mo ago5 watchersCompare

[ Source](https://github.com/broadway/broadway-demo)[ Packagist](https://packagist.org/packages/broadway/broadway-demo)[ RSS](/packages/broadway-broadway-demo/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (5)Dependencies (10)Versions (7)Used By (0)

Demo for Broadway - EventSourcing library for PHP
=================================================

[](#demo-for-broadway---eventsourcing-library-for-php)

This repository contains a demo application to show how [Broadway](https://github.com/broadway/broadway) can be used within a Symfony application. The example is taken from the [Practical Event Sourcing](http://verraes.net/2014/03/practical-event-sourcing.markdown/) talk from [Mathias Verraes](https://twitter.com/mathiasverraes).

For simplicity the demo uses the official [DBAL event store](https://github.com/broadway/event-store-dbal) and a custom DBAL read model implementation. You will need to have [SQLite](https://www.sqlite.org/) installed to run the demo.

[![build status](https://github.com/broadway/broadway-demo/actions/workflows/ci.yml/badge.svg)](https://github.com/broadway/broadway-demo/actions/workflows/ci.yml/badge.svg)

Running the demo
----------------

[](#running-the-demo)

```
composer install
bin/console broadway:event-store:create
bin/console broadway:read-model:create
bin/console server:run

```

This demo doesn't have a GUI, only an API with the following endpoints:

MethodPathDescriptionPOST`/basket`Pick up a new basket, returns the basketIdPOST`/basket/{basketId}/addProduct`Add a product to a basket (productId and productName should be given as form fields)POST`/basket/{basketId}/removeProduct`Remove a product from a basket (productId as form field)POST`/basket/{basketId}/checkout`Check out a basketGET`/advice/{productId}`Retrieve *Other people also bought this* list```
# pick up a new basket
$ curl -X POST http://localhost:8000/basket
{
  "id":"1bd683ac-f75d-403f-babc-82ddcdb33de7"
}

# add products to the basket
$ curl -d "productId=2009&productName=Incredibad" -X POST http://localhost:8000/basket/1bd683ac-f75d-403f-babc-82ddcdb33de7/addProduct
$ curl -d "productId=2011&productName=Turtleneck+%26+Chain" -X POST http://localhost:8000/basket/1bd683ac-f75d-403f-babc-82ddcdb33de7/addProduct
$ curl -d "productId=2013&productName=The+Wack+Album" -X POST http://localhost:8000/basket/1bd683ac-f75d-403f-babc-82ddcdb33de7/addProduct

# remove a product from the basket
curl -d "productId=2009" -X POST http://localhost:8000/basket/1bd683ac-f75d-403f-babc-82ddcdb33de7/removeProduct

# check out the basket
$ curl -X POST http://localhost:8000/basket/1bd683ac-f75d-403f-babc-82ddcdb33de7/checkout

# get _Other people also bought this_ list
$ curl http://localhost:8000/advice/2011
{
  "purchasedProductId": 2011,
  "otherProducts": {
    "2009": 1,
    "2013": 1
  }
}
```

Running the tests
-----------------

[](#running-the-tests)

To run all the tests:

```
./vendor/bin/phpunit

```

Code structure
--------------

[](#code-structure)

- Domain code can be found in `src/Basket`
- ReadModel code can be found in `src/ReadModel`
- Controllers can be found in `src/Controllers`

Note that there are two files for the services: `services.yaml` and `domain.yaml`. `domain.yaml` contains all the domain-specific services (CommandHandler, ReadModels, Repositories), while `services.yaml` contains domain-unspecific services (controllers etc).

The domain specific tests can be found in `test/Basket` and `test/ReadModel`

Note that there is a functional test in `test/Functional`

For more information, read our blog post about this demo:

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance45

Moderate activity, may be stable

Popularity23

Limited adoption so far

Community25

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~298 days

Total

5

Last Release

2304d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e56158df0a7656e82c3fe2cee4d8173ef9c26fcd8882abd7dadfbdbd9eb93f89?d=identicon)[othillo](/maintainers/othillo)

---

Top Contributors

[![othillo](https://avatars.githubusercontent.com/u/2786663?v=4)](https://github.com/othillo "othillo (63 commits)")[![wjzijderveld](https://avatars.githubusercontent.com/u/450201?v=4)](https://github.com/wjzijderveld "wjzijderveld (15 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![cordoval](https://avatars.githubusercontent.com/u/328359?v=4)](https://github.com/cordoval "cordoval (4 commits)")[![akondas](https://avatars.githubusercontent.com/u/8239917?v=4)](https://github.com/akondas "akondas (2 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (2 commits)")[![fritsjanb](https://avatars.githubusercontent.com/u/1194777?v=4)](https://github.com/fritsjanb "fritsjanb (2 commits)")[![luismulinari](https://avatars.githubusercontent.com/u/33168?v=4)](https://github.com/luismulinari "luismulinari (2 commits)")[![wysow](https://avatars.githubusercontent.com/u/632747?v=4)](https://github.com/wysow "wysow (1 commits)")[![MarkRedeman](https://avatars.githubusercontent.com/u/1114829?v=4)](https://github.com/MarkRedeman "MarkRedeman (1 commits)")[![bestit-espendiller](https://avatars.githubusercontent.com/u/20165238?v=4)](https://github.com/bestit-espendiller "bestit-espendiller (1 commits)")[![ricbra](https://avatars.githubusercontent.com/u/872886?v=4)](https://github.com/ricbra "ricbra (1 commits)")[![ruudk](https://avatars.githubusercontent.com/u/104180?v=4)](https://github.com/ruudk "ruudk (1 commits)")[![rvdbogerd](https://avatars.githubusercontent.com/u/1301320?v=4)](https://github.com/rvdbogerd "rvdbogerd (1 commits)")[![asm89](https://avatars.githubusercontent.com/u/657357?v=4)](https://github.com/asm89 "asm89 (1 commits)")[![ivastly](https://avatars.githubusercontent.com/u/919655?v=4)](https://github.com/ivastly "ivastly (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/broadway-broadway-demo/health.svg)

```
[![Health](https://phpackages.com/badges/broadway-broadway-demo/health.svg)](https://phpackages.com/packages/broadway-broadway-demo)
```

###  Alternatives

[sulu/skeleton

Project template for starting your new project based on the Sulu content management system

29734.8k](/packages/sulu-skeleton)[kimai/kimai

Kimai - Time Tracking

4.8k8.7k1](/packages/kimai-kimai)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M378](/packages/easycorp-easyadmin-bundle)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M464](/packages/pimcore-pimcore)[oro/platform

Business Application Platform (BAP)

642140.7k104](/packages/oro-platform)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1175.2k](/packages/rcsofttech-audit-trail-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
