GithubHelp home page GithubHelp logo

gb21oc / nestjs-grpc-chat Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 342 KB

Created a simple chat between clients using the framework Nest.js with protocol gRPC

JavaScript 5.16% TypeScript 93.80% Dockerfile 1.04%
backend nest nestjs nestjs-backend nestjs-grpc nestjs-microservices node node-js nodejs simple-project typescript

nestjs-grpc-chat's Introduction

Alt text

classDiagram
    ChatService <|-- ChatServiceDomain: Inheritance
    ChatController <.. ChatService: Dependency
    ChatController <|-- ChatControllerDomain: Inheritance

    class ChatController{
        +ChatService _chatService
        constructor(_chatService: ChatService)
        +createUser(data: IChat.CreateUser, _metadata: Metadata, call: ServerUnaryCall<IChat.CreateUser, IChat.ResponseCreateUser>, ):IChat.ResponseCreateUser
        +getAllUsers():IChat.ResponseGetAll
        +sendMessageToUser(data: Observable<IChat.SendToUser>)
    }
    class ChatService{
        +IChat.User[] users
        +IChat.AttempsMsg[] attempsMsg
        +createUser(payload: IChat.CreateUser, call: ServerUnaryCall<IChat.CreateUser, IChat.ResponseCreateUser>, )
        +getAllUsers():IChat.ResponseGetAll
        +joinChat(payload: Observable<IChat.SendToUser>):Observable<IChat.ReceiveMsg>
    }

Configuration

  • Port: 50051
  • Proto files:
    • /proto/chat.proto
  • Transport: gRPC
  • PRD: Build Status
  • DEV: Build Status

Micro Service information

  • Endpoints
    • CreateUser
      • Interface: IChat.CreateUser
      • Stream: No
      • Body:
      {
        "user": "gb"
      }
      • Response:
      {
        "error": "",
        "userCreated": true
      }
    • GetAllUsers
      • Interface: N/A
      • Stream: No
      • Body: No
      • Response:
      {
        "users": [
            {
                "id": 1,
                "user": "gb"
            },
            {
                "id": 2,
                "user": "gbOutroUsuario"
            }
        ]
      }
    • SendMessageToUser
      • Interface: IChat.SendToUser
      • Stream: yes
        • Bidirecional: yes
      • Body:
      {
        "from": "gb",
        "toID": 2,
        "msg": "Olá amigo!"
      }

nestjs-grpc-chat's People

Contributors

gb21oc avatar

Watchers

 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.