
Weekend Annoying Task Challenge: Event Ledger
A fully serverless expense tracker that utilizes Amazon Textract and generative AI to instantly parse event receipts, automatically convert local currencies to USD, and generate executive budget summaries.
Vision & What the app does
When my senior alumni leader, Mubashar Bhai, shared this Weekend Challenge with me just two hours ago, I knew I had to jump on it immediately. I was able to build and deploy this project at lightning speed because it targets a massive bottleneck I’ve desperately wanted to solve.
As a student learning artificial intelligence and cloud computing, I spend a lot of my time organizing local tech community events, hackathons, and meetups. Organizing these initiatives is incredibly rewarding, but the post-event financial reconciliation is a logistical nightmare.
At the end of a multi-campus hackathon or a large workshop, I am always left with a chaotic stack of paper receipts for venue spaces, pizza, and swag. Manually typing vendor names, dates, and amounts from these receipts into a spreadsheet to prove we stayed within our allocated sponsor budget is a highly annoying, repetitive task. To make matters worse, while target budgets are often set in USD, local event receipts are printed in local currency, requiring tedious manual conversions.
To solve this, I built Event Ledger: an automated expense extractor and AI-powered post-event financial summarizer. You simply bulk-upload photos of your event receipts. The app automatically extracts the vendor name and total, grabs the live USD exchange rate, converts the amount, and saves it. With one click, it generates a polished, executive-level expense summary ready to be sent to sponsors or community managers.
How I Built It
I started with a Next.js frontend styled with Tailwind CSS to keep the UI clean and responsive. I used the
@aws-sdk/client-s3 library to allow users to select multiple receipt images and push them directly into an Amazon S3 dropzone.The core of the application relies on event-driven serverless computing. The moment an image lands in the S3 bucket, it triggers a Node.js AWS Lambda function. This function passes the image to Amazon Textract to perform Optical Character Recognition (OCR). Once the vendor name and raw currency amounts are parsed, the Lambda function calls a free public exchange rate API to convert the amount to USD, formats the data, and writes it directly into an Amazon DynamoDB table.
Challenges & Key Decisions:
I ran into several hurdles that tested my cloud troubleshooting skills under a two-hour time crunch:
- The 3-Second Timeout: Initially, my database remained empty despite successful uploads. By diving into Amazon CloudWatch logs, I realized Textract takes about 4–8 seconds to analyze an image, but Lambda defaults to a 3-second timeout. Bumping the execution timeout to 30 seconds instantly fixed the pipeline.
- SDK Parameter Typos: I encountered an
InvalidParameterExceptionfrom Textract. I discovered that for theAnalyzeExpenseCommand, the correct parameter key isDocument, notDocumentLocation.
- Amplify Environment Variables: When deploying the frontend, my AWS Amplify build failed because I used
AWS_ACCESS_KEY_ID. I learned that Amplify reserves theAWS_prefix for its internal systems, so I had to map my keys using a customAPP_prefix.
- CORS & AI Integration: I integrated Google Gemini 1.5 Flash via a simple Fetch API call inside a second Lambda function to generate the final report. I exposed this function via a Lambda Function URL and resolved a tricky double-header CORS issue to connect it seamlessly to my Next.js frontend.
AWS Services Used / Architecture Overview
The application utilizes a fully serverless, pay-as-you-go architecture on the AWS Free Tier:
- AWS Amplify: Hosts the Next.js frontend application and manages continuous deployment from GitHub.
- Amazon S3: Acts as the primary storage dropzone for incoming receipt images.
- AWS Lambda (ProcessReceipt): Triggered automatically by
s3:ObjectCreated:*events. It orchestrates the OCR, currency conversion, and database writing.
- Amazon Textract: Specifically utilizes the
AnalyzeExpenseAPI to intelligently pullVENDOR_NAMEandTOTALfields without needing custom machine learning models.
- Amazon DynamoDB: A NoSQL database that stores the parsed receipt data, utilizing the
eventIdas the partition key to easily group receipts by specific community events.
- AWS Lambda (GenerateReport): Exposed via a Function URL, this function is triggered manually by the user from the frontend. It queries DynamoDB for all items matching the
eventId, calculates the totals, and prompts an LLM to write the final summary.
- Amazon CloudWatch: Essential for monitoring function invocations and debugging timeout errors.
(Architecture Flow)
Next.js UI $\rightarrow$ Amazon S3 $\rightarrow$ Event Trigger $\rightarrow$ Lambda (Textract + Exchange API) $\rightarrow$ Amazon DynamoDB $\rightarrow$ Lambda (Generative AI Summary) What I Learned
This challenge was a fantastic crash course in cloud infrastructure. I learned that writing the application code is only half the battle; properly configuring IAM roles (like
AmazonTextractFullAccess and AmazonDynamoDBFullAccess_v2 ), managing Cross-Origin Resource Sharing (CORS) for serverless endpoints, and reading CloudWatch logs are critical skills for any cloud developer. I also discovered how incredibly powerful managed AI services like Amazon Textract are, saving me from writing hundreds of lines of brittle regex parsing code.Link to App

Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article