Last week an internal CCv2 and Kyma Hackathon took place, which happened worldwide (Poland, Germany, Canada and USA). We (Sladana, Andreas and me) from Labs were the Batman Returns Team. Our first (and only) challenge was to be in the office before 9am. Have you ever seen Bruce Wayne before 12 noon?
For the hackathon we decided to implement three use cases:
- Batman drives with his Batmobil crazy and unfortunately something breaks. With a few IoT sensors, an Arduino and Kyma, the damaged product is detected and added to the shopping cart. Batman receives a notification.
- Have you ever seen Batman writing on a smartphone? He doesn’t need it because we’ve implemented a solution that allows him to write reviews through facial recognition and sentiment analysis.
- (Danger: This text contains advertising) Robin is a nice guy and CCv2 makes it super easy and smooth to add new products. Therefore he adds some weapons to the catalog from time to time and the bad guys buy them. That’s the reason Batman wants to be notified when e.g. Joker buys one of these products to deliver the rocket directly.
Batmobile gets damaged
The Batmobil was printed in 3D and prepared with some aluminium foil and an Arduino. It drives on the foil and a damage is detected as soon as it drives off. The Arduino is connected to my laptop running Johnny-Five and a Node.js app. This app calls the batmobile-damaged lambda function. The HTTP call can be defined in Kyma. The batmobile-damaged lambda function creates a shopping cart, adds the product batmobile_lower_part to it and sends a push notification. AppDelegate for the iOS-App listens for push notifications and calls the newNotification function in the ViewController. This opens the shopping cart page in a browser on the mobile phone.
Writing A Review
A static HTML page which can be opened on the phone allows Batman to write a review by taking a Selfie. The static page converts the picture into a base64 string and calls the emotion-recognition lambda function. For the sentiment analysis we are using an external service from algorithmia.com. Depending on the result, the rating text and stars ⭐️ are created. Then the add-review lambda function is called internally to add the review to the product.
The lambda function batman-notification listens for the order created event which is configurable in Kyma and reads the order information. To take a small shortcut, I search for products over 10k in value. You can also go through all products and check if the order contains a weapon. A push notification will then be created with the username and total amount. The ViewController for the iOS app checks if there is a username and displays the customer information on the smartphone. Batman can then press a red button to deliver the rocket “directly”. This opens a YouTube video in the mobile phone’s browser.
This was a great Hackathon with a great team and very well organized – thank you!
Our source code is available on Github: kymaccv2hackathon2018/Batman-Returns
And of course we won the first place together with Team Stray Dogs (not on the picture).