A Python-based client-server chat application that demonstrates real-time messaging using TCP sockets. The project implements user authentication, multithreaded communication, and a desktop graphical interface, making it a practical introduction to network programming and distributed systems.
- 👤 User registration and login
- 🔐 Password hashing using SHA-256
- 💬 Real-time messaging between connected clients
- 🖥️ Desktop GUI built with Tkinter
- 🔄 Multithreaded server for handling multiple clients
- 📡 TCP socket communication
- 🗄️ SQLite database for user authentication
⚠️ Graceful handling of client disconnections
- Python
- Socket Programming (TCP)
- Tkinter
- SQLite
- Threading
- hashlib
ChatApp/
│
├── server.py # Multi-client chat server
├── client.py # Desktop chat client
├── database.py # Database initialization
├── register.py # User registration
├── login.py # User authentication
├── chat.db # SQLite database (generated)
├── README.md
└── requirements.txt
Clone the repository:
git clone https://github.com/shriyatallapragada/OIBSIP-Python-Programming.gitNavigate to the project folder:
cd OIBSIP-Python-Programming/ChatAppNo external packages are required as the project uses Python's standard library.
python database.pypython register.pyCreate a username and password.
python server.pyExpected output:
Server running...
Open another terminal for each client.
python client.pyEnter your registered username and password.
Once authenticated, users can exchange messages in real time.
SQLite Database
▲
│
Authentication
│
▼
┌──────────────────┐
│ TCP Server │
└──────────────────┘
▲ ▲
│ │
Client 1 Client 2
│ │
Tkinter GUI Tkinter GUI
- The server starts and listens for incoming client connections.
- A client connects using TCP sockets.
- Login credentials are sent to the server.
- The server validates the credentials against the SQLite database.
- If authentication succeeds:
- The client joins the chat.
- Other connected users receive a notification.
- Messages are broadcast to every connected client.
- If a client disconnects, the server removes the connection and notifies the remaining users.
Passwords are never stored as plain text.
During registration:
- The password is hashed using SHA-256
- Only the hashed value is stored inside the SQLite database
During login:
- The entered password is hashed again
- The server compares the hash against the stored value before granting access
This project helped strengthen my understanding of:
- Client-server architecture
- TCP socket programming
- Multithreading in Python
- GUI development with Tkinter
- Database integration using SQLite
- Password hashing and authentication
- Network communication
- Private messaging
- Chat rooms
- End-to-end encryption
- File sharing
- Image sharing
- Typing indicators
- Online/offline user status
- Message history
- Better error handling
- Cross-platform packaging
Add screenshots or a GIF demonstrating the application here.
<p align="center">
<img src="assets/login.png" width="750">
</p><p align="center">
<img src="assets/chat.png" width="750">
</p>This project was developed as part of my Python programming portfolio to explore networking concepts and desktop application development. It serves as a practical implementation of socket programming, user authentication, and concurrent client communication.
Developed for educational purposes as part of my Python programming portfolio.