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:
- Node.js: VendIoT requires Node.js LTS to run. Download and install it from nodejs.org.
- npm: npm (Node Package Manager) is used to install dependencies. It comes with Node.js, but you can ensure you have the latest version by running
npm install npm@latest -g
. - Git: Git is required to clone the repository. Download and install it from git-scm.com.
- AWS Account: Since the project utilizes AWS services, including AWS IoT and Timestream, you need an AWS account.
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:
- Clone the repository:
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/status: receives a message every 5 seconds.
- reactTest/vendEvents: receives an event at an unpredictable time
- reactTest/freeVend: Once
reactTest/freeVend
, andreactTest/vendEvents
are both subcribed to, a drop-down will appear to send a message toreactTest/freeVend
in which the message will be received atreactTest/vendEvents
-
Currently only the DC Graph of the Machine Status is shown, along with the prive of the vendEvents