AWS Builder Center

Building HopperAudit: An AI-Powered Mobile QA Platform on AWS (wemakedev.org)

In the world of quality control and compliance, manual visual inspections are time-consuming and prone to human error. Enter HopperAudit—a comprehensive AI-powered visual inspection platform that allows users to capture images from mobile devices and automatically run them through a YOLO object detection model to generate instant QA/QC insights.

🏗️ The Architecture Stack

HopperAudit is designed for speed, scalability, and ease of deployment. The stack is broken down into three main tiers:
  1. The Mobile Frontend (Expo/React Native): A cross-platform application that handles camera interactions, gallery selections, and offline-first state management.
  1. The API Backend (FastAPI): An asynchronous, high-performance Python backend that orchestrates database transactions, user authentication, and AI model inference.
  1. The Infrastructure (AWS + Terraform): The entire cloud environment is defined as Code (IaC) using Terraform, ensuring the environment is 100% reproducible.

AWS Services Breakdown

  • Amazon ECS with AWS Fargate: Our containerized FastAPI application runs on serverless compute. Fargate scales effortlessly based on CPU/Memory usage, meaning we don't have to manage EC2 instances.
  • Amazon Aurora Serverless v2 (PostgreSQL): Handles relational data (users, stations, inspection scores). Serverless v2 scales up instantly during high inspection volume and scales down during off-hours, optimizing costs.
  • Amazon S3: Stores the raw user-uploaded images and the AI-annotated bounding-box images.
  • Amazon ECR: A private Docker registry for our FastAPI backend image.
  • Application Load Balancer (ALB): Routes traffic from the mobile app to the ECS Fargate tasks securely.



💡 The Challenge: Mobile Image Uploads vs. Computer Vision

One of the most interesting technical hurdles we faced was optimizing the image upload pipeline.
Initially, the React Native app used standard  multipart/form-data  to upload images directly to the FastAPI backend. However, React Native's  fetch()  implementation and  FormData  polyfills are notorious for dropping boundaries or mangling binary payloads when dealing with multiple files. This caused our FastAPI backend to repeatedly throw  422 Unprocessable Entity  errors.
When we eventually got the files to reach the backend, we hit a second wall: Corrupted Bytes. Because the mobile app was wrapping the image in a multipart payload, our backend computer vision library ( cv2.imdecode ) was trying to decode the boundary headers alongside the JPEG bytes, resulting in a fatal  ValueError: Could not decode image .

The Solution: Presigned S3 URLs + Native Binary Uploads

We completely re-architected the upload flow to bypass the backend and leverage the sheer scale of Amazon S3.
  1. Request S3 Presigned URLs: The mobile app asks the FastAPI backend for short-lived, securely signed S3 upload URLs.
  1. Native Binary PUT: Instead of relying on the buggy JS  fetch().blob()  polyfill, we utilized Expo's native  expo-file-system . We configured it to do a direct HTTP  PUT  using raw binary content ( uploadType: FileSystemUploadType.BINARY_CONTENT ).
Plain text


Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article