1 Star 0 Fork 0

devin/grpc-web-python-react

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

grpc-web-python-react

This project implements Python communication with React using gRPC, and utilizes gRPC-Web to implement stream point cloud rendering. The project consists of three main folders: server, client, and envoy.

Clone project

git clone https://github.com/zhengdechang/grpc-web-python-react.git

🇬🇧 English | 简体中文

Server

The server folder contains the gRPC service implemented in Python using proto files. It provides the necessary functionality for serving the point cloud data to the client. To get started with the server, follow these steps:

  1. Install the required dependencies by running the following command:

    cd server && chmod +x ./activate && ./activate
    
  2. Generate the gRPC code from the proto file using the following command:

    chmod +x ./generate.sh && ./generate.sh
    
  3. Start the gRPC server by running the following command:

    python main.py
    

The server should now be running and ready to serve point cloud data to the client.

Envoy

The envoy folder contains the configuration files for Envoy, which acts as a proxy for the gRPC communication between the client and server. To configure and start Envoy, follow these steps:

  1. To start the agent with docker in linux, here are the commands to execute
     cd envoy && chmod +x ./deploy-linux.sh && ./deploy-linux.sh
    

Envoy will now act as a proxy, forwarding gRPC-Web requests from the client to the gRPC server.

Client

The client folder contains the React application that utilizes gRPC-Web to render the point cloud data received from the server. To set up and run the client, follow these steps:

  1. Install the required dependencies by navigating to the client folder and running the following command:

    cd cleint && yarn  install
    
  2. The grpc-web package is generated and running the following command:

    yarn  generate
    
  3. Start the React development server by running the following command:

     yarn start
    

The client application should now be running and accessible at http://localhost:3000. It will establish a gRPC-Web connection with the server and render the received point cloud data.

Conclusion

With the server, client, and Envoy set up and running, you should have a functional system that enables Python communication with React using gRPC. The client will render the received point cloud data, providing an interactive and visually appealing experience. Feel free to explore and customize the code to suit your specific requirements.

Demo

This project implements Python communication with React using gRPC and utilizes gRPC-Web for streaming point cloud rendering. Here are some screenshots showcasing the functionality and interface of the project:

https://grpc-web-python-react.vercel.app/#/threepointcloud2 Demo 1 Example of stream point cloud rendering interface

https://grpc-web-python-react.vercel.app/#/pointcloud Demo 2 Example of point cloud data transmission

Please note that these screenshots are for demonstration purposes only, and the actual results may vary depending on your environment and data. You can customize and optimize the project according to your specific requirements and data.

We wish you success with your project! If you have any questions, feel free to ask.

空文件

简介

This project implements Python communication with React using gRPC, and utilizes gRPC-Web to implement stream point cloud rendering 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/delonger/grpc-web-python-react.git
git@gitee.com:delonger/grpc-web-python-react.git
delonger
grpc-web-python-react
grpc-web-python-react
main

搜索帮助