Skip to content

DigarSingh/GUI-Based-Chat-App

Repository files navigation

Chat Application

This project contains both a console-based C chat application and a GUI-based Python chat application that are interoperable with each other.

Project Structure

  • C Implementation:

    • client.c: Console-based chat client
    • server.c: Chat server implementation
    • common.h: Common definitions used by both client and server
  • Python Implementation:

    • chat_client.py: Tkinter GUI chat client
    • chat_server.py: Python implementation of the chat server
  • Data Files:

    • users.txt: Stores user account information
    • chatlog.txt: Stores chat history
    • chat_logs/: Directory containing daily chat logs (Python client only)

Features

  • User registration and authentication
  • Public chat messaging
  • Private messaging between users
  • Chat history viewing
  • Encryption of messages (simple Caesar cipher for demonstration)
  • File-based chat logs
  • Cross-compatibility between C and Python clients

Running the Application

Server

You can run either the C server or the Python server:

C Server:

server.exe

Python Server:

python chat_server.py

The server will start listening on port 8888 by default.

Client

You can use either the C console client or the Python GUI client:

C Client:

client.exe [server_ip]

Python Client:

python chat_client.py

In both clients, if you don't specify a server IP address, it will default to 127.0.0.1 (localhost).

Python GUI Client Features

The Python Tkinter client provides the following features:

  1. User Authentication:

    • Login with existing credentials
    • Register new user accounts
  2. Chat Interface:

    • Scrollable message display
    • Different colors for different message types
    • Timestamps for all messages
  3. Messaging Features:

    • Send public messages to all users
    • Send private messages to specific users
    • View chat history
  4. Notifications:

    • Window title updates for new messages
  5. File Logging:

    • Automatic logging of chat messages to daily log files
    • Logs stored in a chat_logs directory

Protocol Compatibility

Both the C and Python implementations use the same message structure and protocol, ensuring compatibility between them. This means:

  • A Python client can connect to a C server
  • A C client can connect to a Python server
  • Python and C clients can chat with each other through either server

Dependencies

C Implementation

  • Windows socket library (ws2_32.lib)

Python Implementation

  • Python 3.6 or higher
  • Standard library modules only (no external dependencies)

Notes

  • The encryption used (Caesar cipher) is for demonstration purposes only and is not secure.
  • Both server implementations store user credentials in plaintext, which is not secure for production environments.
  • The Python client creates a separate log file for each day in the chat_logs directory.

License

This project is provided as educational material and can be freely used and modified.

About

This project contains both a console-based C chat application and a GUI-based Python chat application that are interoperable with each other.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors