Skip to content
@tiny-blocks

Tiny Blocks

Implementations for Domain Driven Design building blocks and utility classes in PHP.

Tiny Blocks

Tiny Blocks is a set of small, focused, framework-agnostic PHP libraries. Each one solves a single problem and can be adopted on its own, without pulling in the rest.

The building blocks cover the parts most applications rewrite from scratch: collections, time, HTTP primitives and middleware, object mapping, structured logging, identifiers, encoding, arbitrary precision numbers, and value object contracts. Some go further and implement a known pattern end to end: the tactical building blocks of Domain Driven Design, and the Transactional Outbox.

The documentation of every library, how the libraries depend on each other, and search across all of them live at tiny-blocks.github.io.

To contribute, follow the contribution guidelines. Everyone who participates is governed by the code of conduct.

Pinned Loading

  1. tiny-blocks tiny-blocks Public

    The shared Claude Code configuration of the Tiny Blocks libraries: rules, hooks and skills.

    Python 6 1

  2. collection collection Public

    Models a type-safe, fluent collection API for PHP with eager and lazy pipelines over arrays, iterators, and generators.

    PHP 2

  3. building-blocks building-blocks Public

    Implements tactical DDD building blocks for PHP: entities, aggregate roots, domain events, snapshots, and upcasters.

    PHP 2

  4. outbox outbox Public

    Implements the Transactional Outbox pattern. Persists domain events atomically with aggregate state changes through a customizable table schema, reflection-based payload serialization, and built-in…

    PHP 2

  5. mapper mapper Public

    Maps PHP objects to and from arrays, JSON, and iterables through reflection and pluggable strategies.

    PHP 3

  6. docker-container docker-container Public

    Manages Docker containers programmatically for PHP, aimed at integration tests and disposable infrastructure.

    PHP 4

Repositories

Showing 10 of 23 repositories
  • building-blocks Public

    Implements tactical DDD building blocks for PHP: entities, aggregate roots, domain events, snapshots, and upcasters.

    tiny-blocks/building-blocks's past year of commit activity
    PHP 2 MIT 0 0 0 Updated Oct 21, 2026
  • outbox Public

    Implements the Transactional Outbox pattern. Persists domain events atomically with aggregate state changes through a customizable table schema, reflection-based payload serialization, and built-in support for event schema versioning.

    tiny-blocks/outbox's past year of commit activity
    PHP 2 MIT 0 0 0 Updated Oct 21, 2026
  • tiny-blocks.github.io Public

    The documentation site of Tiny Blocks, a set of small, focused, framework-agnostic PHP libraries.

    tiny-blocks/tiny-blocks.github.io's past year of commit activity
    CSS 0 MIT 0 0 0 Updated Oct 21, 2026
  • mapper Public

    Maps PHP objects to and from arrays, JSON, and iterables through reflection and pluggable strategies.

    tiny-blocks/mapper's past year of commit activity
    PHP 3 MIT 0 0 0 Updated Oct 21, 2026
  • http-logging Public

    PSR-15 middleware that logs HTTP request and response metadata with request duration.

    tiny-blocks/http-logging's past year of commit activity
    PHP 1 MIT 0 0 0 Updated Oct 21, 2026
  • http-error-handler Public

    PSR-15 error handler that maps thrown exceptions to structured JSON error responses with optional logging.

    tiny-blocks/http-error-handler's past year of commit activity
    PHP 1 MIT 0 0 0 Updated Oct 21, 2026
  • http-correlation-id Public

    Ensures every HTTP request has a correlation identifier propagated through requests, responses, and logs.

    tiny-blocks/http-correlation-id's past year of commit activity
    PHP 1 MIT 0 0 0 Updated Oct 21, 2026
  • collection Public

    Models a type-safe, fluent collection API for PHP with eager and lazy pipelines over arrays, iterators, and generators.

    tiny-blocks/collection's past year of commit activity
    PHP 2 MIT 0 0 0 Updated Oct 21, 2026
  • value-object Public

    Defines the default behavior contract for PHP value objects, with immutability and structural equality.

    tiny-blocks/value-object's past year of commit activity
    PHP 3 MIT 0 0 0 Updated Oct 21, 2026
  • time Public

    Models time as immutable value objects for PHP: instants, durations, periods, timezones, and time-of-day, all UTC-normalized.

    tiny-blocks/time's past year of commit activity
    PHP 2 MIT 0 0 0 Updated Oct 21, 2026

Top languages

Loading…

Most used topics

Loading…