Skip to content

Ansh-1019/chat_application

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

💬 Real‑Time Chat Application in Python

Python Version License: MIT

A simple client‑server chat application built from scratch in Python using the socket and threading modules. It supports two‑way, real‑time messaging in the terminal and demonstrates core networking and concurrency concepts.


📝 Table of Contents

  1. Features
  2. Prerequisites
  3. Getting Started
  4. Project Structure
  5. What I Learned
  6. Future Improvements
  7. Contributing
  8. License

🔥 Features

  • 🔄 Two‑way real‑time chat over TCP (localhost)
  • 🤖 Multithreading for simultaneous send/receive
  • 🌐 Client‑Server architecture using Python’s socket API
  • 🛡️ Graceful shutdown via the "exit" command
  • 📚 Clean, well‑commented code for learning and extension

⚙️ Prerequisites

  • Python 3.7 or higher
  • Basic familiarity with command‑line/terminal
  • (Optional) Git for version control

🚀 Getting Started

Clone the Repo

git clone https://github.com/Ansh-1019/chat_application.git
cd chat_application

Run the server

Open terminal 1:

python server.py

Run the client

Open terminal 2:

python client.py

📁 Project Structure

chat_application/
├── server.py           # Starts the chat server
├── client.py           # Connects as chat client
├── README.md           # Project overview and instructions
└── LICENSE             # MIT License

📚 What I Learned

  • Fundamental socket programming (AF_INET, SOCK_STREAM, bind, listen, accept, connect).

  • Multithreading in Python and thread lifecycle (start(), join()).

  • Handling I/O‑bound tasks concurrently despite the GIL.

  • Graceful error handling (using try/except) in network code.

  • Debugging real‑world issues: thread start/join errors, port conflicts, Git branch problems.

🚧 Future Improvements

  • ✅ Multi‑client support (broadcast to all clients).

  • ✅ Message history storage (e.g., in a file or database).

  • ✅ GUI front‑end (Tkinter, PyQt, or web-based with Flask + WebSockets).

  • ✅ Encryption using SSL/TLS.

  • ✅ Dockerization for easy deployment.

🤝 Contributing

Contributions, issues, and feature requests are welcome!

1.Fork the repository

2.Create a feature branch (git checkout -b feature/YourFeature)

3.Commit your changes (git commit -m "Add YourFeature")

4.Push to the branch (git push origin feature/YourFeature)

5.Open a Pull Request

📝 License

This project is licensed under the MIT License. See the LICENSE file for details.

Made with ❤️ by Ansh Jaiswal


About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages