Skip to content

huseinnashr/bimble

Repository files navigation

bimble

This repo is archived. Please visit https://github.com/OrdinaryTechFolks/bimble to see the latest commit

you know, for dating. Try it at https://bimble-backend-http.ordinarytechfolks.com (self-hosted, sometimes down)

Information

A. Folder Structure

  • 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

B. Test and others

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:

C. How to Run

1. Running dev env with docker

  1. Download docker-desktop with docker-compose cli https://www.docker.com/products/docker-desktop/
  2. Run docker-compose up -d

Alternatively we can use services in the k8s directly using these steps (requires kubectl access):

  1. 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
  1. Keep it running

2. Migrate DB with Goose

  1. Set these env
GOOSE_DRIVER=postgres
GOOSE_DBSTRING="postgres://postgres:postgres@localhost:5432/postgres"
  1. Run goose -dir migrations up

3. Running go service

  1. Install make cli https://formulae.brew.sh/formula/make
  2. Run make setup
  3. Run make start-local

4. Modifying HTTP Server Endpoint

  1. Stop the go service
  2. Modify protos in ./api/v1 folder
  3. Run make api, this will generate stub that you can use. It also generate openapi.yaml spec in ./
  4. Start the go service

5. Modifying secret

  1. Install modify-secret https://github.com/rajatjindal/kubectl-modify-secret
  2. Run kubectl modify-secret bimble-backend -n bimble
  3. Edit and save to apply changes
  4. Run kubectl rollout restart deployment bimble-backend-depl -n bimble to reload the deployment