Skip to content

parhamAllahyar/sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages