Skip to content

ryan95f/python-grpc-chat-app

Repository files navigation

Python gRPC Chat App

Build Status

A Python gRPC chat application using Tkinter.

Requirements

The following are required to develop or execute the project:

  • Python 3
  • PIP (Python package manager)

Setting up the environment

To set up the environment, ensure the virtualenv package has been installed. This can be added to your Python instance with:

pip install virtualenv

Once virtualenv has been installed. Create the virutal environment for the application:

python -m venv env

Then activate the virtual environment:

source env/bin/activate

Finally use the Makefile to install the relevant dependencies for the application:

make init

Running the server

To start the chat server:

make server

Running the chat client

To start the chat client application:

make client

Note: You can create multiple instances of the client to simulate multiple users

Compiling the Protocol Buffers

To compile the protocol buffers found in the protos/ directory, run:

make protoc

This will output two Python files called chat_pb2.py and chat_pb2_grpc.py. These files will be located in the src/server/ package.

Unit Tests

To run all the unit tests in the project, use:

make tests

Coding Standards

This project follows the PEP 8 Python coding standard. In order to validate the code against PEP 8, run the pycodestyle tool. This can be executed with:

make lint