From 5e8c889aa7d60be216beb6463f2920e19b4eda32 Mon Sep 17 00:00:00 2001 From: Kevin Midboe Date: Sat, 29 Jul 2023 14:31:57 +0200 Subject: [PATCH] Project README --- README.md | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..b9a64e3 --- /dev/null +++ b/README.md @@ -0,0 +1,66 @@ +# Hive monitor + +Hive monitor is a frontend for displaying data from MQTT server receiving events from bee hives. The complementary project [hivemonitor-ESP32-firmware]() reads sensor values and publishes on MQTT topic. + +# Requirements + +This sveltekit project requires Node.js and yarn installed: + +- [node.js]() +- [yarn]() + +Page requires data from MQTT topic, use a public or locally hosted MQTT broker: + +- [Connect to public broker]() +- [Setup and connect to self hosted broker]() + +# Config + +Set `PUBLIC_MQTT_BROKER_WS_URL` environment variable for MQTT broker. Since browsers don't support MQTT natively we want to connect to MQTT over WebSockets for events. + +```bash +cp .env.example .env + +# edit .env in favorite text editor +``` + +# Run + +Using docker: + +```bash +docker run -p 8080:8080 ghcr.io/KevinMidboe/hivemonitor:latest +``` + +# Setup + +## Install + +Clone repo, navigate into folder and install node dependencies: + +```bash +git clone https://github.com/KevinMidboe/hivemonitor.git +cd hivemonitor +yarn +``` + +## Development + +Run development server using `yarn dev` command. Add `--host` flag for allowing connections for any device on same network. + +## Production + +Build static files and serve them with your favorite webserver, or use included docker configuration. + +Compile project into static files located at generated folder: ./build. + +```bash +yarn build +``` + +Build and run using nginx in docker: + +```bash +docker build -t hivemonitor . +docker run -p 8080:8080 --name hivemonitor-frontend hivemonitor +```