An open API service indexing awesome lists of open source software.

https://github.com/djdurga/real_time_chatbot

It allows: Multiple users to connect to a central server and exchange messages in real-time. Users to choose between: Terminal/CLI chat client, or Desktop GUI chat client (with Tkinter). Smooth bi-directional communication over TCP sockets.
https://github.com/djdurga/real_time_chatbot

Last synced: about 1 year ago
JSON representation

It allows: Multiple users to connect to a central server and exchange messages in real-time. Users to choose between: Terminal/CLI chat client, or Desktop GUI chat client (with Tkinter). Smooth bi-directional communication over TCP sockets.

Awesome Lists containing this project

README

          

## πŸ’¬ Real-Time Chatbot using Python (Terminal + GUI)

This project is a simple yet powerful real-time chat application built using **Python's socket programming** and **threading**. It supports both **terminal-based clients** and a **desktop GUI** made with **Tkinter**. The server can handle multiple clients chatting simultaneously in real time.

---

## 🧾 YAML Summary

```yaml
project:
name: Real-Time Chatbot
tech_stack:
- Python
- Socket Programming
- Threading
- Tkinter
interfaces:
- Terminal-based chat client
- GUI-based chat client
communication: TCP sockets
concurrency: Multithreaded server & client
version: 1.0
license: MIT
````

---

## πŸ“ Project Structure

```
real_time_chatbot/
β”‚
β”œβ”€β”€ realtime_chatbot/
β”‚ β”œβ”€β”€ __init__.py
β”‚ β”œβ”€β”€ server.py # Core server code
β”‚ β”œβ”€β”€ clients.py # Terminal-based client
β”‚ └── gui_client.py # GUI-based client using Tkinter
β”œβ”€β”€ screenshots/ # Images of terminal and GUI chat
β”œβ”€β”€ pyproject.toml # Poetry dependency manager config
└── README.md # Project documentation
```

---

## βš™οΈ Prerequisites

* Python 3.x
* [Poetry](https://python-poetry.org/docs/#installation) (for managing dependencies)

### πŸ“¦ Install Poetry

```bash
pip install poetry
```

### πŸ“₯ Install Project Dependencies

```bash
poetry install
```

---

## πŸ› οΈ Libraries Used

| Library | Purpose |
| ------------ | ------------------------------------------------ |
| socket | Real-time communication between server & clients |
| threading | Handles multiple clients concurrently |
| tkinter | GUI interface for chat client |
| scrolledtext | Scrollable chat window in GUI |
| simpledialog | Prompt for username in GUI client |
| poetry | Dependency and virtual environment management |

---

## πŸš€ How to Run

### 1️⃣ Start the Server

```bash
poetry run python -m realtime_chatbot.server
```

Expected output:

```
Server started on port 5555
```

### 2️⃣ Start a Terminal Chat Client

Open a new terminal and run:

```bash
poetry run python -m realtime_chatbot.clients
```

### 3️⃣ Start a GUI Chat Client (Optional)

In another terminal, run:

```bash
poetry run python -m realtime_chatbot.gui_client
```

> Each client will be prompted to enter a **username** upon joining.

---

## πŸ–ΌοΈ Screenshots

### πŸ§‘β€πŸ’» Terminal Clients

**Durga’s Chat:**

![Durga Terminal](screenshots/durga_terminal.png)

**Akanksha’s Chat:**

![Akanksha Terminal](screenshots/akanksha_terminal.png)

### πŸͺŸ GUI Client (Tkinter)

**Desktop Chat Window:**

![GUI Chat](screenshots/gui_client.png)

> πŸ“ Make sure to store these images in the `screenshots/` folder inside your GitHub repository.

---

## πŸ“Š Features

* πŸ’¬ Real-time chat communication
* πŸ‘©β€πŸ’» Terminal and desktop (GUI) chat options
* πŸ§‘β€πŸ€β€πŸ§‘ Multi-client support with threads
* πŸͺŸ Scrollable chat window in GUI
* 🧾 Clean and readable messages with usernames

---

## πŸ’‘ Highlights

* πŸ”— Uses `socket` and `threading` for efficient real-time communication
* 🧱 Clean folder structure for CLI and GUI components
* πŸ§ͺ Easy to extend into a production-grade chat server
* 🎯 Great learning project for Python networking and GUI design

---

## 🚧 Future Enhancements

* πŸ•’ Add timestamps to messages
* πŸ” Add encrypted messaging (SSL/TLS)
* 🌐 Build a web version (FastAPI + WebSockets)
* πŸ€– Integrate ChatGPT or LLM chatbot
* πŸ“Š Save chat history in SQLite or MongoDB
* πŸ“¦ Dockerize the full application

---

## πŸ‘©β€πŸ’» Author

**Durga Rani**
*M.Tech in Data Science & AI | Passionate about Python, Analytics, and Communication Systems*

---

## πŸ“œ License

This project is licensed under the **MIT License**.
See the [LICENSE](./LICENSE) file for details.

---

## πŸ™Œ Acknowledgment

* πŸ’Ύ Inspired by real-world chat systems and client-server architecture
* 🧠 Built as a hands-on networking + GUI programming project

---

## πŸ“Œ Summary

This project provides a solid foundation in:

* Python network programming
* Multithreaded client-server architecture
* GUI interface design using Tkinter

Whether you're building a collaborative tool or learning real-time systems, this is a great starting point!

> πŸ’¬ β€œCode is like humor. When you have to explain it, it’s bad.” – *Cory House*

---

## βœ… What to Do Next

1. **Save this file as `README.md` in your root project folder**
2. **Create a `screenshots/` folder**
3. **Add the 3 images you captured and rename them to:**

* `durga_terminal.png`
* `akanksha_terminal.png`
* `gui_client.png`
4. **Commit and push everything to GitHub!**

---

## πŸ“¦ Optional Extras

Would you like the following files added to complete your project setup?

* βœ… `LICENSE` file (MIT)
* βœ… `.gitignore` file (Python + Poetry support)

Let me know and I’ll generate them for you!

```

---

Let me know if you’d like this exported as a downloadable file or if you need me to generate the `LICENSE`, `.gitignore`, or `requirements.txt` as well!
```