Vendiot is a real-time IoT dashboard for monitoring and managing vending machine data, utilizing MQTT for message communication and AWS Timestream for data storage and queries.
Before you begin, ensure you have the following:
npm install npm@latest -g
.Ensure that you have the required AWS credentials (access key ID, secret access key, and optionally a session token) to configure the project's environment variables for AWS connectivity.
After installing the prerequisites, proceed to the Installation section to set up the project.
To set up the project locally, follow these steps:
git clone https://github.com/darrenmlouw/VendIoT.git
Navigate to the Porject Directory
cd VendIoT
Install Node Dependencie
npm install
Before starting the project, you will need to add the following environment variable in the .env file in the root folder of the project.
The .env already contains the following variables
VITE_MQTT_ENDPOINT=a2fr1lhmxa6xyh-ats.iot.us-east-1.amazonaws.com
VITE_AWS_REGION=us-east-1
VITE_AWS_ACCESS_KEY_ID=
VITE_AWS_SECRET_ACCESS_KEY=
VITE_AWS_SESSION_TOKEN=
where VITE_AWS_ACCESS_KEY_ID
and VITE_AWS_SESSION_TOKEN
will need to be filled with the respective values.
Start the Development Server
npm run dev
Open WebApp
http://localhost:5173/
Dashboard You will see a dashboard with a home icon, connect button, and a light/dark mode button.
Click the Connect
button, will initialise the connection to the MQTT and the timestream.
You can subscribe to any topic
reactTest/freeVend
, and reactTest/vendEvents
are both subcribed to, a drop-down will appear to send a message to reactTest/freeVend
in which the message will be received at reactTest/vendEvents
Currently only the DC Graph of the Machine Status is shown, along with the prive of the vendEvents