Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Latest commit

 

History

History
72 lines (47 loc) · 1.85 KB

README.md

File metadata and controls

72 lines (47 loc) · 1.85 KB

Python Chat Application

Simple chat application using Python for desktop.

Features

  • Multiple clients
  • Multiple chat rooms
  • Authentication system
    • Login
    • Sign up
    • Forgot password
  • Email validation

Communication

The Server-Client communication is via the smart_socket:

import json
import socket


class Socket:
    """
    Socket enhancement to enable sending unlimited-size messages and using the json module.
    """
    def __init__(self, sock: socket.socket):
        self.socket = sock

    def send(self, data) -> None:
        data = json.dumps(data).encode()

        self.socket.sendall(data)
        self.socket.send(b"<done>")

    def receive(self):
        data = b""
        while not data.endswith(b"<done>"):
            data += self.socket.recv(1024)
        data = data[:-6]

        return json.loads(data)

    def execute(self, command):
        self.send(command)
        return self.receive()

Which uses pickle to serialize JSON objects and send it to the client.

UI

The user interface was done using PyQt5.

The authentication design was inspired by Zoom software for desktop.

Responsive design, the main window is fully resizable.

Demos

image

image

image

image

image

image