Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/raezil/thunder
Building minimalistic backend framework using gRPC-Gateway + Prisma + GO
https://github.com/raezil/thunder
backend containerization framework golang grpc-gateway-example grpc-go kubernetes prisma template
Last synced: 24 days ago
JSON representation
Building minimalistic backend framework using gRPC-Gateway + Prisma + GO
- Host: GitHub
- URL: https://github.com/raezil/thunder
- Owner: Raezil
- Created: 2024-11-03T12:42:00.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-11-11T15:43:42.000Z (3 months ago)
- Last Synced: 2024-11-14T06:18:10.210Z (3 months ago)
- Topics: backend, containerization, framework, golang, grpc-gateway-example, grpc-go, kubernetes, prisma, template
- Language: Go
- Homepage:
- Size: 10.4 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Thunder - backend Framework gRPC Gateway + Prisma + Kubernetes + Golang
### Mocking tests
#### If you want mock grpc server:
```
cd backend
mockgen -source=yourservice_grpc.pb.go -destination=yourservice_mock.go
```
#### Replace youservice with name of your grpc service### 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
```
## Generator
```
go run generator.go -proto=filename.proto -prisma=true
```
## Kubernetes
### Run Docker
```
docker build -t app:latest .
docker login
docker push $docker_username/app:latest
```
- [x] 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
- [x] https://github.com/Raezil/ProtoText# References
- [x] https://goprisma.org/docs
- [x] https://protobuf.dev/programming-guides/proto3/
- [x] https://grpc-ecosystem.github.io/grpc-gateway/docs/tutorials/adding_annotations/