Skip to content

Polygot event-sourcing infrastructure including modular event-store with support for different DBs.

License

Notifications You must be signed in to change notification settings

syntropic137/event-sourcing-platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

158 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Event Sourcing Platform

A comprehensive event sourcing platform that packages a robust event store with higher-level event sourcing abstractions. This platform provides reliable, robust, and flexible packages for implementing event sourcing in different applications, with progressive examples serving as living documentation.

CI CodeQL License: Apache 2.0

๐Ÿ“‹ Table of Contents

๐Ÿ—๏ธ Architecture Overview

The platform is organized into distinct contexts following Domain-Driven Design principles:

event-sourcing-platform/
โ”œโ”€โ”€ event-store/           # Rust event store service, gRPC server, and client SDKs
โ”‚   โ”œโ”€โ”€ eventstore-core/       # Shared traits, errors, protobuf types
โ”‚   โ”œโ”€โ”€ eventstore-backend-*/  # Memory + Postgres backends
โ”‚   โ””โ”€โ”€ eventstore-bin/        # gRPC server binary
โ”œโ”€โ”€ event-sourcing/        # Event sourcing SDKs and abstractions
โ”‚   โ”œโ”€โ”€ rust/                  # Rust SDK (alpha)
โ”‚   โ”œโ”€โ”€ typescript/            # TypeScript SDK (stable)
โ”‚   โ””โ”€โ”€ python/                # Python SDK (beta)
โ”œโ”€โ”€ vsa/                   # Vertical Slice Architecture Manager (beta)
โ”‚   โ”œโ”€โ”€ vsa-core/             # Core Rust library
โ”‚   โ”œโ”€โ”€ vsa-cli/              # CLI tool
โ”‚   โ””โ”€โ”€ vsa-wasm/             # WASM bindings for Node.js
โ”œโ”€โ”€ examples/              # TypeScript "living documentation" examples
โ”‚   โ”œโ”€โ”€ 001-basic-store-ts/    # Direct event store usage
โ”‚   โ”œโ”€โ”€ 002-simple-aggregate-ts/
โ”‚   โ”œโ”€โ”€ โ€ฆ
โ”‚   โ””โ”€โ”€ 009-web-dashboard-ts/
โ”œโ”€โ”€ dev-tools/             # Local Postgres/Redis helper scripts and Docker Compose
โ”œโ”€โ”€ infra-as-code/         # Terraform + Ansible scaffolding (work in progress)
โ”œโ”€โ”€ docs-site/             # Docusaurus documentation site (work in progress)
โ””โ”€โ”€ docs/                  # Project notes and supporting docs

๐Ÿš€ Quick Start

Prerequisites

  • Rust (latest stable) - for the event store
  • Node.js (18+) - for TypeScript SDK and examples
  • Python (3.8+) - for Python SDK and examples
  • Docker - for development services
  • PostgreSQL - for persistent storage (via Docker)

Setup

  1. Clone and enter the repository:

    git clone https://github.com/<org>/event-sourcing-platform.git
    cd event-sourcing-platform
  2. Install workspace dependencies (pnpm 9+ recommended):

    pnpm -w install
  3. Start local infrastructure (PostgreSQL + Redis) โ€“ optional:

    make dev-start      # or `make start-services` for the lightweight compose stack
  4. Build and smoke-test the platform:

    make build
    make smoke-test     # runs the Rust event-store smoke check

Try the Examples

Start with the progressive learning examples:

# Basic event store usage (no event sourcing)
make examples-001

# Simple event sourcing with one aggregate
make examples-002

# Multiple aggregates working together
make examples-003

๐Ÿ”ง Core Components

Event Store Context

Purpose: Pure event storage and retrieval
Dependencies: None (standalone)
Technology: Rust with gRPC API

The event store provides:

  • โœ… Durable event storage with optimistic concurrency
  • โœ… Client-proposed sequence numbers (true optimistic concurrency)
  • โœ… Multiple backends (memory, PostgreSQL)
  • โœ… gRPC API with protocol buffer definitions
  • โœ… Basic client libraries for multiple languages
cd event-store
make help

Event Sourcing Context

Purpose: Event sourcing patterns and abstractions
Dependencies: Event Store context
Technology: Multi-language SDKs (Rust, TypeScript, Python)

The event sourcing SDKs provide:

  • ๐Ÿ”„ Aggregate abstractions and lifecycle management
  • ๐Ÿ”„ Command/Event handling patterns
  • ๐Ÿ”„ Repository pattern implementations
  • ๐Ÿ”„ Projection and read model management
  • ๐Ÿ”„ Rich developer experience with type safety
cd event-sourcing
make help

Examples Context

Purpose: Living documentation and progressive learning
Dependencies: Event Store + Event Sourcing contexts
Technology: Real applications with no mocks

