This work was carried out in the Computer Networks discipline and aimed to familiarize students with programming network applications using sockets, formalizing a protocol for this. In short, we needed to build an application similar to Whatsapp following the protocol specification created by professor Dr. Pedro de Botelho Marcos presented in this link.
Figure: Print of what is displayed in the terminal when the client starts
Interzap's architecture is designed to support real-time communication between clients and servers using sockets. Below is an overview of the main components and how they interact:
interzap/
β
βββ server/ # Directory containing the server code
β βββ internal/ # Internal server logic
β β βββ chat_server.py # Main server class that handles requests
β β βββ database.py # Class for managing the SQLite database
β β βββ group.py # Class for managing users in a group
β β βββ user.py # Secondary class for handling individual messages in a thread
β βββ main.py # Script to start the server
β
βββ client/ # Directory containing the client code
β βββ backup/ # Directory for storing client messages
β β βββ Client-000000.py # Example of how messages are stored
β βββ internal/ # Internal client logic
β β βββ chat_client.py # Main client class
β β βββ client.py # Secondary class for managing messages and contacts
β βββ util/ # Directory for utility functions
β β βββ convert_posix.py # Functions to convert POSIX timestamps to standard dates
β βββ main.py # Script to start the client
β
βββ README.md # This file
βββ host.py # File that defines (or not) the HOST_IP
βββ requirements.txt # Libraries and packages used
βοΈ Login
βοΈ Register
βοΈ Send individual message
βοΈ Send group message
βοΈ Show whether the message was delivered or read
βοΈ Save messages from user who is offline (using SQLite)
βοΈ Save client message history (using .json)
- Run
pip install -r requirements.txt - Run
python server/main.pyin the base directory to start the server - Run
python client/main.pyin the base directory (as many times you want) to open the clients that will consume the server - Be happy testing on the client π€
