Hacking an IoT App at the Civo Hackathon, 2021
Tags: hackathon, esp8266, react, elixir
Published: 2021-12-05 17:25:53

## Overview
[Civo](civo.com/) organised its very first [hackathon](https://civohacks.devpost.com/) and we got a chance to work on a great project with a skilled team. Thanks to Civo for the experience. Our project, [Home Smart Home](https://devpost.com/software/home-smart-home-h2s), won the _Best IoT Hack_ prize.

See the [video demo](https://youtu.be/qWCET0xlMPM)!

## Table of contents
1. [Meet the team](#team)
2. [About the project](#project)
3. [How we built the project](#process)
4. [Our experience with Civo](#experience)
5. [What's next for our project](#next)
6. [Repo links](#links)

## Meet the team <a name="team"></a>
Our team comprises of three members with varied experiences and expertise ranging from full-stack web development to programming microcontrollers like NodeMCU ESP8266 and RaspberryPi.
Here's a brief introduction of each of the members:
- [Atchyut](github.com/theonly1me) is a full-stack developer with expertise on both the front-end and back-end development he was behind the ReactJS PWA UI app we developed as a part of this hackathon.
- [Kevin](github.com/kevinam99) is a backend developer with expertise working with NodeJS, Python and [Elixir](https://elixir-lang.org/), which he used to build the back-end application for our app with the [Phoenix web framework](https://www.phoenixframework.org/).  
- [Hardik](github.com/hardikchadda) is a lecturer at Dayalbagh Educational Institute, Agra, with expertise with Python, ML, AI & IoT. He built the IoT backend using C++ and a NodeMCU ESP8266 microcontroller which queries our backend API and talks to the smart devices. He's also programmed the microcontroller to turn non-smart devices into smart devices by just attaching it to a switchboard.

While the three of us have strong expertise in what we do, we're all DevOps and cloud enthusiasts and that is the reason we came together and built this project as a part of the Civo hackathon

## About the project <a name="project"></a>
[Home Smart Home](https://devpost.com/software/home-smart-home-h2s), H2S, allows its users to register their smart devices and control them remotely. As an MVP, users can turn their devices on and off right from their internet-enable devices, however, we plan to incrementally update this to keep adding new features. 

Our initial goal was to build a simple platform to allow a layperson to be able to get into the world of IoT and smart devices. The innovation behind our app is that, users can even turn their non-smart devices to smart-devices with little to no programming knowledge and highly available hardware using some utilities that our Hardik is currently developing. 

As for the app itself, we initially planned on going with a React Native mobile app, but ended up going with a ReactJS PWA since we wanted the users to not just be limited to using a smartphone to automate their homes. Now, they can pretty much use any smartphone, tablet or computer in order to automate their homes.

## How we built the project <a name="process"></a>
Our app consists of a front-end PWA, a back-end API layer and the actual IoT Component. Here's a breakdown for each of these components:

**Front-end PWA App** - This app was built using ReactJS, Tailwind CSS, React hooks for state management and CRA's PWA Capabilities

**Back-end API Layer** - Our back-end currently consists of the API layer that both, the front-end app as well as the IoT component, use in order enable, disable, turn-on, turn-off, register smart devices into our system. Our app is built on the Phoenix framework using Elixir programming language and PostgreSQL DB. This is the component that we've deployed on a Civo Compute instance.

**IoT Component** - Our IoT component contains various utilities that are built using C++ and run on top of an NodeMCU ESP8266 microcontroller. The utilities are subscribed to our back-end API on a pub-sub model whenever there are changes in the DB, they query the API and communicate with the smart devices.

## Our Experience with Civo <a name="experience"></a>
Our experience with the Civo platform has been great, while we were all new to DevOps, the guides on the Civo website helped us in deploying our backend micro-service on Civo. It's been a great experience and we definitely plan on using the platform as we scale up. It is remarkable how fast the Compute instance and the Kubernetes cluster were created. 

## What's next for our project <a name="next"></a>
We plan to make our PWA available to as many users as possible. We've also started enhancing our platform to be able to have more features such as being able to control various aspects of a smart device than only being able to turn it on/off. With this, we're also developing kits that users can use in order to turn their non-smart devices to smart-devices. We believe there's a lot of hidden potential in what we build and that we're onto something really good. 

For now, the goal is to enable as many users as possible to use our platform for free, while the platform itself will always remain free, we plan to add a monetization model the kits that we produce to enable non-smart devices to behave like smart-devices and that would be our fundamental business model. 

However, at the place we're currently at, there's so many directions we can go in and we're really excited to build on top of this. 

## Links to the repos <a name="links"></a>
- [IoT](https://github.com/hardikchadda/CIVO-Hackathon-HomeSmartHome)
- [API back-end](https://github.com/kevinam99/civo-hack-backend)
- [Front-end](https://github.com/theonly1me/civo-hack-ui)