https://github.com/hoan02/puchi-be-microservices
puchi backend
https://github.com/hoan02/puchi-be-microservices
golang grpc k8s microservices
Last synced: 8 months ago
JSON representation
puchi backend
- Host: GitHub
- URL: https://github.com/hoan02/puchi-be-microservices
- Owner: hoan02
- License: mit
- Created: 2025-07-27T16:54:28.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-07-27T17:45:44.000Z (8 months ago)
- Last Synced: 2025-07-27T19:32:00.551Z (8 months ago)
- Topics: golang, grpc, k8s, microservices
- Language: Go
- Homepage:
- Size: 92.8 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Kratos Project Template
## Install Kratos
```
go install github.com/go-kratos/kratos/cmd/kratos/v2@latest
```
## Create a service
```
# Create a template project
kratos new server
cd server
# Add a proto template
kratos proto add api/server/server.proto
# Generate the proto code
kratos proto client api/server/server.proto
# Generate the source code of service by proto file
kratos proto server api/server/server.proto -t internal/service
go generate ./...
go build -o ./bin/ ./...
./bin/server -conf ./configs
```
## Generate other auxiliary files by Makefile
```
# Download and update dependencies
make init
# Generate API files (include: pb.go, http, grpc, validate, swagger) by proto file
make api
# Generate all files
make all
```
## Automated Initialization (wire)
```
# install wire
go get github.com/google/wire/cmd/wire
# generate wire
cd cmd/server
wire
```
## Docker
```bash
# build
docker build -t .
# run
docker run --rm -p 8000:8000 -p 9000:9000 -v :/data/conf
```