AWS Builder Center
Trash to Cash: How We Built ScrapHop on AWS

Trash to Cash: How We Built ScrapHop on AWS

Discover how ScrapHop uses Amazon Rekognition and AWS serverless architecture to instantly classify recyclable waste, calculate fair market prices, and connect households with verified local collectors.

AI/ML Student | Building AI & Cloud Solutions
You can get a pizza at your door before the movie loads. But if you want to sell a pile of Amazon boxes, you're still waiting for a guy with a cycle bell to happen to walk past your street.
ScrapHop started in our own room. One corner slowly turned into a mini-warehouse: cardboard boxes, takeout containers, empty bottles. We wanted it gone. But nobody had time to hunt down a local collector, and nobody wanted to stand there arguing about whether the stack was 4 kg or 8.
At some point it felt ridiculous. You can book a cab with two taps, so why does selling a few boxes feel like a chore from 1995?
So we asked ourselves something simple: what if you just took a photo, got an honest price instantly, and someone showed up to collect it?
That's ScrapHop. The rest of this post is how we built it on AWS, how Amazon Rekognition handled the messy reality of real scrap photos (and where it didn't), and what we got wrong along the way.

The Problem: Why Selling Scrap is Still Stuck in the 90s

Every home has that one corner. The balcony, the space under the bed. Old newspapers, flattened delivery boxes, a few plastic jars. Most people would happily sell it, but nobody wants to chase a kabadiwala or argue about a dodgy weighing scale. So a lot of it just goes in the bin.
When we looked at how the whole thing works, two problems stood out:
  1. Zero Price Transparency You don't know the price until the deal is already happening. Is that cardboard worth ₹50 or ₹200? What about the crushed bottles? Rates change all the time, so people guess, and then take whatever the buyer offers because they just want the clutter gone.
  1. Purely Random Logistics The logistics are basically luck. Collectors walk around calling out or ringing a bell, hoping someone has scrap ready. You're in a meeting, you miss them. You're running out the door, you miss them. Meanwhile they spend hours walking empty-handed. There's no schedule, no route, and no way to know whether a house has 2 kg or 40.

The Solution: Turning Scrap Selling into a 3-Step Flow

To fix this broken loop, we didn't want users dealing with complex categorization or guessing scrap rates. We compressed the entire experience into a fast, transparent flow:
  1. Snap and estimate. Take a photo of your pile and punch in a rough weight, say 5 kg of cardboard. You don't need to know the grade or look up rates.
  1. Get a price right away. The vision model figures out the category (plastic, cardboard, paper or metal). The pricing engine matches it with current local rates, multiplies by your weight, and gives you a fixed quote, like ₹350.
  1. Pick a slot. If the quote works for you, choose a time and a verified collector comes to your door


The Engine Room: How the Backend Runs on 100% Serverless AWS

Handling Heavy Mobile Uploads: S3 Presigned URL Architecture:

Handling high-resolution camera uploads on standard web servers usually leads to timeouts, heavy bandwidth costs, and server crashes. Here is how we engineered an event-driven ingestion pipeline to keep everything running fast and smooth.
  1. The Problem with Standard Uploads- Modern mobile phones take 4MB–8MB photos. Routing those massive image files directly through API servers clogs backend memory, spikes latency, and makes the app feel sluggish on mobile data.
  1. Bypassing the Server with S3 Presigned URLs- Instead of uploading images through an API endpoint, the frontend requests a secure, short-lived presigned URL from AWS. The client then uploads the image file directly to an Amazon S3 bucket. This completely removes the load from our core API.
  1. True Zero-Idle Scaling- Because we chose AWS Lambda over traditional EC2 instances or long-running containers, we don’t pay a single rupee when nobody is uploading. When traffic surges, Lambda scales horizontally in milliseconds with zero manual intervention.
  1. **Event-Driven AWS Lambda Execution-**An AWS Lambda function spins up instantaneously on-demand. It acts as the central coordinator it takes the S3 image reference, calls the Amazon Rekognition SDK to classify the waste, fetches active scrap rate indices, and calculates the final quote.

Instant Order Lock: Guaranteeing Payouts with Amazon DynamoDB:

When a user requests a pickup, the alert pings nearby collectors. Our biggest fear was simple: what happens if two collectors hit "Accept" at the exact same millisecond?
We didn't want two local dealers showing up at the same front door arguing over who gets the cardboard boxes.
  1. Conditional Writes (Zero Double-Booking): We used DynamoDB conditional writes to enforce a strict rule: an order can only be claimed if its status is still  PENDING . Whoever taps first locks the record atomically. If someone taps a fraction of a second later, the database simply rejects it, and the app lets them know the order was already claimed.
  1. Price Lock (No Doorstep Haggling): The moment our pricing logic calculates the valuation (e.g., ₹350), that number is frozen directly into DynamoDB alongside the order ID. When the collector reaches the doorstep, the agreed rate is right on their screen—eliminating awkward offline bargaining.
  1. Single-Digit Millisecond Speed: Without the baggage of complex SQL joins or slow relational database connections, reading and updating order states finishes in single-digit milliseconds.
  1. Scale to Zero, Pay Zero: We set DynamoDB to On-Demand Capacity mode. We only pay when an actual request hits the table. When the app is idle, our database running cost is literally ₹0.

Challenges & Lessons: Moving from Theory to the Real World

The Weight Guessing Delusion- We initially hoped AI could predict weight straight from a photo. But 2D images have zero depth perception—a tiny medicine box up close looks identical to a 15 kg carton far away. Wild price guesses would have killed user trust immediately. We ditched the gimmick for practical transparency. Rekognition identifies the scrap material, while the user provides a quick rough estimate ( ~5 kg ). This kept payouts fast, predictable, and honest.
The 5MB Camera Upload Choke- Modern smartphone photos easily hit 5MB+. Pushing heavy raw image files through standard API endpoints choked slower mobile connections, causing painful lag and timeouts. We bypassed the backend completely. The client fetches an Amazon S3 presigned URL and uploads the image directly to S3. This slashed upload times by over 60% and kept our Lambda pipeline blazing fast.
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