Home

Awesome

Getting started with Commanded

This Commanded demo application focuses around a simple giftcard domain, designed to show how to configure and use the library.

It is heavily inspired by the Axon Framework demo application.

Domain model

There are just two events in the lifecycle of a gift card:

  1. Issued: a new gift card gets created with some amount of money stored.
  2. Redeemed: all or part of the monetary value stored on the gift card is used to purchase something.

Running the demo locally

  1. Clone the git repo:

    git clone https://github.com/slashdotdash/gift-card-demo.git
    
  2. Get mix dependencies:

    mix deps.get
    
  3. Create and initialise the database:

    mix setup
    

Database

In this demo the write (event store) and read (projections) models share the same database (named giftcard_<env>). In a production environment you might choose to configure and use two separate databases, one for each model.