Skip to content

Python based chat app that utilitizes MQTT for communications

License

Notifications You must be signed in to change notification settings

Horizonik/MQTTChatApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python versions MQTT Chat Tests Quality Gate Status

MQTT Chat Application

A Python-based chat application using MQTT for real-time messaging and file transfer capabilities.

Features

  • Real-time messaging between users
  • File transfer support
  • Message queueing for offline users
  • Client address discovery
  • Direct messaging capabilities

Prerequisites

  • Python 3.7+
  • paho-mqtt

Installation

  1. Clone the repository:
git clone [repository-url]
cd mqtt-chat-app
  1. Create and activate a virtual environment:
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  1. Install dependencies:
pip install paho-mqtt

Usage

Starting the Server

To start the chat server:

python src/chat_app.py server

The server will start and listen for incoming connections on the default MQTT port (1883).

Starting a Client

To start a chat client with a username:

python src/chat_app.py [username]

Replace [username] with your desired username.

Available Commands

Once connected as a client, the following commands are available:

  1. Send Message: Sends a message to the specified user.

    send <username> <message>
    

    Example: send alice Yooo, wassaup homie?

  2. Send File: Sends a file to the specified user.

    file <username> <filepath>
    

    Example: file bob /path/to/document.pdf

  3. Request User Address: Requests the client ID for the specified username.

    address <username>
    

    Example: address charlie

  4. Quit Application: Exits the chat application.

    quit
    

About

Python based chat app that utilitizes MQTT for communications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages