matchmaking-grpc-proto
v1.0.0
Published
gRPC Protocol Buffer definitions for matchmaking services
Downloads
5
Maintainers
Readme
matchmaking-grpc-proto
A comprehensive collection of gRPC Protocol Buffer definitions for matchmaking services and related microservices.
📦 Installation
npm install matchmaking-grpc-proto🚀 Usage
Basic Usage
const protoPaths = require('matchmaking-grpc-proto');
// Access specific proto files
const authProto = protoPaths.vfe.v1.auth;
const memberProto = protoPaths.vfe.v1.member;
// Get all proto files
const allProtoFiles = protoPaths.getAllProtoFiles();With gRPC (Node.js)
const grpc = require('@grpc/grpc-js');
const protoLoader = require('@grpc/proto-loader');
const protoPaths = require('matchmaking-grpc-proto');
// Load auth service
const authPackageDefinition = protoLoader.loadSync(protoPaths.vfe.v1.auth, {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
});
const authProto = grpc.loadPackageDefinition(authPackageDefinition);
const authService = new authProto.auth.AuthService('localhost:50051', grpc.credentials.createInsecure());With Protocol Buffers Compiler
# Generate Go code
protoc --go_out=. --go-grpc_out=. $(node -e "console.log(require('matchmaking-grpc-proto').vfe.v1.auth)")
# Generate TypeScript code
protoc --plugin=protoc-gen-ts_proto=./node_modules/.bin/protoc-gen-ts_proto \
--ts_proto_out=. \
$(node -e "console.log(require('matchmaking-grpc-proto').vfe.v1.auth)")📁 Available Services
VFE (Virtual Frontend Experience)
- v1
auth.proto- Authentication service (login, register, password management)member.proto- Member management servicemembership.proto- Membership service
- v2
order.proto- Order management serviceuser.proto- User management service
Other Services
twoToTango/- Two-to-tango service definitionsb2b2c/- Business-to-business-to-consumer service definitionsastrology/- Astrology service definitionsadmin/- Admin service definitions
🔧 Development
Prerequisites
- Node.js >= 14.0.0
- npm or yarn
Setup
npm installTesting
npm testValidation
npm run prepare📦 Publishing
Manual Publishing
Login to npm (if not already logged in):
npm loginUpdate version (if needed):
npm version patch # for bug fixes npm version minor # for new features npm version major # for breaking changesPublish the package:
npm run publish-packageOr manually:
npm run prepare npm publish
Publishing Checklist
Before publishing, ensure:
- [ ] All proto files are valid
- [ ] Version number is updated
- [ ] Package validation passes (
npm run prepare) - [ ] You're logged into npm (
npm whoami)
📋 Requirements
- Protocol Buffers compiler (
protoc) - gRPC plugins for your target language:
- Go:
protoc-gen-go,protoc-gen-go-grpc - TypeScript:
protoc-gen-ts_proto - Python:
grpcio-tools - Java:
grpc-java
- Go:
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🆘 Support
- 📧 Email: [email protected]
