Giter Club home page Giter Club logo

angular-nest-grpc's Introduction

angular-nest-grpc

Example full-stack Typescript project using:

  • Angular 7.2.x
  • NestJS 5.6.x
  • Protocol Buffers 3.2.x
  • Envoy Proxy 1.x

Installation

Install dependencies using:

docker-compose build

Usage

Run backend, frontend and proxy together using:

docker-compose up

Access the Nest gRPC microservice at:

http://localhost:50051/

Access the Envoy Proxy at:

http://localhost:8080/

View the Angular frontend at:

http://localhost:4200/

Protocol Buffers

If you update backend .proto files, then you will need to recompile them to frontend services using:

cd frontend
npm run compile

You can find out more information about gRPC requests and generated client-side code here:

https://github.com/improbable-eng/grpc-web/blob/master/client/grpc-web/docs/code-generation.md

Exploring and testing endpoints

Install grpc_cli using:

brew tap grpc/grpc
brew install --with-plugins grpc

Then view the endpoints using:

export GRPC_VERBOSITY=DEBUG
grpc_cli ls localhost:50051

// call methods
grpc_cli call localhost:50051 GetHeroById "id: 1" --protofiles=backend/src/hero/hero.proto
grpc_cli call localhost:50051 ListHeroesByName "name: 'Jo'" --protofiles=backend/src/hero/hero.proto

// call streaming methods
grpc_cli call localhost:50051 GetHeroByIdStream "id: 2" --protofiles=backend/src/hero/hero.proto
grpc_cli call localhost:50051 ListHeroesByNameStream "name: 'Bi'" --protofiles=backend/src/hero/hero.proto

Directory structure

/backend                               --> Backend source files
/frontend                              --> Frontend sources files

Contact

For more information please contact kmturley

angular-nest-grpc's People

Contributors

kmturley avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.