This is a submission for Weekend Challenge: Earth Day Edition
What I Built
We've all been there: a household item breaks, and it's usually easier to just toss it in the trash than figure out how to fix it. I built Repair Oracle to change that.
It’s an AI-powered diagnostic web app designed to keep broken items out of the landfill. You just upload a photo and describe what’s wrong. The app analyzes the damage and generates a structured field guide with one of four actionable paths: Repair it, Salvage for parts, Recycle responsibly, or Replace thoughtfully.
To hit the Earth Day theme, every diagnosis includes a running environmental ledger. It estimates the kilograms of CO₂e avoided (versus buying new) and the mass of material diverted from the landfill. It also calls out specific safety hazards (like lithium batteries) and tells you exactly which material stream to use for recycling.
Demo
-
Video Walkthrough: [https://youtu.be/yPyhUS4Dd4g]
(Want to run it locally? Clone the repo, add your
GOOGLE_GENERATIVE_AI_API_KEYto.env.local, and runnpm run devonlocalhost:3000.)
Code
mason-cao
/
repair-oracle
An AI repair assistant that helps users identify faults, assess repairability, and avoid unnecessary waste. Built for DEV Weekend Challenge: Earth Day Edition.
Repair Oracle
Before you throw it away, ask the Oracle.
Repair Oracle is an AI-powered repair diagnosis web app for broken household items. Upload a photo, describe the failure, and receive a structured field guide: repair it, salvage it, recycle it, or replace it only as a last resort Each verdict includes repair steps, parts, tools, safety flags, cost vs replacement, CO2e avoided, and landfill material diverted.
Built for an Earth Day 2026 hackathon.
Earth Day Criteria
- Repair-first impact: The model is instructed to prefer repair when it is safe, affordable, and realistic.
- Waste diversion: Every result estimates CO2e avoided and material kept out of landfill.
- Responsible fallback: Salvage and recycling routes name material streams such as e-waste, battery, textile, metal, wood, glass, ceramic, or plastic.
- Safety-aware guidance: Hazardous work such as mains wiring, gas pressurized systems, or lithium cell repair is flagged as pro-only.
- Low-friction behavior change: No account…
How I Built It
I wanted a fast, reliable diagnostic tool—not a generic chatbot. Here’s how I pulled it off:
-
The Core Stack: Next.js 16 (App Router), React 19, and the new Tailwind CSS 4. I used
framer-motionandlucide-reactfor a clean "glassmorphism" UI that keeps the repair steps easy to read. -
The Brains: I used the Vercel AI SDK (
@ai-sdk/google) to hook up Gemini 2.5 Flash. The user’s image and text are passed directly to the multimodal vision model. -
Taming the AI with Zod: Instead of freeform text, I used
generateObjectalongside a strict Zod schema (DiagnosisSchema). This forces Gemini to output a highly structured JSON object, guaranteeing a definitive verdict, 3-7 step repair instructions, cost estimates, and the Earth Day math every single time. - Prompt Engineering: The system prompt strictly forces the AI to recommend "repair" only when it's safe and economical. It also forces the model to name specific recycling streams and flag dangerous DIY work (like mains wiring) as "pro-only."
-
Low-Friction Ledger: There’s no login or database. All diagnosis history and running carbon/landfill totals are saved locally on your device via
localStorage.
Prize Categories
Best Use of Google Gemini Repair Oracle's entire core loop relies on Gemini 2.5 Flash. It uses multimodal vision to assess the physical damage of real-world items (even dropping its confidence score if the photo is blurry). By combining this vision with strict JSON generation, Gemini transforms a basic upload form into a reliable, safety-aware sustainability tool.
Thanks for checking out the project! Let me know if you end up using it to fix something around the house. Happy Earth Day! 🌍
Made solo by me: m_caoo
Top comments (0)