Skip to content

Commit

Permalink
feat: ✨ supporting Inbox and Outbox Pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdihadeli committed Dec 17, 2023
1 parent dfa0d50 commit e0ec597
Show file tree
Hide file tree
Showing 473 changed files with 1,635 additions and 1,257 deletions.
93 changes: 46 additions & 47 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,36 @@ install-tools:

.PHONY: run-catalogs-write-service
run-catalogs-write-service:
@./scripts/run.sh catalog_write_service
@./scripts/run.sh catalogwriteservice

.PHONY: run-catalog-read-service
run-catalog-read-service:
@./scripts/run.sh catalog_read_service
@./scripts/run.sh catalogreadservice

.PHONY: run-order-service
run-order-service:
@./scripts/run.sh order_service
@./scripts/run.sh orderservice

.PHONY: build
build:
@./scripts/build.sh pkg
@./scripts/build.sh catalog_write_service
@./scripts/build.sh catalog_read_service
@./scripts/build.sh order_service
@./scripts/build.sh catalogwriteservice
@./scripts/build.sh catalogreadservice
@./scripts/build.sh orderservice

.PHONY: update-dependencies
update-dependencies:
@./scripts/update-dependencies.sh pkg
@./scripts/update-dependencies.sh catalog_write_service
@./scripts/update-dependencies.sh catalog_read_service
@./scripts/update-dependencies.sh order_service
@./scripts/update-dependencies.sh catalogwriteservice
@./scripts/update-dependencies.sh catalogreadservice
@./scripts/update-dependencies.sh orderservice

.PHONY: install-dependencies
install-dependencies:
@./scripts/install-dependencies.sh pkg
@./scripts/install-dependencies.sh catalog_write_service
@./scripts/install-dependencies.sh catalog_read_service
@./scripts/install-dependencies.sh order_service
@./scripts/install-dependencies.sh catalogwriteservice
@./scripts/install-dependencies.sh catalogreadservice
@./scripts/install-dependencies.sh orderservice

.PHONY: docker-compose-infra-up
docker-compose-infra-up:
Expand All @@ -44,33 +44,33 @@ docker-compose-infra-down:

.PHONY: openapi
openapi:
@./scripts/openapi.sh catalog_write_service
@./scripts/openapi.sh catalog_read_service
@./scripts/openapi.sh order_service
@./scripts/openapi.sh catalogwriteservice
@./scripts/openapi.sh catalogreadservice
@./scripts/openapi.sh orderservice

# https://stackoverflow.com/questions/13616033/install-protocol-buffers-on-windows
.PHONY: proto
proto:
@./scripts/proto.sh catalog_write_service
@./scripts/proto.sh order_service
@./scripts/proto.sh catalogwriteservice
@./scripts/proto.sh orderservice

.PHONY: unit-test
unit-test:
@./scripts/test.sh catalog_read_service unit
@./scripts/test.sh catalog_write_service unit
@./scripts/test.sh order_service unit
@./scripts/test.sh catalogreadservice unit
@./scripts/test.sh catalogwriteservice unit
@./scripts/test.sh orderservice unit

.PHONY: integration-test
integration-test:
@./scripts/test.sh catalog_read_service integration
@./scripts/test.sh catalog_write_service integration
@./scripts/test.sh order_service integration
@./scripts/test.sh catalogreadservice integration
@./scripts/test.sh catalogwriteservice integration
@./scripts/test.sh orderservice integration

.PHONY: e2e-test
e2e-test:
@./scripts/test.sh catalog_read_service e2e
@./scripts/test.sh catalog_write_service e2e
@./scripts/test.sh order_service e2e
@./scripts/test.sh catalogreadservice e2e
@./scripts/test.sh catalogwriteservice e2e
@./scripts/test.sh orderservice e2e

#.PHONY: load-test
#load-test:
Expand All @@ -80,16 +80,16 @@ e2e-test:

.PHONY: format
format:
@./scripts/format.sh catalog_write_service
@./scripts/format.sh catalog_read_service
@./scripts/format.sh order_service
@./scripts/format.sh catalogwriteservice
@./scripts/format.sh catalogreadservice
@./scripts/format.sh orderservice
@./scripts/format.sh pkg

.PHONY: lint
lint:
@./scripts/lint.sh catalog_write_service
@./scripts/lint.sh catalog_read_service
@./scripts/lint.sh order_service
@./scripts/lint.sh catalogwriteservice
@./scripts/lint.sh catalogreadservice
@./scripts/lint.sh orderservice
@./scripts/lint.sh pkg

