Microservice responsible for main backend services.
This project uses the Go programming language (Golang), PostgreSQL as the relational database and Redis as the cache.
Clone the repository and enter the folder
git clone https://gitlab.com/gym-global/backend.git && cd backendCompose the local environment (cache + db)
make local
make stop-localInstall, Build and Run Go binary
go run cmd/api/main.go or
go mod download && go build -o gym cmd/api/main.go && ./gymTest the app
curl --location --request GET 'http://localhost:8080/health'
curl --location --request GET 'http://localhost:8080/'Compose the dev environment (app + cache + db)
make dev
make stop-devTest the app
curl --location --request GET 'http://localhost:6000/health'
curl --location --request GET 'http://localhost:6000/'Apply the definition files
kubectl apply -f kubernetesGet pod name and port-foward
kubectl get pods
kubectl port-forward {pod-name} 5555:6000
eg. kubectl port-forward gym-app-5bcb8c5c4d-cxbp9 5555:6000Test the app
curl --location --request GET 'http://localhost:5555/health'
curl --location --request GET 'http://localhost:5555/'Scale the pods
kubectl scale --replicas=3 deployment gym-appgo test ./...
or
make test
make api-testmigrate create -ext sql -dir migration -seq some_migration_namebash deploy-img-to-registry.sh