Giter Site home page Giter Site logo

electron-grpc's Introduction

Reference guides:

  1. Install protocol buffers compiler: https://grpc.io/docs/protoc-installation/

  2. Install gRPC module (I assume Node is already installed in the system):

$ npm i grpc
$ npm i grpc-tools
  1. Dynamic implementation of gRPC and protocol buffers: https://grpc.io/docs/languages/node/basics/

NOTE: current project uses static implementation so some refactor must be done in the code to achive it.

Build JavaScript libraries

Commmand to build the JavaScript files using the .proto file, remember to adjust paths and filenames of required:

protoc -I=. ./proto/chat2.proto --js_out=import_style=commonjs,binary:./server --grpc_out=./server 
--plugin=protoc-gen-grpc=`which grpc_tools_node_protoc_plugin`

There is another option to do it using different compiler, remember to adjust paths and filenames of required:

$ ./gen-proto.sh

Develop notes for ELECTRON client: (NOTE: run everything from the project root folder)

  1. First we remove package-lock.json to prevent conflicts:
rm package-lock.json 
  1. Install modules:
npm install electron-rebuild 
  1. Rebuild:
./node_modules/.bin/electron-rebuild 
  1. Start the client (the server must be running/listening first)
npm start 

Reference project:

https://github.com/datenshi/electron-grpc

electron-grpc's People

Contributors

datenshi avatar dependabot[bot] avatar melledijkstra avatar

Watchers

James Cloos 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.