grpc-gen
🌐 English · Tiếng Việt
Scaffold a full-stack gRPC system — services, GraphQL gateway, and a runtime business-rule engine — from .proto files in three commands.

grpc-gen turns Protocol Buffers into a working production stack. You write the
schema; the tool generates the gRPC services, a GraphQL gateway in front of
them, and a Mongo-backed engine for business rules, row-level security, and
multi-step compute actions — all wired together with TLS, structured logging,
DataLoaders, and Dockerfiles.
go install github.com/thailymmo/grpc-gen@latest
grpc-gen init my-app # bootstrap project
grpc-gen add-service user 50051 # add a gRPC service
grpc-gen add-gateway # add GraphQL gateway + engine
What you get
| Layer |
Command |
Output |
| Services |
add-service |
gRPC CRUD handlers, MySQL pool, filter/pagination, Dockerfile |
| Gateway |
add-gateway |
GraphQL schema, resolvers, DataLoaders, @auth directive, REST admin API |
| Engine |
(auto-wired) |
Mongo-backed business rules, RLS, action pipelines, hot-reload |
The engine is data-driven — rules, scopes, and actions are Mongo documents,
not code. Add validation, change permissions, or wire up a computed field by
editing a document and calling the reload endpoint. No rebuild.
See docs/architecture.md for the full layered view.
Installation
go install (recommended)
go install github.com/thailymmo/grpc-gen@latest
The binary lands in $(go env GOPATH)/bin/grpc-gen — make sure that's on your $PATH.
Prebuilt binaries
Grab the archive for your OS/arch from the Releases page
(linux / macOS / windows × amd64 / arm64), extract, and run grpc-gen.
From source
git clone https://github.com/thailymmo/grpc-gen.git
cd grpc-gen
go build -o grpc-gen .
Requirements
- Go 1.24+
protoc (Protocol Buffers compiler)
- MySQL 8.0+, MongoDB 7+ (replica-set), Redis 7+ — for generated projects
Quick start
grpc-gen init blog
cd blog
grpc-gen add-service post 50051
# edit proto/post/post.proto — define your entity
make proto-post && make gen-post
./scripts/run-blog.sh
Read the full walkthrough in docs/getting-started.md.
Documentation
Status
Early-stage but production-tested against two real applications (an LMS and a
thesis-management system, ~700 integration tests each). API may change in
minor pre-1.0 releases; releases follow semver once a
v1.x is cut.
License
MIT — see LICENSE.