{"id":15654777,"url":"https://github.com/freyskeyd/chekov","last_synced_at":"2025-04-11T23:21:58.199Z","repository":{"id":43201931,"uuid":"267391503","full_name":"Freyskeyd/chekov","owner":"Freyskeyd","description":"A CQRS/ES framework for building application in Rust","archived":false,"fork":false,"pushed_at":"2024-04-30T13:26:21.000Z","size":7573,"stargazers_count":26,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T19:12:11.725Z","etag":null,"topics":["cqrs","cqrs-es","eventsourcing","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Freyskeyd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-27T18:05:23.000Z","updated_at":"2024-04-30T13:26:24.000Z","dependencies_parsed_at":"2023-11-11T11:23:51.614Z","dependency_job_id":"f8386479-c6e6-4d3b-b265-4a7a9865b5a0","html_url":"https://github.com/Freyskeyd/chekov","commit_stats":{"total_commits":129,"total_committers":2,"mean_commits":64.5,"dds":0.1472868217054264,"last_synced_commit":"934a739ae363abb08bcbd30df8df486d9f9fe2f6"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freyskeyd%2Fchekov","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freyskeyd%2Fchekov/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freyskeyd%2Fchekov/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freyskeyd%2Fchekov/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Freyskeyd","download_url":"https://codeload.github.com/Freyskeyd/chekov/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248111938,"owners_count":21049576,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cqrs","cqrs-es","eventsourcing","rust"],"created_at":"2024-10-03T12:54:06.271Z","updated_at":"2025-04-11T23:21:58.179Z","avatar_url":"https://github.com/Freyskeyd.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eChekov\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n  A \u003ccode\u003eCQRS/ES\u003c/code\u003e framework for building application in \u003cstrong\u003eRust\u003c/strong\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \n  [![Actions Status](https://github.com/freyskeyd/chekov/workflows/CI/badge.svg)](https://github.com/Freyskeyd/chekov/actions) [![Coverage Status](https://coveralls.io/repos/github/Freyskeyd/chekov/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/Freyskeyd/chekov?branch=master) [![dependency status](https://deps.rs/repo/github/freyskeyd/chekov/status.svg)](https://deps.rs/repo/github/freyskeyd/chekov) [![Crates.io](https://img.shields.io/crates/v/chekov.svg)](https://crates.io/crates/chekov) [![doc.rs](https://docs.rs/chekov/badge.svg)](https://docs.rs/chekov) [![doc-latest](https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square)](https://freyskeyd.github.io/chekov/chekov/)\n\n\u003c/div\u003e\n\n## Table of Contents\n- [Features](#features)\n- [Getting started](#getting-started)\n- [FAQ](#faq)\n- [Need help?](#need-help)\n- [Contributing](#contributing)\n\n---\n\n## Features\n\n- `Postgres` EventStore backend\n- Dispatch `Command` to `Aggregate` or `CommandHandler`\n- Generate `Event` from `Aggregate` and persist them\n- Apply `Event` to `Aggregate`\n- Store and notify `Event` with subscriptions\n- Dispatch `Event` to `EventHandler`\n\n## Getting started\n\n### Choosing an EventStore backend\n\nChekov works only with `Postgres` backend for now (and `InMemory` for test purpose). The choice is easy to make!\n\nBut some more backends need to be implemented, [see the related issue](#14).\n\n### Defining Aggregates\n\nAn Aggregate is a struct that hold a domain state. Here's an example of a UserAggregate:\n\n```rust\n#[derive(Default, Aggregate)]\n#[aggregate(identity = \"user\")]\nstruct User {\n    user_id: Option\u003cUuid\u003e,\n    account_id: Option\u003cUuid\u003e,\n}\n\n/// Define an Executor for the `CreateUser` command\n/// The result is a list of events in case of success\nimpl CommandExecutor\u003cCreateUser\u003e for User {\n  fn execute(cmd: CreateUser, _state: \u0026Self) -\u003e Result\u003cVec\u003cUserCreated\u003e, CommandExecutorError\u003e {\n    Ok(vec![UserCreated {\n      user_id: cmd.user_id,\n      account_id: cmd.account_id,\n    }])\n  }\n}\n\n/// Define an Applier for the `UserCreated` event\n/// Applier is a mutation action on the aggregate\n#[chekov::applier]\nimpl EventApplier\u003cUserCreated\u003e for User {\n  fn apply(\u0026mut self, event: \u0026UserCreated) -\u003e Result\u003c(), ApplyError\u003e {\n    self.user_id = Some(event.user_id);\n    self.account_id = Some(event.account_id);\n\n    Ok(())\n  }\n}\n\n```\n\n### Defining Commands\n\nYou need to create a struct per command, any type of struct can implement `Command` but we advise to use struct for a better readability.\n\nA command can only produce (or not) one type of events and it targets a single Aggregate.\nA command must have a single and unique `identifier` that is used to route the command to the right target.\n\n```rust\n\n#[derive(Debug, Command)]\n#[command(event = \"UserCreated\", aggregate = \"User\")]\nstruct CreateUser {\n    #[command(identifier)]\n    user_id: Uuid,\n    account_id: Uuid,\n}\n```\n\n### Defining Events\n\nAn `Event` can be a `struct` or an `enum`.\n\n```rust\n#[derive(Event, Deserialize, Serialize)]\nstruct UserCreated {\n    user_id: Uuid,\n    account_id: Uuid,\n}\n```\n\n### Defining Saga\n\nNot implemented yet\n\n## FAQ\n\n### Does `Chekov` is production ready ?\n\nNo its not. Some critical part of the project are still not implemented and a lot of code needs to be refactored before that.\n\n## Need Help?\n\nFeel free to open issue in case of bugs or features requests. [Discussions](https://github.com/Freyskeyd/chekov/discussions) are also a great starts if you have issue that are not bugs nor features requests.\n\n## Contributing\n\nThe project is really early staged and have a lot of pending tasks, one major tasks is to produce a roadmap or some issues that can be used to expose the project vision. Feel free to open a [Discussions](https://github.com/Freyskeyd/chekov/discussions) around it if you want !\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreyskeyd%2Fchekov","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreyskeyd%2Fchekov","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreyskeyd%2Fchekov/lists"}