Coder Social home page Coder Social logo

danoldnyamsi7 / angular-nest-grpc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kmturley/angular-nest-grpc

0.0 0.0 0.0 585 KB

Example full-stack Typescript project using Angular, NestJS and gRPC

Home Page: https://medium.com/creative-technology-concepts-code/using-grpc-with-nestjs-and-angular-b60b444bc3ab

License: MIT License

JavaScript 45.07% TypeScript 52.23% HTML 1.58% Dockerfile 0.96% SCSS 0.16%

angular-nest-grpc's Introduction

angular-nest-grpc

Example full-stack Typescript project using:

  • Angular 9.1.x
  • NestJS 7.0.x
  • Protocol Buffers 3.12.x
  • Envoy Proxy 1.14.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:

npm install -g grpcc

Then view the endpoints using:

grpcc -i --proto ./backend/src/hero/hero.proto --address localhost:50051

// call grpc methods
client.getHeroes({}, printReply)
client.getHeroById({ id: 1 }, printReply)

// call streaming methods
var call = client.getHeroesStream().on('data', streamReply).on('status', streamReply); call.write({});
var call = client.getHeroByIdStream().on('data', streamReply).on('status', streamReply); call.write({ id: 1 });

Test the regular HTTP REST api at:

http://localhost:3001/hero
http://localhost:3001/hero/1

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 dependabot[bot] 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.