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.
- Host: GitHub
- URL: https://github.com/djdurga/real_time_chatbot
- Owner: Djdurga
- License: mit
- Created: 2025-06-18T18:07:04.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-18T18:44:51.000Z (about 1 year ago)
- Last Synced: 2025-06-18T19:42:03.052Z (about 1 year ago)
- Language: Python
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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:**

**Akankshaβs Chat:**

### πͺ GUI Client (Tkinter)
**Desktop Chat Window:**

> π 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!
```