Giter Club home page Giter Club logo

grpc-spring-boot-vue-chat's Introduction

gRPC-Web Chat

A very simple Hello World gRPC (and gRPC-Web) proof of concept project using Spring Boot, Vue.js and EnvoyProxy.

Requirements

Docker

Install Docker

Protoc
  1. Go to the releases page of Protobuf
  2. Select the latest release version
  3. Scroll down to Assets and download the applicable file (e.g., for Windows protoc-3.8.0-rc-1-win64.zip)
  4. Extract the contents and add to your path (e.g., for Windows, simply add the protoc.exe to your path)
gRPC-Web Protoc Plugin
  1. Go to the releases page of gRPC-Web
  2. Select the latest release version
  3. Scroll down to Assets and download the applicable file (e.g., for Windows protoc-gen-grpc-web-1.0.4-windows-x86_64.exe)
  4. Extract the protoc-gen-grpc-web file a directory and it to your path (e.g., for Windows add the protoc-gen-grpc-web.exe file to your path)

Install and Run

gRPC-Web Chat

Execute mvn clean install to build and compile the project. This will also generate all the necessary Protocol Buffer files for the backend and frontend.

Spring Boot Backend

Simply run the ChatApplication.java as a normal Java application. This will start the server. See the resources/application.properties file for server details. By default it runs on http://localhost:8000.

Envoy Proxy

To build and run the Docker container, follow the instructions below.

Windows

Execute the following Docker commands to build and run the EnvoyProxy container:

$ docker build -t helloworld/envoy -f ./envoy.Dockerfile .
$ docker run -d -p 8080:8080 helloworld/envoy
Unix

Note: This project is configured for Windows by default. To run Envoy on Unix, change the following line in the envoy.yaml file (see here for more details):

hosts: [{ socket_address: { address: host.docker.internal, port_value: 9090 }}]

to

hosts: [{ socket_address: { address: localhost, port_value: 9090 }}]

Now execute the following Docker commands to build and run the EnvoyProxy container:

$ docker build -t helloworld/envoy -f ./envoy.Dockerfile .
$ docker run -d -p 8080:8080 --network=host helloworld/envoy

Vue Frontend

To specifically generate Proto files for the front-end client, navigate to the frontend directory and run the following command:

$ npm run proto

To serve the frontend code in a development environment, execute:

$ npm run serve -- --port 8081    # This serves the front end on port 8081.

References and Resources

grpc-spring-boot-vue-chat's People

Contributors

angelomelonas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.