Group chat application built using Python's socket library, developed for the IF678 - Infraestrutura de Comunicação project.
- Open PowerShell or Command Prompt and clone the repository
git clone https://github.com/llucasEmanuel/socket-groupchat.git
cd socket-groupchat
- In the same terminal, run the server batch file
.\run_server.bat
- Open another PowerShell/Command Prompt window, navigate to the project directory and run the client
cd path\to\socket-groupchat
.\run_client.bat
Alternative method (using Python directly):
# Terminal 1 (Server)
python -m server.main
# Terminal 2 (Client)
python -m client.main
- Open the terminal and clone the repository
git clone https://github.com/llucasEmanuel/socket-groupchat.git
cd socket-groupchat
- In the same terminal, run the
run_server.sh
script
bash run_server.sh
- Open another terminal, go to the
socket-groupchat
directory and run therun_client.sh
script
cd socket-groupchat
bash run_client.sh
-
Go to
config/settings.py
and change theSERVER_IP
variable to the IP address of the computer you chose as the server on every machine you want to use (server or client) -
Run the server script on the server machine
-
Run the client script on every client machine
After running the client script, the terminal will wait for a command to connect to the server. The command is /ola <username>
. After sending this command, if no other connected client is using the username you entered, you will be able to connect to the server. The left arrow will then turn green, and a message from the server will appear, indicating that you have been added to the chat.
Gongratulations!! You've succesfully connected to the server, and now you are able to send and receive messages to every other online client.
You can also use various functionalities in the group chat, which are listed in the following table:
Command | Explanation |
---|---|
/ola <username> |
Enters the chat |
/tchau |
Exits the chat |
/list |
Lists every online user |
/friends |
Lists your friends names |
/add <username> |
Adds <username> to your friend list |
/rmv <username> |
Removes <username> from your friend list |
/ban <username> |
Starts voting to ban <username> from chat |
/vote <y or n> |
Votes to ban (y) or to not ban (n) while at voting |
/kill |
Exits chat and closes client application |
/help |
Lists every usable command |