Skip to content

Latest commit

 

History

History
67 lines (63 loc) · 1.57 KB

README.md

File metadata and controls

67 lines (63 loc) · 1.57 KB

Thunder - backend Framework gRPC Gateway + Prisma + Kubernetes + Golang

Generator

Add protoc plugin

go build -o protoc-gen-rpc-impl ./cmd/protoc-gen-rpc-impl.go
sudo mv protoc-gen-rpc-impl /usr/local/bin
sudo chmod +x /usr/local/bin/protoc-gen-rpc-impl
go run generator.go yourfilename.proto

Kubernetes

Run Docker

docker build -t app:latest .
docker login
docker push $docker_username/app:latest
  • edit k8s/deployment.yaml
  • Apply kubectl
minikube start
cd k8s
kubectl apply -f deployment.yaml
kubectl apply -f service.yaml
  • Port Foward
kubectl port-forward service/app-service 8080:8080 -n default
  • Check pods
kubectl get pods -n default
kubectl describe pod $NAME -n default

Testing API

Register:

     curl --http2 -X POST http://localhost:8080/v1/auth/register \
          -H "Content-Type: application/json" \
          -d '{
                "email": "[email protected]",
                "password": "password123",
                "name": "John",
                "surname": "Doe",
                "age": 30
              }'

Log in:

     curl --http2 -X POST http://localhost:8080/v1/auth/login \
          -H "Content-Type: application/json" \
          -d '{
                "email": "[email protected]",
                "password": "password123"
              }'

Examples

References