Automatic image tagging in Hasura Cloud with Cloudinary and Autocode
This tutorial demonstrates how to build an image storage integration with Hasura that automatically tags images using Cloudinary and Autocode. The user journey involves uploading a photo, waiting for analysis, receiving suggested categories, and saving them to the right location. The data journey includes uploading a binary to a CDN, persisting a reference along with user and user data in a database, updating the image with suggested categories, presenting that data to the user, and returning their confirmations back into the database. The architecture is simplified using Hasura's "actions" feature, which allows for custom resolvers that expose webhooks as part of an API. The stack includes Cloudinary for image analytics, storage, and auto tagging; Autocode for managing the resolver or proxy; and Hasura for user-data persistence layer service orchestration. Modeling data using Hasura Console involves creating a join table to support individual images having individual tags with their own confidence rating. Custom business logic is handled by Autocode, which includes promise wrappers around Cloudinary SDK, simple transformation utility, and glue layer for stitching services together. The API is now shippable and can be consumed on web-aware clients. Monitoring and performance tuning are crucial for resilient apps, with Hasura offering error monitoring, response time tracking, tracing, and the ability to convert actions to asynchronous events.
Company
Hasura
Date published
April 29, 2021
Author(s)
Jesse Martin
Word count
1083
Hacker News points
None found.
Language
English