A web-based MQTT client application built with FastAPI and Python, providing a user interface for MQTT broker connections, message publishing, and topic subscriptions with real-time WebSocket updates.
- 🔌 Connect to MQTT brokers
- 📝 Publish messages to topics
- 📩 Subscribe to topics
- 🔄 Real-time updates via WebSocket
- 🎨 Clean web interface
- 🐳 Docker support
Screenshots
Home Page
MQTT Broker Connection Interface
Main Dashboard with Publish/Subscribe Features
- Docker and Docker Compose
- MQTT Broker (e.g., Mosquitto)
- Clone the repository:
git clone <your-repository-url>
cd mqtt-client-app- Configure environment variables:
# .env
MQTT_BROKER_HOST=host.docker.internal
MQTT_BROKER_PORT=1883
MQTT_USERNAME=your_username # Optional
MQTT_PASSWORD=your_password # Optional
API_HOST=0.0.0.0
API_PORT=8000- Build and run with Docker Compose:
docker-compose up -d --buildThe app will be available at: http://localhost:8000
- Create virtual environment:
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt- Run the app:
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000GET /: Home pageGET /connect: Connection pageGET /dashboard: DashboardPOST /api/connect: Connect to brokerPOST /api/disconnect: DisconnectPOST /api/subscribe: Subscribe to topicPOST /api/unsubscribe: UnsubscribePOST /api/publish: Publish messageGET /api/connection-status: Connection statusWebSocket /ws: Real-time updates
pytestMIT License - see the LICENSE file for details.


