Skip to content

streakphp/streak

Repository files navigation

Streak

Streak PHP - Event Sourcing Framework

CI codecov

Streak is a PHP framework designed for building applications using the Event Sourcing pattern. It provides a robust foundation for creating event-sourced, domain-driven applications with a focus on flexibility and testability.

Features

  • Event Sourcing - Persistent event store with support for various storage backends
  • Command Handling - Type-safe command processing with built-in validation
  • Subscriptions - Reliable event delivery system with support for resuming, restarting, and pausing
  • Projections - Tools for building read models optimized for querying
  • Saga & Process Management - Support for long-running business processes across multiple aggregates

Installation

Install via Composer:

composer require streak/streak

For Symfony integration, install the Streak Bundle:

composer require streak/streak-bundle

Documentation

Comprehensive documentation is available in the docs directory:

Development

Requirements

  • PHP 8.0+
  • Docker and Docker Compose

Running locally

Clone the repository:

git clone https://github.com/streakphp/streak.git
cd streak

Start the development environment:

docker-compose up --detach --build

Running tests and checks

# Validate composer.json
docker compose run --rm --no-deps php composer validate --strict --no-interaction --ansi

# Install dependencies
docker compose run --rm --no-deps php composer install --no-scripts --no-interaction --ansi

# Run tests with coverage
docker compose run --rm --no-deps php xphp -dxdebug.mode=coverage bin/phpunit --color=always --configuration=phpunit.xml.dist

# Run tests without coverage
docker compose run --rm --no-deps php bin/phpunit

# Check code quality
docker compose run --rm --no-deps php bin/rector --dry-run --ansi
docker compose run --rm --no-deps php bin/deptrac --no-interaction --cache-file=./build/.deptrac/.deptrac.cache --ansi
docker compose run --rm --no-deps php bin/php-cs-fixer fix --diff --dry-run --ansi --config=.php-cs-fixer.dist.php

License

Streak is open-sourced software licensed under the MIT license.