
Bridging the Recycling Gap: Building Scrap-Setu for Environmental Hacks
Discover how we built Scrap-Setu, an AI-powered circular economy platform connecting households with scrap collectors using FastAPI, Google Gemini, and AWS during the WeMakeDevs Environmental Hacks.
The WeMakeDevs AWS "Environmental Hacks" hackathon challenged us to solve real-world problems in the waste and energy sector. Our answer to that challenge is Scrap-Setu, an AI-powered circular economy platform that bridges the gap between everyday households and local scrap collectors (kabadiwalas).
The Problem We Aim to Solve
Household scrap disposal is largely unorganized. Most residents do not understand the true market value of their recyclable waste, and without a convenient way to dispose of it, perfectly good recyclables end up in landfills. On the flip side, local scrap collectors face unpredictable routes, irregular supply, and inefficient collection processes.
Our Solution: Scrap-Setu
We built Scrap-Setu to gamify and simplify the recycling process. The platform operates as a two-sided marketplace:
- For Residents (Users): A resident can log in and upload a photo of their waste along with its estimated weight in kilograms and their location. Our FastAPI backend integrates with Google's Gemini 1.5 Flash AI to instantly analyze the image and identify the primary recyclable material—such as Plastic, Metal, Paper, or Glass. The AI also generates a creative upcycling idea for that specific item. Based on the identified material and weight, our dynamic pricing engine calculates an instant estimated monetary quote.
- For Collectors: Local collectors have their own dashboard where they can view a real-time feed of local, "Pending" pickup requests. They can accept a nearby request to claim it and, once physically collected, mark the job as "Completed".
- Tracking Impact: To keep users motivated, the user dashboard fetches real-time statistics displaying total completed pickups, total money earned, and an estimated environmental impact metric calculating kilograms of CO2 saved (modeled at 2.5kg of CO2 saved per 1kg of recycled waste).
Where AWS Fits in Our Stack
To make Scrap-Setu highly available and scalable (hosted at
scrapsetu.duckdns.org ), we leveraged Amazon Web Services:- Amazon EC2: We deployed our containerized Python FastAPI application and SQLAlchemy database models onto an EC2 instance to reliably handle backend processing and AI pipeline orchestration.
- Amazon S3 & CloudFront: Our static frontend assets—including
index.html,styles.css, and custom JavaScript components—are hosted securely and delivered with low latency using S3 and CloudFront.
The Hurdles We Jumped (And How We Survived)
Building a full-stack platform over a weekend is never smooth. We faced several significant technical blockers during development, particularly around database migrations and version control:
- Database Schema Nightmares: While prototyping with a local SQLite database (
scrap.db), we needed to expand ourScrapRequestschema to trackuser_idandweight_kgto build out the new user history features. We quickly learned that SQLAlchemy'screate_allfunction does not automatically update existing tables to add new columns. To solve this, we had to manually delete the existingscrap.dbfile from our project directory and restart the server to force a fresh schema generation.
- The Git / Vim Trap: Collaborating on code brought its own headaches. At one point, trying to push backend code failed with a
fatal: not a git repositoryerror because we had simply forgotten to rungit init. Later, when a teammate pushed all the new frontend files, pulling their changes caused a merge conflict that threw the terminal into the notorious Vim text editor. Unfamiliar with Vim commands, we got stuck in a suspended merge state. We had to rungit merge --abortto clear the error, pull the remote changes again, and correctly use theEsc,:wq, andEnterkeystrokes to finally merge the frontend and backend repositories successfully.
- Accidental Code Overwrites: While implementing the new hackathon-specific API routes (like
/api/loginand/api/users/{user_id}/stats), we accidentally replaced the entiremain.pyfile with a partial snippet. This broke our formatting, removed crucial PydanticBaseModelimports, and disabled our core AI logic. We had to carefully revert and reconstruct the file to ensure the new user tracking seamlessly integrated with the original Gemini image processing pipeline.
Through these challenges, Scrap-Setu evolved from a rough concept into a fully functioning prototype. By combining AI, transparent dynamic pricing, and reliable AWS cloud infrastructure, we are incredibly proud of our submission!
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article