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
.
git clone https://github.com/zhengdechang/grpc-web-python-react.git
🇬🇧 English | 简体中文
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:
Install the required dependencies by running the following command:
cd server && chmod +x ./activate && ./activate
Generate the gRPC code from the proto file using the following command:
chmod +x ./generate.sh && ./generate.sh
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.
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:
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.
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:
Install the required dependencies by navigating to the client
folder and running the following command:
cd cleint && yarn install
The grpc-web package is generated and running the following command:
yarn generate
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.
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.
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
Example of stream point cloud rendering interface
https://grpc-web-python-react.vercel.app/#/pointcloud
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.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。