The examples demonstrate:

  • ๐Ÿ“š Progressive learning from basics to complete systems
  • ๐Ÿ“š Real working code with actual databases
  • ๐Ÿ“š Docker Compose setups for easy experimentation
  • ๐Ÿ“š Best practices and patterns
  • ๐Ÿ“š Performance considerations
cd examples
make help

๐Ÿ“š Examples

All examples are implemented in TypeScript. They default to the gRPC event store provided by dev-tools; append -- --memory to run against the in-memory client.

Example Status Highlights Link
002-simple-aggregate-ts โœ… Ready Aggregate decorators, repository pattern README
004-cqrs-patterns-ts โœ… Ready Separate write/read models with projections README
007-ecommerce-complete-ts ๐Ÿšง In Progress Full e-commerce workflow implementation README

Run an example with:

make examples-002           # replace with desired example number
# or directly with pnpm:
pnpm --filter ./examples/002-simple-aggregate-ts run start -- --memory

๐Ÿ› ๏ธ Development

Build Commands

# Build everything
make build

# Build specific components
make event-store
make event-sourcing
make examples
make tools

Testing

# Run all tests
make test

# Test specific components
make test-event-store
make test-event-sourcing
make test-examples

Quality Assurance

# Run QA checks on everything
make qa

# QA specific components
make qa-event-store
make qa-event-sourcing
make qa-examples

Service Management

# Start development services (PostgreSQL, etc.)
make start-services

# Stop development services
make stop-services

# Run smoke tests against services
make smoke-test

๐Ÿงช Testing

Current automated coverage focuses on the pieces that ship today:

  • Rust event store โ€“ cargo unit + integration tests cover the core traits, in-memory backend, Postgres backend, and gRPC server wiring. Postgres tests automatically spin up Testcontainers when a local database is not available.
  • TypeScript event-sourcing SDK โ€“ Jest tests validate aggregate lifecycle, optimistic concurrency, and event serialisation helpers.

Planned additions (not yet automated):

  • Cross-language SDK compatibility suites (Rust โ†”๏ธŽ TypeScript โ†”๏ธŽ future Python).
  • Example-level end-to-end checks and smoke tests for each scenario.
  • Performance/stress benchmarks and observability regression tests.

๐ŸŽฏ Core Principles

  1. Domain Focus: Event Store and Event Sourcing define the rules of the event sourcing domain
  2. Living Documentation: Examples demonstrate how to use core packages to build real applications
  3. Progressive Learning: Examples build from basic concepts to complete systems
  4. No Mocks: All examples use real working code with actual databases
  5. Future Extensibility: Architecture supports future event modeling and code generation

๐Ÿ”ฎ Future Plans

Event Modeling Package

  • Code generation from event models
  • Domain-specific language for event modeling
  • Multi-language code generation
  • Scaffolding and boilerplate reduction

Additional Backends

  • KurrentDB backend
  • Kafka backend
  • EventStoreDB adapter
  • Custom backend implementations

Enhanced Tools

  • Advanced CLI features
  • Web UI enhancements
  • Code generation tools
  • Event modeling tools

๐Ÿ“– Documentation

Each component has comprehensive documentation:

๐Ÿค Contributing

We welcome contributions! Please see our contributing guidelines and code of conduct.

Getting Started

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Run make qa to ensure quality
  6. Submit a pull request

Development Workflow

  1. Run make setup for initial setup
  2. Use make dev-setup for development environment
  3. Use make build and make test during development
  4. Use make qa before submitting changes

๐Ÿ“„ License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

๐Ÿท๏ธ Status

  • โœ… Event Store (Rust) โ€“ Memory and Postgres backends with a production-ready gRPC surface.
  • โœ… TypeScript SDK โ€“ Drives all current examples; adding richer patterns iteratively.
  • ๐Ÿ”„ Rust SDK โ€“ Early alpha; core abstractions present, feature parity in progress.
  • ๐Ÿ”„ Python SDK โ€“ Beta. Core abstractions, repository pattern, projections, and gRPC integration implemented.
  • ๐Ÿ”„ VSA Tool โ€“ Beta. Core library, CLI, WASM bindings, and VSCode extension for vertical slice architecture management. See vsa/README.md for details.
  • โœ… Examples โ€“ TypeScript examples 002 (simple aggregate), 004 (CQRS patterns) are ready. Example 007 (e-commerce) is in progress.
  • ๐Ÿšง Infra-as-code & docs-site โ€“ Module scaffolding exists; provider-specific stacks and walkthroughs are being built.

๐Ÿ“š Inspiration & References

This platform draws inspiration from and builds upon the work of leading event sourcing practitioners:


This platform serves as a comprehensive foundation for event sourcing applications, providing both the low-level event storage and high-level patterns needed to build robust, scalable systems.

About

Polygot event-sourcing infrastructure including modular event-store with support for different DBs.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •