e-commerce

module
v0.0.0-...-398e551 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2022 License: MIT

README

gRPC API Gateway e-commerce service

The following concepts are applied in app:

  • gRPC gateway-api using openapiv2
  • Authorization and authentication using a stateless approach (JWT)
  • The Clean Architecture approach (DI)
  • Protobuf generation using buf tool.
  • Postgres database using gorm framework.
  • Graceful Shutdown.
  • Running app in docker containers (docker-compose).
  • CI (GitHub Action)
  • Having Swagger
Service consists of 4 microservices:
  • gateway
  • auth
    • register
    • login
    • validate
  • product
    • create
    • get-one
    • decrease-stock
  • order (authentication)
    • create
to start the service:
to run app in docker containers
make run
to run tests
make test
to use swagger
paths:
  "/swagger-ui" - Swagger-UI -> 
  "/swagger/{name}" - auth | product | order 
commands to run app natively (don't forget about postgres)
go run cmd/store-gateway/main.go -c "configs/gateway.yaml"
go run cmd/store-auth/main.go -c "configs/auth.yaml"
go run cmd/store-product/main.go -c "configs/product.yaml"
go run cmd/store-order/main.go -c "configs/order.yaml"
to generate proto
make gen-proto
to generate mocks
make mocks
e-commerce design:

Directories

Path Synopsis
cmd
gen
auth/v1
Package authv1 is a reverse proxy.
Package authv1 is a reverse proxy.
order/v1
Package orderv1 is a reverse proxy.
Package orderv1 is a reverse proxy.
product/v1
Package productv1 is a reverse proxy.
Package productv1 is a reverse proxy.
store-auth
internal/repo/mocks
Package mock_repo is a generated GoMock package.
Package mock_repo is a generated GoMock package.
internal/service/jwtoken/mocks
Package mock_jwtoken is a generated GoMock package.
Package mock_jwtoken is a generated GoMock package.
store-order
client/mocks
Package mock_client is a generated GoMock package.
Package mock_client is a generated GoMock package.
internal/repo/mocks
Package mock_repo is a generated GoMock package.
Package mock_repo is a generated GoMock package.
store-product
internal/repo/mocks
Package mock_repo is a generated GoMock package.
Package mock_repo is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL