Serverless · Freelance
Presigned-Upload Document Parsing API
SAM stack where a client requests a presigned S3 URL, uploads a PDF directly, and an S3-triggered Lambda parses it and stores computed results.
// Overview
Three Lambdas sit behind API Gateway with CORS. One generates a document ID, writes metadata and returns a presigned PUT URL; one is triggered by the S3 event, parses the PDF into a typed model and runs a calculator; one returns results by ID. A layer holds dependencies and a Makefile packages and deploys.
// The problem
Users needed to upload statements and get structured, computed results back without the file passing through the API tier.
// Flow
- POST uploadcreate an ID, save metadata, return a presigned URL
- Direct uploadclient PUTs the file straight to S3
- S3 eventobject-created invokes the parse Lambda
- Parseline parsers map text to a typed model
- Calculatehelpers produce results
- Storeresults written to the record
- GET results gateresults returned by ID
// Design decisions & guardrails
- Presigned upload avoids API payload limits and keeps files off the Lambda path.
- Asynchronous, ID-keyed results pattern.
- A layer for heavy dependencies; make-based reproducible deploys.
// Outcome
Scalable document intake with no servers.