TarasMaks / mqtt-web-panel

Real-time web interface for MQTT.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MQTT Web Panel

Real-time web interface for MQTT.

Build Status

Screencapture


Demo

Demo on Heroku.

Features

  • Real-time update data
  • Displays statistics for the selected period
  • Responsive interface
  • RESTful API

Requirements

  • Node.js >= 8.5
  • MongoDB >= 3.4

Getting Started

Install locally

git clone git@github.com:mingruport/mqtt-web-panel.git
cd mqtt-web-panel
npm install
npm start

Your app should be running on localhost:3000.

Install on Raspberry Pi

Install Node.js:

$ sudo apt install nodejs

Check installation:

node -v

Install mqtt-web-panel:

git clone git@github.com:mingruport/mqtt-web-panel.git
cd mqtt-web-panel
npm install
npm start

Deploying to Heroku

heroku create
git push heroku master
heroku open

Deploy

Testing

Execute this command to run tests:

npm test

Environment variables

Variable Default Description
PORT 3000 Port to run the API on
MONGODB_URI - Database URL
TIME_ZONE 00:00 Local time zone
MQTT_URL - MQTT server URL
MQTT_PORT - MQTT server port
MQTT_USERNAME - MQTT server username
MQTT_PASSWORD - MQTT server password

API

  • GET /api/widgets/ Get all widgets.

  • GET /api/widgets/{id} Get a single widget.

  • POST /api/widgets/ Create a new widget.

  • PUT /api/widgets/{id} Update widget.

  • DELETE /api/widgets/{id} Delete widget.

  • GET api/widgets/{id}/events&period={period} Get widget events.

License

This project is licensed under the MIT License.

About

Real-time web interface for MQTT.

License:MIT License


Languages

Language:JavaScript 75.9%Language:HTML 21.0%Language:CSS 3.2%