The purpose of the project is to provide an API to manage recipes and ingredients in order to filter for recipes by ingredients.
The API is composed of two parts, the first is an REST API
that helps to manage the searches and storage related to recipes and the second is a CLI
helps to fill the recipe storage.
See the required environment variables
go install github.com/yael/cook-cook/cmd/cook-book-cli@latest
cook-book-cli
go install github.com/yael-castro/cook-book/cmd/cook-book-http@latest
cook-book-http
All compiled binaries will put in the build
directory
make cli
./build/cook-book-cli
make http
./build/cook-book-http
This project contains some bash scripts to help to make some operations like compile. See bash scripts
This project implements architecture pattern Ports and Adapters
Interpreting what Vertical Slicing says, I decided to make one package per feature and put a little of each layer in each package.
I decided to follow the Go Project Layout Standard.
According to the theory of hexagonal architecture, it is possible to have n adapters for different external signals (http, gRPC, command line).
For example one use case is to create a recipe, but the instruction comes from a http request or a kafka message.
So I decided to compile a binary to handle each signal.
.
├── cmd
│ └── {binary}
├── internal
│ ├── app
│ │ └── {feature}
│ │ ├── business (Use cases, rules, data models and ports)
│ │ └── infrastructure
│ │ ├── input (Everything related to "driving" adapters)
│ │ └── output (Everything related to "driven" adapters)
│ └── container (DI container)
└── pkg (Public and global code, potencially libraries)