https://github.com/slashdotdash/gift-card-demo
Commanded demo application focused around a simple giftcard domain.
https://github.com/slashdotdash/gift-card-demo
Last synced: over 1 year ago
JSON representation
Commanded demo application focused around a simple giftcard domain.
- Host: GitHub
- URL: https://github.com/slashdotdash/gift-card-demo
- Owner: slashdotdash
- License: mit
- Created: 2019-05-24T14:17:09.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T22:35:15.000Z (over 3 years ago)
- Last Synced: 2024-05-18T21:29:14.110Z (about 2 years ago)
- Language: Elixir
- Size: 1.1 MB
- Stars: 20
- Watchers: 4
- Forks: 3
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://github.com/AxonIQ/giftcard-demo/).
## 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:
```console
git clone https://github.com/slashdotdash/gift-card-demo.git
```
3. Get mix dependencies:
```console
mix deps.get
```
3. Create and initialise the database:
```console
mix setup
```
### Database
In this demo the write (event store) and read (projections) models share the same database (named `giftcard_`). In a production environment you might choose to configure and use two separate databases, one for each model.