Skip to content

KJ1201/GreenBuddy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

โ™ป๏ธ ReLoop โ€” Every Broken Device is a Lesson

"Every printer is a teacher. Every broken laptop is a lesson."

ReLoop is a web platform that turns e-waste into education. It guides students, hobbyists, and educators through safe, structured device teardowns โ€” extracting valuable components, verifying them with AI, and giving those parts a second life through donation, resale, or responsible recycling.

React TypeScript Supabase Vite TailwindCSS PWA


๐Ÿ“– Table of Contents


๐ŸŒ Overview

ReLoop addresses two intertwined problems:

  1. E-waste crisis โ€” $57 billion worth of electronics are discarded annually.
  2. STEM affordability gap โ€” ~40% of schools can't afford robotics and electronics equipment.

By bridging these, ReLoop creates a circular economy where discarded devices become low-cost STEM learning kits โ€” verified, safe, and ready for reuse.


๐Ÿšจ The Problem

Challenge Impact
57B+ in annual e-waste Environmental damage, resource loss
Schools lack affordable gear Students miss hands-on STEM exposure
DIY teardown tutorials are unsafe No safety gates, no verification
No structured pathway Parts get thrown away instead of harvested

ReLoop solves this with guided teardowns, AI verification, and three post-teardown outcomes: Donate โ†’ Sell โ†’ Recycle.


โœจ Key Features

๐Ÿ—บ๏ธ Component Map Preview

Before touching a single screw, users see a full breakdown of what's inside the device โ€” part values, locations, XP rewards, and educational outcomes.

๐Ÿ›ก๏ธ Safety-First Guided Teardown

  • Step-by-step teardown instructions with PPE checks
  • Hazard callouts for capacitors, batteries, and sharp components
  • Safety gates that block progression until risks are acknowledged
  • Color-coded device difficulty tiers: ๐ŸŸข Easy / ๐ŸŸก Medium / ๐Ÿ”ด Hard

๐Ÿค– AI-Powered Component Verification (Google Gemini Vision)

Upload a photo of any extracted part and Gemini 2.0 Flash Vision will:

  • Identify the component type (e.g., NEMA 17 Stepper Motor)
  • Rate the condition (Excellent / Good / Fair / Poor)
  • Return a confidence score (auto-approved โ‰ฅ 75%, manual review < 75%)
  • Flag safety concerns (damaged battery, leaking capacitor, etc.)

Cost: ~$0.00065 per verification โ€” 50ร— cheaper than GPT-4 Vision.
Free tier: 1,500 requests/day via Google AI Studio.

๐Ÿ“š Educational Context Per Component

At each extraction step, learn:

  • What is this? โ€” Component identity & explanation
  • Why is it valuable? โ€” Market price & rarity
  • Where can it be used? โ€” 3โ€“5 real-world project examples
  • How does it work? โ€” Technical breakdown with diagrams

๐ŸŽฎ Gamification

  • XP System โ€” Earn XP for each verified component
  • Badges โ€” Unlock achievements (e.g., "Motor Master", "Circuit Breaker")
  • Leaderboards โ€” Global and school-wide rankings
  • Streaks โ€” Daily activity bonuses

๐Ÿ”„ Post-Teardown Actions

After completing a full device teardown, choose your path:

Action Description
๐ŸŽ Donate Send parts to local schools / makerspaces, get a tax receipt + 2ร— XP
๐Ÿ’ฐ Sell List on the marketplace with AI-auto-populated specs and price suggestions
๐ŸŒฟ Recycle Find nearby e-waste facilities via ZIP code, get disposal instructions

๐Ÿ›’ Marketplace

  • Auto-generated listings from verified components
  • AI-suggested pricing based on condition and market data
  • Component provenance (device source, extraction date, verifier)
  • Platform commission: 25%

๐Ÿ› ๏ธ Tech Stack

Layer Technology
Frontend React 19 + TypeScript
Styling Tailwind CSS v4
Routing React Router v7
State Management Zustand
Data Fetching TanStack React Query
Animations Framer Motion
Icons Lucide React
Build Tool Vite 7
Backend Supabase (Edge Functions + PostgreSQL + Storage + Auth)
AI Vision Google Gemini 2.0 Flash Vision
Hosting Vercel (Frontend) + Supabase (Backend)
PWA vite-plugin-pwa + Workbox

๐Ÿ“ฑ Supported Devices (MVP)

Device Difficulty HVI Score Est. Value Key Learning
HP DeskJet 2700 Printer ๐ŸŸก Medium 87/100 $43 Motor control, optical sensing
Linksys WRT54G Router ๐ŸŸข Easy 72/100 $28 Networking, RF basics, power management
Xbox 360 (broken) ๐Ÿ”ด Hard 95/100 $67 Thermal management, gaming hardware
Dell Inspiron Laptop ๐Ÿ”ด Hard 91/100 $89 Display tech, battery safety, modular computing

