Skip to content

Latest commit

 

History

History
55 lines (30 loc) · 1.67 KB

Readme.md

File metadata and controls

55 lines (30 loc) · 1.67 KB

Architecture

Team developed by Hexagonal Architecture and Clean Architecture mindset especially Dependency Injection and S.O.L.I.D

microservice Structure

each project have two main part core and adapter.

core

core is the main part of our app and contains business rules , port, domain and dto. and port (dependencies model) at the

Usecase

usecase is a business rules but this component need other part for working well like dao we model other part in port and inject implementation of port on usecase you can find at the app/internal/core/usecase

Port

port is a model of our dependency you can find port on app/internal/core/port

DTO

dto or data transfer object is a standard for send and recive data from usecase

Adapter

each adapter is implementation of one port that injected in usecase we impliment somthing like query in this part.

This is an alt text.

THE GOLDEN RULE IS USECASE NOT DEPEND ON ANY THING

This is an alt text.

Database Migration

you can find database migration on app/assets

App lifecycle , What happens when we run cmd/main.go?

  1. Read configs from env vars
  2. In the second step we prepering our driven port like database. at the end of this step we have a implementation of driven port
    1. when we need local data in this step we have a database instance.
    2. when we need a data from other microservices we have sync or async commenication object like grpc or rabbitmq
  3. In the third step we call the usecase and pass objects of step 2 for use as dao in usecase
  4. In the last Pass usecase in the driver port implementation.