Giter Site home page Giter Site logo

cqrs-rs's Introduction

cqrs

cqrs is an event-driven framework for writing software that uses events as the "source of truth" and implements command–query responsibility separation (CQRS).

The framework is built around a few key concepts:

  • Events: The things that happened in the system
  • Aggregates: Projections of events that calculate a view of the current state of the system
  • Commands: Intentions which, when executed against an aggregate, may produce zero or more events, or which may be prohibited by the current state of an aggregate
  • Reactions: Processes that execute an action when certain events occur in the system

The framework is written to be applicable to a generic backend, with an implementation provided for a PostgreSQL backend.

For an example of how to construct a domain which includes aggregates, events, and commands, look at the cqrs-todo-core crate, which is a simple to-do list implementation.

The source repository also contains a binary in the cqrs-todoql-psql directory which demonstrates the use of the todo domain in concert with the PostgreSQL backend and a GraphQL frontend using the juniper crate.

Development

To build all crates in this repository:

cargo build

To test all crates and documentation:

cargo test

To compile documentation for the crates in the repository (remove --no-deps to also include documentation for dependencies; add --open to automatically open the documentation in a browser):

cargo doc --no-deps

This crate aims to support the wasm32-unknown-unknown target for the cqrs, cqrs-core, and cqrs-todo-core crates. To build against this target, execute:

cargo build --target=wasm32-unknown-unknown -p cqrs-core -p cqrs -p cqrs-todo-core

License

cqrs is openly-licensed under the Apache-2.0 license.

cqrs-rs's People

Contributors

faro808 avatar tyranron avatar ffuugoo avatar arsileluci avatar neoeinstein avatar xdarksome avatar ilslv avatar nwacky avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.