you know, for dating. Try it at https://bimble-backend-http-dev.ordinarytechfolks.com (self-hosted, sometimes down)
- Structure according to Golang Clean Architecture https://github.com/bxcodec/go-clean-arch
- Find code in
./internal
folder, there will be 3 layer. These are repo, usecase and handler (from bottom to top). Top layer can reuse bottom, bottom can't call top layer - All interface and struct definition in
./internal/domain
folder - API Definition is on
./api
folder - Config is on
./config
folder
Please see documentation.pdf for the integration test criteria and result (the last section in the bottom).
Due to time constraint the following is not implemented:
- CI/CD, but you can check my implementation here https://github.com/OrdinaryTechFolks/budgetme-backend
- Unit Test. I usually use https://github.com/vektra/mockery, which can generate mock from interface using
go gen
, than you can inject the mock object into the test struct like thisusecase := New(config, mockAccountRepo)
- Download docker-desktop with docker-compose cli https://www.docker.com/products/docker-desktop/
- Run
docker-compose up -d
Alternatively we can use services in the k8s directly using these steps (requires kubectl access):
- Run these commands on a new terminal
kubectl port-forward services/yb-tservers -n bimble 5433:5433 & \
kubectl port-forward services/redis-standalone -n bimble 6379:6379 & \
kubectl port-forward services/otel-collector-collector -n bimble 4317:4317
- Keep it running
- Set these env
GOOSE_DRIVER=postgres
GOOSE_DBSTRING="postgres://postgres:postgres@localhost:5432/postgres"
- Run
goose -dir migrations up
- Install make cli https://formulae.brew.sh/formula/make
- Run
make setup
- Run
make start-local
- Stop the go service
- Modify protos in
./api/v1
folder - Run
make api
, this will generate stub that you can use. It also generate openapi.yaml spec in./
- Start the go service
- Install
modify-secret
https://github.com/rajatjindal/kubectl-modify-secret - Run
kubectl modify-secret bimble-backend -n bimble
- Edit and save to apply changes
- Run
kubectl rollout restart deployment bimble-backend-depl -n bimble
to reload the deployment