Back to home
ONLINE 11/2025 Personal

grpc-gen

Scaffold a full-stack gRPC + GraphQL gateway + business-rule engine from .proto files in 3 commands

GogRPCProtobufgqlgenGraphQLMongoDBMySQLRedisDocker
0
Commands → full-stack
0
Architecture layers
0+
Integration tests
MIT
Open source

Overview

A code generator written in Go, inspired by gqlgen, Hasura and PostgREST: you write .proto files and the tool emits an entire production stack — gRPC services, a GraphQL gateway in front of them, and a MongoDB-backed business engine for validation, row-level security and multi-step compute actions; all wired with TLS, structured logging, DataLoaders and Dockerfiles. The engine is data-driven (rules/scopes/actions are Mongo documents, hot-reloaded without a rebuild). The emitted code is readable Go you commit to your repo, with no runtime dependency on the tool. Production-tested against two real apps (an LMS and a thesis-management system) with ~700 integration tests each.

Role: Author & maintainer — designed the CLI, code generator and business engine

System architecture

> Client
Web / Mobile
GraphQL over HTTP
> Gateway
gqlgen
schema + resolvers
DataLoaders
Redis cache
@auth
MongoEnforcer
Admin REST
runtime CRUD
> Business Engine
business_rule
validation
read_scope
RLS
action
pipeline
> Services (gRPC / mTLS)
CRUD Handlers
MySQL
Filter whitelist
Tracer + logger
> Storage
MySQL
MongoDB
engine state
Redis
MinIO
file uploads

Modules & Services

CLI

4
initadd-serviceadd-gatewayproto gen

Services

5
gRPC CRUDMySQL poolFilter whitelistPaginationDockerfile

Gateway (gqlgen)

5
GraphQL schemaResolversDataLoaders@auth directiveAdmin REST

Business Engine

4
business_ruleread_scope (RLS)action pipelineHot-reload

Infra

5
MySQLMongoDBRedisMinIOmTLS

Developer UX

4
Readable GoNo runtime depStructured loggingCross-platform binary

Key features

3 commands to scaffold the whole system: init → add-service → add-gateway
Generates gRPC CRUD services: MySQL pool, filter whitelist, pagination, Dockerfile
GraphQL gateway via gqlgen: schema + resolvers + DataLoaders (Redis 2-layer cache) + @auth directive
Data-driven business engine on MongoDB: business_rule (validation), read_scope (RLS), action (post-mutation pipeline) — hot-reload
Runtime Admin REST API to CRUD rules / policies / scopes / actions
mTLS between gateway ↔ services, function tracer + structured logging
Emits readable Go committed to your repo, with no runtime dependency on the tool
Cross-platform binaries: linux / macOS / windows × amd64 / arm64

Highlights

Inspired by gqlgen, Hasura & PostgREST — generates readable Go, not a runtime framework
Production-tested on two real apps, ~700 integration tests each
Data-driven engine: edit rules/RLS/actions as Mongo docs + reload, no rebuild
Three cleanly separated layers: Services / Gateway / Engine, deployed independently
Lý Vĩnh Thái - Backend Developer & DevOps Engineer