https://github.com/escalopa/goddd
A repo for practicing DDD pattern on golang
https://github.com/escalopa/goddd
ddd-architecture golang
Last synced: 2 months ago
JSON representation
A repo for practicing DDD pattern on golang
- Host: GitHub
- URL: https://github.com/escalopa/goddd
- Owner: escalopa
- Created: 2022-12-25T22:11:36.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-26T02:55:44.000Z (over 2 years ago)
- Last Synced: 2025-01-19T15:20:38.519Z (4 months ago)
- Topics: ddd-architecture, golang
- Language: Go
- Homepage:
- Size: 58.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# goddd ๐
A repo for practicing DDD pattern on golang
## What DDD ๐คจ
DDD stand for domain driven design, it's a pattern for designing software. It's a way to design software that is flexible and easy to maintain.
## Why DDD ๐ค
In big projects or projects that have a lot of features, it's hard to maintain the code. It's hard to add new features or fix bugs. And this is wehere DDD comes in place to make the software flexible and easy to maintain.
## Cafe DDD ๐ฎ
Cafe DDD is a project that I'm working on to practice DDD pattern on golang. It's a simple cafe management system.
This project has the following features:
- Add new product
- Add new customer
- Create orderThese of course are basic features, but they are enough to practice DDD pattern.
The DDD pattern is implemented to make the swap between packages easy. For example, if I want to change the database from mysql to postgres, I can do it easily by changing the implementation of the repository interface.
But in my case it's between memory repository & mongo repository.
## Packages structure ๐

| Package | Description |
|------------|---------------------------------------------------------------------|
| aggregate | Contains all project complex structures |
| entity | Contains all the basic (building blocks) structs |
| repository | Contains all the interfaces for the repositories(Customer, Product) |
| memory | Contains the implementation of the repositories in memory |
| service | Contains all the business logic |
| cmd | Contains the main file to run the application |## Run test ๐งช
```bash
go test ./... -v -cover
```