Vending Machine Network

My engineering capstone project at UCSC is building a connected vending machine. The “vending machine” part isn’t that important to what I want to talk about here. I want to focus on my approach to designing and implementing a scalable IoT service.

tech stack

The basis of this whole thing will be fastify, a really fast web framework that I have been enjoying. One of its main selling points is how bare bones it is. You can pull in functionality via plugins exactly when you need it.

The IoT component will be MQTT, a standard in IoT for good reason. The publisher/subscriber model is great for managing many devices that may disconnect or drop messages. I used oracle mosquitto, since it’s pretty easy to setup and I wanted to use a self hosted broker.

The front end is a static web app powered by Vue.

I have this all running in AWS, which is my go to when standing up a web service. The only AWS exclusive tool I am using is DynamoDB, but you could switch it out with MongoDB without too much work.

The only big structural change needed now would be putting everything behind a proxy. Once that is in place, this whole thing is highly scalable and pretty damn fast.

← back to home