Skip to content

saefullohmaslul/gRPC-Microgen

Repository files navigation

gRPC Microservices Generator (gRPC-Microgen)

We are lazy team, we make microservices more simple, fast, and elegant!

Motivation

gRPC is fastest microservices architecture, we can consume another service with gRPC. But gRPC is more complex to build from scratch.

Feature

We make this code so easy to understand, you can create microservices only from the graphql scheme.

Features that we have and will make include:

  • Generate Protobuf from graphql schema
  • Generate gRPC server from Protobuf schema which is generated by graphql schema
  • Generate each table and field which is needed by the server from the graphql schema
  • Generate flow based on graphql schema (TODO)
  • Graphql server with gRPC microservices (TODO)
  • Docker and docker-compose

How to Run Project

To running project, You can choose to use local or docker.

Running Project via Local

To running project via local, You can follow this step:

  1. Install MongoDB

    See the documentation to install MongoDB on your computer: documentation

  2. Running Server

    • Before running the server, change .env based your MongoDB configuration

    • Running local server with this command:

      npm run start:dev

Running Project via Docker Compose

To running project docker compose, You can follow this step:

  1. Install Docker and Docker Compose

  2. Running Server

    Running docker compose with command:

    npm run start:docker

Project Structure

.
├── coverage                   # Interactive test result
├── dist                       # Compiled file javascript
├── graphql                    # Graphql schema
├── microgen                   # This project locate in here
├── node_modules               # Fvking black hole
├── protos                     # protobuf file
├── scripts                    # Script helper
├── src
|  ├── __tests__               # Unit Testing files
|  ├── app                     # Contain Basic App configuration
|  ├── database                # Data access stuff  (Sequalize mostly)
|  ├── grpc                    # gRPC server
|  ├── proto                   # Proto generated file .d.ts and .js
|  ├── repositories            # Contain query sql/no-sql to database
|  ├── utils                   # Util libs (formats, debugger, validation, etc)
|  └── index.ts                # App Entry point
|
├── .env                       # Example environment
├── .env.dev                   # Environment which is required to generate
├── .gitignore                 # Git ignore
├── LICENSE                    # The license file
├── README.md                  # This file
└── tsconfig.json              # Typescript configuration

Releases

No releases published

Packages

No packages published

Languages