AWS Builder Center

Kachra, but make it smart: building CleanLoop on AWS for Environmental Hacks 2026

How I built CleanLoop, a four-role waste app for a Delhi ward, using Claude on Amazon Bedrock, DynamoDB Streams, EventBridge Scheduler and Amazon Location to sort, collect, report, predict and recycle household waste.



design


Dilli's daily exam: wet or dry? 🤔

Every morning, millions of Delhiites stand over two bins holding a chips packet, and they guess.
Meanwhile:
  • 🗑️ The bin at the end of Lane 4 has been overflowing since Tuesday. Someone complained. Into the void.
  • 🚛 The garbage truck "aayega, kabhi na kabhi" (it'll come, eventually).
  • ⛽ That truck drives the same route every day, full lanes or empty, burning diesel either way.
  • ♻️ A kabadiwala 800 m away would pay for your old laptop. You've never heard of him.
Four problems. Four separate apps or helplines, none of them talking to each other.
So we didn't build a fifth app. We built the loop.

Meet CleanLoop 🔁

The loop: Sort → Collect → Report → Predict → Recycle

One app, four roles, everyone finally on the same page:
Who
What they get
🏠 Resident
Snap any item and get the right bin in English or Hindi · live truck ETA · report overflowing bins · request recycler pickups
🚛 Driver
Today's route + two giant buttons: Done and Skip
🧑‍💼 Ward officer
Severity-ranked reports · tomorrow's overflow forecast · km/diesel/CO₂ saved
♻️ Recycler
"Matched to you · 800 m away" → Accept → 💰

The stack: 14 AWS services walk into a ward 🏗️

Architecture diagram

Amplify · Cognito · API Gateway · Lambda · Bedrock · Rekognition · DynamoDB + Streams · S3 · SNS · SES · EventBridge Scheduler · Amazon Location · CloudWatch · SAM
One SAM template. One  npm run deploy . Everything runs in Mumbai (ap-south-1), the closest region to Delhi.

Three things we're proud of

1. Claude is not allowed to guess

The photo goes from the browser straight to S3 (presigned POST, so our Lambda never touches the file). Then Claude on Amazon Bedrock classifies it.
The catch: Claude can't reply in free text. It has to answer through a tool,  record_sort , with a fixed schema, and Zod checks every answer. If Claude isn't confident, the app says "retake karo" (take it again) instead of guessing. A confidently wrong bin teaches people the wrong habit.
Browser → S3 → Lambda → Claude on Bedrock → record_sort → Zod


2. The driver taps once, the whole lane knows

The driver's tap does exactly one thing: mark the stop done. A DynamoDB Stream notices and fires a second Lambda, which recalculates ETAs and pings SNS, with one filter policy per lane. So Lane 4 gets "Truck 2 stops away 🚛" and nobody else gets spammed.
Bonus edge case: trucks can't arrive in the past. An overdue schedule shows Running late instead of "arriving 20 min ago" 💀.
Collect flow: Driver tap → DynamoDB → Stream → Lambda → SNS → residents


3. We predict tomorrow's overflow tonight 🔮

Every night at 22:00 IST, EventBridge Scheduler scores every lane from 0 to 100:
📋 Past reports, same weekday
📅 Days since pickup
⏭️ Missed stops
🌧️ Rain forecast
🛍️ Market/festival
30%
25%
20%
15%
10%
(Rain is in there because wet waste gets heavy in the monsoon. Delhi knows.)
Red lanes go first. Near-empty lanes wait, but never more than a third of the route, because "smart" shouldn't mean "skipped for 3 days". Amazon Location truck routing measures both the old and new routes, so the savings comparison is fair.
Nightly flow: EventBridge Scheduler → Lambda → risk scores → Amazon Location → tomorrow's route

Demo ward: 12.4 km · 4.1 L diesel · 11.0 kg CO₂ saved versus the fixed route. These are estimates, and the app says so.

What fought back 🥊

Fallback chain: Opus 5.5 → Haiku 4.5 → Sonnet 4.6 → Rekognition + rules

Round 1: "Model not available for this account." Not every AWS account can use every Claude model. Our answer was a fallback chain: Opus 5.5 → Haiku 4.5 → Sonnet 4.6 → Rekognition + rules. Worst case, the report still reaches the officer, marked "triage unavailable". Nothing gets dropped.
Round 2: org-locked college accounts. Service control policies silently block Bedrock, Amplify and more, and no IAM permission can override them. We wrote  npm run check:aws  to find out before deploying, not after a 10-minute rollback.
Round 3: sandboxes everywhere. New SES accounts only email verified addresses, and Indian SMS needs DLT (TRAI) registration, which isn't happening in a weekend. Plan B: email alerts plus an in-app feed. It works, and nothing crashes.
Round 4: two kabadiwalas, one laptop. Two recyclers accept the same pickup at the same second. A DynamoDB conditional write settles it: first one wins, the second sees "Already taken". No fights.

Receipts 🧾

✅ 111 tests ·
✅ Playwright e2e for all 4 roles ·
✅ CI on every push ·
✅ least-privilege IAM ·
✅ runs locally with zero AWS ·
✅ Free Tier except Bedrock (a few cents per photo)

What's next 🚀

A real ward pilot · live truck GPS · WhatsApp alerts · onboarding actual kabadiwalas, with their own rates
Less kachra in the wrong bin. Fewer trucks on the wrong lane. Cleaner Dilli. 🌱


Built with ☕ and zero sleep by Team Git Happens: Sahitya Sharma. Thanks, WeMakeDevs × AWS!
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