Getting started with our CoffeeCo system
Now that we understand what our business does, let’s begin to build a domain-driven system to satisfy all the requirements.
Let’s start by initializing a new Golang project:
- We will create a new project called
coffeecoin ourDevfolder using GoLand; you can use whichever IDE you like:
Figure 5.2 – Project creation screen in GoLand
- Next, we will create an
internalfolder with aloyaltyfolder inside, as follows:
Figure 5.3 – Our project structure so far
The internal folder is a special folder in Golang. Anything within the internal directory cannot be imported by other projects. This is a great fit for DDD as we do not want our domain code to be part of our public API. To automatically enforce this, we will be putting all our domain code inside this internal folder.
- Before we can write any code about the loyalty scheme, we need to define...