RealWorld example backend implementing the CQRS/ES pattern in Elixir and Phoenix
Discover why functional languages, such as Elixir, are ideally suited to building applications following the command query responsibility segregation and event sourcing (CQRS/ES) pattern.
Conduit is a blogging platform, an exemplary Medium.com clone, built as a Phoenix web application.
This is the full source code to accompany the "Building Conduit" eBook.
This book is for anyone who has an interest in CQRS/ES and Elixir. It demonstrates step-by-step how to build an Elixir application implementing the CQRS/ES pattern using the Commanded open source library.
Conduit is an Elixir application using Phoenix 1.4 and PostgreSQL for persistence.
You must install the following dependencies before starting:
Clone the Git repo from GitHub:
$ git clone https://github.com/slashdotdash/conduit.git
Install mix dependencies:
$ cd conduit $ mix deps.get
Create the event store database:
$ mix do event_store.create, event_store.init
Create the read model store database:
$ mix do ecto.create, ecto.migrate
Run the Phoenix server:
$ mix phx.server
This will start the web server on localhost, port 4000: http://0.0.0.0:4000
This application only includes the API back-end, serving JSON requests.
You need to choose a front-end from those listed in the RealWorld repo. Follow the installation instructions for the front-end you select. The most popular implementations are listed below.
Any of these front-ends should integrate with the Conduit back-end due to their common API.
MIX_ENV=test mix event_store.create MIX_ENV=test mix event_store.init MIX_ENV=test mix ecto.create MIX_ENV=test mix ecto.migrate mix test
Please submit an issue if you encounter a problem, or need support.