Skip to content

API created using clean arc and some design patterns.

Notifications You must be signed in to change notification settings

BrunoSzczuk/hello-pizza-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hello Pizza - API

This is a Kotlin project that is responsible for creating and maintaining a basic pizzeria routine.

  • This project was not intended to be a commercial application, but just to practice some cool features.
  • This project was inspired from a friend of mine project Authorizer.

The MVP

With this API, I would like to create a full reactive api, in which I will create a chatbot and also an Angular app that consumes the resources and provides a full use of the pizzeria routine for a normal consumer and even to an administrator.
The main objective is to create an "omnichannel API" that can be consumed by any application that wants to be integrated with this API.

Project details

Design

The project design is based on the Clean Architecture, the _ SOLID_ principles and some design patterns.

Design based on Clean architecture

As you can see in the diagram above, the project was separated into the following layers:

  • Entrypoint Layer:

    • Responsible for communication with the user.
    • Processes the input entered, generates a command, calls the Core layer and returns result to the user.
  • Core Layer:

    • Responsible for encapsulate and implement all the business rules into use cases and entities and it has no dependencies with other layers.
    • The use cases orchestrate the flow of data to and from the entities, and direct those entities to use their enterprise wide business rules to achieve the goals of the use case.
    • The use cases combine data from 1 or multiple gateway interfaces, which are implemented in the Data Provider layer.
  • Data Provider Layer:

    • Responsible to coordinate data from the different Data Sources.
    • Implements the Domain Gateway Interface and is in charge of combining 1 or multiple Repositories.

Patterns

The project uses the Command pattern to simplify communication between entrypoint and core layers. That way, any new type of entrypoint or operation just needs to know how to create the related command. After that, just dispatch the command to the command handler. More details, see SizeResultCommandUseCase

The project creates a chain with all validations rules related with each use case that changes the account state, using the Chain of Responsibility pattern. More information at ValidateRule.

Releases

No releases published

Packages

No packages published

Languages