๐Ÿš€ User Journey

Landing โ†’ Search Device โ†’ Component Map Preview
         โ†“
  Start Teardown โ†’ Safety Gate (PPE + Power-off)
         โ†“
  Guided Steps โ†’ Photo Upload โ†’ AI Verification
         โ†“
  XP Awarded โ†’ Next Component or Device Complete
         โ†“
  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚Donateโ”‚ Sell โ”‚Recycleโ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“ Project Structure

reloop/
โ”œโ”€โ”€ public/                  # Static assets (icons, favicons)
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/          # Reusable UI components
โ”‚   โ”œโ”€โ”€ lib/                 # Supabase client, utilities, AI helpers
โ”‚   โ”œโ”€โ”€ pages/               # Route-level page components
โ”‚   โ”‚   โ”œโ”€โ”€ LandingPage.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ DeviceCatalogPage.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ DeviceDetailPage.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ TeardownRunnerPage.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ TeardownCompletePage.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ MarketplacePage.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ LeaderboardPage.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ ProfilePage.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ DonatePage.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ RecyclePage.tsx
โ”‚   โ”‚   โ””โ”€โ”€ auth/
โ”‚   โ”œโ”€โ”€ types/               # TypeScript type definitions
โ”‚   โ”œโ”€โ”€ App.tsx              # Root component & routing
โ”‚   โ”œโ”€โ”€ main.tsx             # App entry point
โ”‚   โ””โ”€โ”€ index.css            # Global styles
โ”œโ”€โ”€ supabase/                # Edge Functions & DB migrations
โ”œโ”€โ”€ .env                     # Environment variables (not committed)
โ”œโ”€โ”€ vite.config.ts           # Vite configuration (incl. PWA)
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ README.md

๐Ÿ Getting Started

Prerequisites

  • Node.js v18+
  • npm v9+
  • A Supabase account and project
  • A Google AI Studio API key (for Gemini Vision)

Installation

# 1. Clone the repository
git clone https://github.com/<your-username>/reloop-anti.git
cd reloop-anti

# 2. Install dependencies
npm install

# 3. Set up environment variables (see section below)
cp .env.example .env

# 4. Start the development server
npm run dev

The app will be available at http://localhost:5173.


๐Ÿ” Environment Variables

Create a .env file in the root directory with the following variables:

VITE_SUPABASE_URL=https://<your-project-ref>.supabase.co
VITE_SUPABASE_ANON_KEY=<your-supabase-anon-key>
VITE_GEMINI_API_KEY=<your-google-gemini-api-key>
Variable Description
VITE_SUPABASE_URL Your Supabase project API URL
VITE_SUPABASE_ANON_KEY Supabase project public anon key
VITE_GEMINI_API_KEY Google AI Studio key for Gemini Vision

โš ๏ธ Never commit your .env file. It is already included in .gitignore.


๐Ÿšข Deployment

See DEPLOYMENT.md for the full step-by-step guide.

Quick Summary:

  1. Push to GitHub โ€” create a repo and push your code
  2. Deploy Frontend on Vercel โ€” import repo, add env vars, deploy
  3. Deploy Edge Functions on Supabase:
    npx supabase functions deploy --project-ref <your-project-ref>

๐Ÿ“Š Key Metrics to Track

  • Tutorial completion rate
  • AI verification pass rate (target: โ‰ฅ 75% confidence)
  • Components verified per user/week
  • Marketplace listings created
  • Donate vs. Sell vs. Recycle distribution
  • Google Gemini API cost per active user (~$0.00065/verification)

๐Ÿ›ก๏ธ Safety & Privacy

  • Safety Gates enforce PPE acknowledgment before risky steps
  • RED tier devices (Xbox, Laptop) require extra safety confirmations
  • Minimal PII collected; parent/teacher approval path for minors
  • HTTPS everywhere; role-based access control via Supabase Auth
  • AI-detected safety flags for hazardous components (e.g., swollen batteries)

๐Ÿ—บ๏ธ Roadmap

Phase Timeline Goals
MVP (Hackathon) โœ… Now 4 devices, AI verification, Donate/Sell/Recycle, Gamification
Pilot (Phase 2) +1 month 10 more devices, teacher dashboard, refined AI prompts
Public Beta (Phase 3) +3 months 50+ devices, payment integration, community-contributed guides

๐Ÿค Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Commit your changes (git commit -m 'feat: add my feature')
  4. Push to the branch (git push origin feature/my-feature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is private and intended for hackathon demonstration purposes.


Built with โค๏ธ to close the loop on e-waste and open doors to STEM education.
ReLoop โ€” Dismantle. Learn. Reuse.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors