Little games - soon to be a collection of different simple games APIs. Games:
- Bulls and Cows
In this game your objective is to guess a word, hidden by system, using similar structured words and having in return amount of "Bulls" and "Cows" in your guess, where "bulls" are letters that belong to both hidden word and your guess and have same index in both, amd "Cows" are letters that belong to both hidden word and your guess, but have different indexes.
For reference - consider it a Wordle, but without information on which letter is green and which is yellow, just the amount of each.
- Single-player vs Computer
- Multiplayer: fastest wins
- Multiplayer: step-by-step
Module api-layer
consists of endpoints and other interfaces, for service to be accessible and respective controllers.
Module data-layer
consists of data access objects, such as database repositories or another backends http
repositories.
Module domain
just contains business data-classes and some generic utils
Module service-layer
consists of services - objects, that perform main logic. There are two types of services there -
application services and domain services. Domain services are those, which contain almost exclusively pure functions, do
not have any state and just perform business logic. Application services perform complex logic of routing or caching
etc.
Module main
is just convenient entry point - everything is interconnected and built there.
flowchart TD
subgraph service-layer
direction TB
service-layer-application --> service-layer-domain
end
main --> api-layer
main --> data-layer
api-layer --> service-layer
main --> service-layer
api-layer --> domain
service-layer --> domain
data-layer --> service-layer
data-layer --> domain
- data-layer depends on service layer, because repositories' interfaces are in service layer. Not the other way round, because it is strange for service-layer to have transitive dependency on postgresql.