1. Overview

This document describes my fully headless, serverless image upload architecture, built on top of AWS services. The goal was to provide an API-driven approach—with no dedicated frontend—so other applications or clients can easily integrate and upload images while adhering to specific file and quota constraints.

I used API GatewayLambdaS3, and DynamoDB to implement a flow that manages user usage limits, verifies uploaded files, and ensures each upload is appropriately tracked. Although the system started as a simple MVP (Minimum Viable Product), I have expanded it to handle file validation, user quotas, and more advanced features.

2. Core Architecture: The MVP

2.1 Basic Flow

  1. API Gateway + Lambda
  2. Amazon S3
  3. DynamoDB (Optional at the MVP stage)
  4. Download Flow

Why pre-signed URL?

3. File Type & Size Validation

3.1 The Need for Validation

By default, a pre-signed URL lets clients upload practically anything. I introduced validation to restrict file size or type (e.g., max 10 MB, only JPEG). Since the serverless Lambda doesn't see file contents during upload, I had to design a separate verification step.

3.2 Two-Stage Verification (Pending and Confirm)

  1. Requesting a pre-signed URL
  2. Confirming the Upload

This ensures files that don't match the declared metadata are removed.