Arc for Elixir: an opinionated CQRS application framework for Phoenix and Plug, on Cratis Chronicle.
You declare what your application does as plain modules, and Arc serves it:
Arc.Command- a request struct with ahandle/2that decides and returns eventsArc.ReadModel- queries over a Chronicle read model, snapshot or observableArc.Application- the supervised runtime that discovers themArc.Plug- the Arc HTTP contract, so@cratis/arc,@cratis/arc.reactand Cratis Components work against it unchangedArc.LiveView- the same commands and queries, called in-process from LiveViewArc.ProxyGenerator- opt-in TypeScript proxies for ReactArc.Test- ExUnit scenarios that run the real pipelines
Summary
Functions
Builds a context for application from the given options.
Executes a command through the full pipeline.
A new UUID v4 string, for a command key such as a new author's id.
Executes a query of a read model by function name.
Functions
@spec context(module(), keyword()) :: Arc.Context.t()
Builds a context for application from the given options.
Executes a command through the full pipeline.
command is a command struct, or a {module, wire_map} pair to bind a wire map first.
Options
:principal,:tenant,:correlation_id,:causation_id,:metadata- context values:validate_only- authorize and validate without handling
@spec new_id() :: String.t()
A new UUID v4 string, for a command key such as a new author's id.
%RegisterAuthor{id: Arc.new_id(), name: "Ada"}
Executes a query of a read model by function name.
args are the declared parameters, as a map keyed by name (atoms or strings).
Options
- context options as for
execute/3 :page,:page_size,:sort_by,:sort_direction- seeArc.Pipeline.execute_query/5