# https://github.com/golang-migrate/migrate/blob/856ea12df9d230b0145e23d951b7dbd6b86621cb/database/postgres/TUTORIAL.md
Expand All @@ -98,30 +98,29 @@ lint:
# https://github.com/golang-migrate/migrate/tree/856ea12df9d230b0145e23d951b7dbd6b86621cb/cmd/migrate#usage
.PHONY: go-migrate
go-migrate:
@./scripts/go-migrate.sh -p ./internal/services/catalog_write_service/db/migrations/go-migrate -c create -n create_product_table
@./scripts/go-migrate.sh -p ./internal/services/catalog_write_service/db/migrations/go-migrate -c up -o postgres://postgres:postgres@localhost:5432/catalogs_service?sslmode=disable
@./scripts/go-migrate.sh -p ./internal/services/catalog_write_service/db/migrations/go-migrate -c down -o postgres://postgres:postgres@localhost:5432/catalogs_service?sslmode=disable
@./scripts/go-migrate.sh -p ./internal/services/catalogwriteservice/db/migrations/go-migrate -c create -n create_product_table
@./scripts/go-migrate.sh -p ./internal/services/catalogwriteservice/db/migrations/go-migrate -c up -o postgres://postgres:postgres@localhost:5432/catalogs_service?sslmode=disable
@./scripts/go-migrate.sh -p ./internal/services/catalogwriteservice/db/migrations/go-migrate -c down -o postgres://postgres:postgres@localhost:5432/catalogs_service?sslmode=disable

# https://github.com/pressly/goose#usage
.PHONY: goose-migrate
goose-migrate:
@./scripts/goose-migrate.sh -p ./internal/services/catalog_write_service/db/migrations/goose-migrate -c create -n create_product_table
@./scripts/goose-migrate.sh -p ./internal/services/catalog_write_service/db/migrations/goose-migrate -c up -o "user=postgres password=postgres dbname=catalogs_service sslmode=disable"
@./scripts/goose-migrate.sh -p ./internal/services/catalog_write_service/db/migrations/goose-migrate -c down -o "user=postgres password=postgres dbname=catalogs_service sslmode=disable"
@./scripts/goose-migrate.sh -p ./internal/services/catalogwriteservice/db/migrations/goose-migrate -c create -n create_product_table
@./scripts/goose-migrate.sh -p ./internal/services/catalogwriteservice/db/migrations/goose-migrate -c up -o "user=postgres password=postgres dbname=catalogs_service sslmode=disable"
@./scripts/goose-migrate.sh -p ./internal/services/catalogwriteservice/db/migrations/goose-migrate -c down -o "user=postgres password=postgres dbname=catalogs_service sslmode=disable"

# https://atlasgo.io/guides/orms/gorm
.PHONY: atlas
atlas:
@./scripts/atlas-migrate.sh -c gorm-sync -p "./internal/services/catalog_write_service"
@./scripts/atlas-migrate.sh -c apply -p "./internal/services/catalog_write_service" -o "postgres://postgres:postgres@localhost:5432/catalogs_service?sslmode=disable"
@./scripts/atlas-migrate.sh -c gorm-sync -p "./internal/services/catalogwriteservice"
@./scripts/atlas-migrate.sh -c apply -p "./internal/services/catalogwriteservice" -o "postgres://postgres:postgres@localhost:5432/catalogs_service?sslmode=disable"

.PHONY: cycle-check
cycle-check:
cd internal/services/catalog_write_service && goimportcycle -dot imports.dot dot -Tpng -o cycle/catalog_write_service.png imports.dot
cd internal/services/catalog_write_service && goimportcycle -dot imports.dot dot -Tpng -o cycle/catalog_write_service.png imports.dot
cd internal/services/catalog_read_service && goimportcycle -dot imports.dot dot -Tpng -o cycle/catalog_read_service.png imports.dot
cd internal/pkg && goimportcycle -dot imports.dot dot -Tpng -o cycle/pkg.png imports.dot

cd internal/services/catalogwriteservice && goimportcycle -dot imports.dot dot -Tpng -o cycle/catalogwriteservice.png imports.dot
cd internal/services/catalogwriteservice && goimportcycle -dot imports.dot dot -Tpng -o cycle/catalogwriteservice.png imports.dot
cd internal/services/orderservice && goimportcycle -dot imports.dot dot -Tpng -o cycle/orderservice.png imports.dot

#.PHONY: c4
#c4:
Expand All @@ -138,6 +137,6 @@ pkg-mocks:

.PHONY: services-mocks
services-mocks:
cd internal/services/catalog_write_service && mockery --output mocks --all
cd internal/services/catalog_read_service && mockery --output mocks --all
cd internal/services/order_service && mockery --output mocks --all
cd internal/services/catalogwriteservice && mockery --output mocks --all
cd internal/services/catalogreadservice && mockery --output mocks --all
cd internal/services/orderservice && mockery --output mocks --all

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit e0ec597

Please sign in to comment.