A "from scratch" PHP-based implementation of Event-Sourcing

Overview

EventSourcing Workshop

In here, you will find a "from scratch" PHP-based implementation of Event-Sourcing, kept to a minimum on purpose, to allow workshop attendees to explore and experiment with its concepts.

DISCLAIMER: Not a production project

This is not a library nor production-ready project: this is an educational project. Its target audience is students and backend engineers that want to get better at abstracting/maintaining business logic.

Knowledge required

To work in this project, you need some rough knowledge about:

  • php
    • you should be familiar with php's syntax
    • the provided test suite and tooling should help you prevent mistakes, but you should have basic knowledge of how php runs and fails.
    • we use functional and object-oriented paradigms: you may be up for a crash-course, if you never saw code structured this way.
  • composer
    • php class autoloading and dependency installation is handled for you, but if something goes wrong, you should know some composer basics
  • sql
    • the entire workshop is based on SQLite databases: it's just files, but you need to know some very basic SQL
  • make
    • most repetitive tasks have been added to a Makefile: run make to see what's available
  • docker and docker-compose
    • to ensure everyone runs on the same environment, we run tests inside a docker container. Building images and starting/stopping containers is sufficient: we will not use any advanced docker features
    • don't worry too much if you don't: the Makefile should abstract most docker stuff away

Firing it up

Run:

make composer-install
make quality-assurance
make interactive-shell

Architecture


Exercises

Note: all exercises are under the watchful eye of static analysis and CS tooling. Use make quality-assurance to validate your current work!

  1. Standalone recording of a temperature
  2. Tracking the last recorded temperature at each location
  3. Tracking the average recorded temperature at each location, but in the database
  4. Send an alert when the temperature is below freezing point
  5. Payment aggregate
  6. Collaborative event-sourcing:
    • TODO: idea of mapping a speed-trap fine management process
    • TODO: idea of mapping a hotel reservation + stay process

License

This software is proprietary: please contact the author for permission to use, but for now, these sources are not freely reusable outside educational purposes. Yes: you are reading correctly, this is not MIT/BSD software :-P

Comments
Owner
Marco Pivetta
@Roave, @laminas and @doctrine. Pushing for better practices in the PHP ecosystem.
Marco Pivetta
Psalm plugin for patchlevel/event-sourcing

event-sourcing-psalm-plugin psalm plugin for event-sourcing library. installation composer require --dev patchlevel/event-sourcing-psalm-plugin confi

patchlevel 4 Dec 14, 2022
Because every Wedding RSVP website needs to follow DDD, CQRS, Hexagonal Architecture, Event Sourcing, and be deployed on Lambda.

Our Wedding Website Because every Wedding RSVP website needs to follow DDD, CQRS, Hexagonal Architecture, Event Sourcing, and be deployed on Lambda. ?

Edd Mann 3 Aug 21, 2022
The easiest way to get started with event sourcing in Laravel

Event sourcing for Artisans ?? This package aims to be the entry point to get started with event sourcing in Laravel. It can help you with setting up

Spatie 591 Jan 4, 2023
Learning about - Basic HTML & CSS, JSON, XML, Session & Cookies, CRUD Operations in Php using MySQL and Create MVC from scratch

This Project is based on course CSC 3215. Learning about - Basic HTML & CSS, JSON, XML, Session & Cookies, CRUD Operations in Php using MySQL and Create MVC (Model–View–Controller) from scratch. Just learning about web technologies, Not focusing on UI (Bootstrap or other 3rd-Party UI libraries or frameworks).

Alvi Hasan 5 Sep 21, 2022
Learn how to deploy Laravel 7 project in GCP from scratch

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Almujeer Uddin 2 Nov 21, 2021
This library is an implementation of League\Event for Slim Framework

Slim Event Dispatcher This library is an implementation of League\Event for Slim Framework. This works with the latest version of Slim (V3). Installat

Aneek Mukhopadhyay 7 Aug 23, 2022
A Laravel artisan based package to create the AWS (SES + SNS) infrastructure to receive email event notifications with Http/Https endpoint.

Laravel SES Tracking Setup the AWS infrastructure to handle email events using SES/SNS and http/s endpoints with a single Laravel artisan command. Thi

null 11 Apr 26, 2022
JsonCollectionParser - Event-based parser for large JSON collections (consumes small amount of memory)

Event-based parser for large JSON collections (consumes small amount of memory). Built on top of JSON Streaming Parser This packa

Max Grigorian 113 Dec 6, 2022
True coroutines for PHP>=8.1 without worrying about event loops and callbacks.

Moebius Pure coroutines for PHP 8.1. To promises and callbacks needed. Just pure parallel PHP code inside coroutines. Moebius Band: A loop with only o

Frode Børli 204 Dec 21, 2022
True coroutines for PHP>=8.1 without worrying about event loops and callbacks.

Moebius Pure coroutines for PHP 8.1. No promises and callbacks needed. Just pure parallel PHP code inside coroutines. Moebius Band: A loop with only o

Moebius for PHP 141 Jun 16, 2022
A high-performance event loop library for PHP

?? A high-performance event loop library for PHP ??

workbunny 13 Dec 22, 2022
PHP Event Emitter

InitPHP EventEmitter This library has been designed to emit events in its simplest and simplest form. Requirements PHP 5.6 or higher Installation comp

InitPHP 0 Jul 9, 2022
Php-file-iterator - FilterIterator implementation that filters files based on a list of suffixes, prefixes, and other exclusion criteria.

php-file-iterator Installation You can add this library as a local, per-project dependency to your project using Composer: composer require phpunit/ph

Sebastian Bergmann 7.1k Jan 3, 2023
This is a JSONPath implementation for PHP based on Stefan Goessner's JSONPath script.

JSONPath for PHP This is a JSONPath implementation for PHP based on Stefan Goessner's JSONPath script. JSONPath is an XPath-like expression language f

Sascha Greuel 100 Dec 30, 2022
An Infection + Last Man Standing Event plugin written for OwnagePE

KitPvPEvent An Infection + Last Man Standing Event plugin written for OwnagePE This plugin was a speedcode. I kinda woke up really late on the day I w

OwnagePE Network 2 May 26, 2022
Notify instructors about unconfirmed event registrations.

SAC Event Registration Reminder Folgende Idee: Es wird ein Reminder-Tool benötigt, welches Tourenleitende und Bergführer/innen per E-Mail daran erinne

Marko Cupic 2 Apr 25, 2022
Implement event systems, signal slots, intercepting filters, and observers.

zend-eventmanager Repository abandoned 2019-12-31 This repository has moved to laminas/laminas-eventmanager. zend-eventmanager is designed for the fol

Zend Framework 1.7k Dec 9, 2022
Allows installing Drupal extensions event if not compatible with installed drupal/core package

mglaman/composer-drupal-lenient Lenient with it, Drupal 10 with it. Why? The Drupal community introduced a lenient Composer facade that modified the d

Matt Glaman 14 Dec 18, 2022
Command and event buses interface and logic.

CoreBus - Command and Event buses interfaces Discrete command bus and domain event dispatcher interfaces for message based architectured projects. Dis

Makina Corpus 0 Feb 7, 2022