11# go-coffeeshop
22
3- A coffee shop application with event-driven microservices has been written in Golang. Nomad, Consul Connect, Vault, and Terraform for deployment
3+ An event-driven microservices coffee shop application has been written in Golang and deployed using Nomad, Consul Connect, Vault, and Terraform.
44
5- Other version can be found at:
5+ Other versions in .NET/C# can be found at:
66
77- [ .NET CoffeeShop with Microservices approach] ( https://github.com/thangchung/coffeeshop-on-nomad )
88- [ .NET CoffeeShop with Modular Monolith approach] ( https://github.com/thangchung/coffeeshop-modular )
99
1010## Technical stack
11+
1112- Backend building blocks
1213 - [ grpc-ecosystem/grpc-gateway/v2] ( https://github.com/grpc-ecosystem/grpc-gateway )
1314 - [ labstack/echo/v4] ( https://github.com/labstack/echo )
1415 - [ rabbitmq/amqp091-go] ( https://github.com/rabbitmq/amqp091-go )
15- - [ jackc/pgx/v4] ( https://github.com/jackc/pgx )
16- - [ Masterminds/squirrel] ( https://github.com/Masterminds/squirrel )
17- - [ georgysavva/scany] ( https://github.com/georgysavva/scany )
16+ - [ kyleconroy/sqlc] ( https://github.com/kyleconroy/sqlc )
17+ - [ pq] ( github.com/lib/pq )
1818 - [ golang-migrate/migrate/v4] ( https://github.com/golang-migrate/migrate )
1919 - Utils
20+ - [ google/wire] ( github.com/google/wire )
2021 - [ ilyakaznacheev/cleanenv] ( https://github.com/ilyakaznacheev/cleanenv )
21- - [ sirupsen/logrus] ( https://github.com/sirupsen/logrus )
22+ - golang.org/x/exp/slog
23+ - [ sirupsen/logrus] ( https://github.com/sirupsen/logrus )
2224 - [ samber/lo] ( https://github.com/samber/lo )
25+ - [ automaxprocs/maxprocs] ( go.uber.org/automaxprocs/maxprocs )
26+ - [ stretchr/testify] ( github.com/stretchr/testify )
2327 - golang/glog
2428 - google/uuid
2529 - google.golang.org/genproto
@@ -33,7 +37,7 @@ Other version can be found at:
3337
3438## CoffeeShop - Choreography Saga
3539
36- ![ ] ( docs/coffeeshop.svg )
40+ ![ coffeeshop ] ( docs/coffeeshop.svg )
3741
3842## Services
3943
@@ -42,20 +46,19 @@ No. | Service | URI
42461 | grpc-gateway | [ http://localhost:5000 ] ( http://localhost:5000 )
43472 | product service | [ http://localhost:5001 ] ( http://localhost:5001 )
44483 | counter service | [ http://localhost:5002 ] ( http://localhost:5002 )
45- 4 | barista service | [ http://localhost:5003 ] ( http://localhost:5003 )
46- 5 | kitchen service | [ http://localhost:5004 ] ( http://localhost:5004 )
47- 6 | web | [ http://localhost:8080 ] ( http://localhost:8080 )
49+ 4 | barista service | worker only
50+ 5 | kitchen service | worker only
51+ 6 | web | [ http://localhost:8888 ] ( http://localhost:8888 )
4852
4953## Starting project
5054
51- Jump into ` .devcontainer ` , then
55+ Jump into [ ` .devcontainer ` ] ( https://code.visualstudio.com/docs/devcontainers/containers ) , then
5256
5357``` bash
54- > docker-compose -f docker-compose-full.yaml build
55- > docker-compose -f docker-compose-full.yaml up
58+ > make docker-compose
5659```
5760
58- From ` vscode ` => Press F1 => Type ` Simple Browser View ` => Choose it and enter [ http://localhost:8080 ] ( http://localhost:8080 ) .
61+ From ` vscode ` => Press F1 => Type ` Simple Browser View ` => Choose it and enter [ http://localhost:8888 ] ( http://localhost:8888 ) .
5962Enjoy!!!
6063
6164## Screenshots
@@ -74,21 +77,39 @@ Enjoy!!!
7477
7578## HashiCorp stack deployment
7679
77- ![ ] ( docs/coffeeshop_hashicorp.svg )
80+ ![ coffeeshop_hashicorp ] ( docs/coffeeshop_hashicorp.svg )
7881
7982The details of how to run it can be find at [ deployment with Nomad, Consult Connect and Vault] ( build/README.md ) .
8083
81- ## Debug Apps
84+ ## Development
85+
86+ ### Clean Domain-driven Design
87+
88+ ![ clean_ddd] ( docs/clean_ddd.svg )
89+
90+ ### Generate dependency injection instances with wire
91+
92+ ``` bash
93+ > make wire
94+ ```
95+
96+ ### Generate code with sqlc
97+
98+ ``` bash
99+ > make sqlc
100+ ```
101+
102+ ### Debug Apps
82103
83104[ Debug golang app in monorepo] ( https://github.com/thangchung/go-coffeeshop/wiki/Golang#debug-app-in-monorepo )
84105
85- ## Trouble shooting
106+ ### Trouble shooting
86107
87108[ Development project trouble shooting] ( https://github.com/thangchung/go-coffeeshop/wiki#trouble-shooting )
88109
89110## Roadmap
90111
91- - Enhance project structure with DDD patterns
112+ - ✅ Enhance project structure with DDD patterns
92113- Add testing
93114- Add and integrate with observability libs and tools
94115- Add user identity management (authentication and authorization)
0 commit comments