"One industry's waste is another's raw material."
ScrapSwap is a circular economy marketplace designed to bridge the gap between waste producers (suppliers) and sustainable creators. By transforming industrial and consumer waste into valuable resources, we help divert materials from landfills and reduce carbon footprints through data-driven impact tracking and AI-powered material analysis.
- Waste-to-Resource Catalog: A marketplace for browsing and listing various waste materials (textiles, wood, plastics, organics, etc.).
- AI Vision Scanner: Upload images of waste to automatically identify materials and receive upcycling suggestions powered by GPT-4o.
- Impact Dashboard: Real-time tracking of environmental metrics, including total weight diverted and CO₂ equivalent savings.
- Matching Engine: Intelligent suggestions connecting suppliers with creators based on material categories and location.
- DIY Recipe Library: A community-driven repository of step-by-step instructions for repurposing specific waste streams.
- Framework: Next.js 15 (App Router)
- Styling: Tailwind CSS
- Language: TypeScript
- Icons/Components: Custom UI system with Framer Motion animations.
- Framework: Express.js
- Language: TypeScript
- Database: Supabase (PostgreSQL)
- AI: OpenAI GPT-4o (Vision API)
- Deployment: Vercel (Backend via Vercel Functions)
ScrapSwap/
├── backend/ # Express API with Supabase integration
│ ├── src/
│ │ ├── controllers/# Route handlers
│ │ ├── services/ # Business logic (AI, Impact calculations)
│ │ └── routes/ # API Endpoints
│ └── supabase/ # SQL Schema and migrations
└── frontend/ # Next.js Web Application
├── src/
│ ├── app/ # Pages and layouts
│ ├── components/ # Reusable React components
│ └── lib/ # API clients and utility functions
- Node.js 18+
- A Supabase account and project
- An OpenAI API Key (for the Scan feature)
-
Clone the repository:
git clone https://github.com/your-username/scrapswap.git cd scrapswap -
Set up the Backend:
cd backend npm install # Create a .env file based on .env.example # Add your SUPABASE_URL, SUPABASE_ANON_KEY, and OPENAI_API_KEY npm run dev
-
Set up the Frontend:
cd ../frontend npm install # Create a .env.local file # NEXT_PUBLIC_API_URL=http://localhost:5000 npm run dev
The system uses a relational PostgreSQL schema managed via Supabase. Key tables include:
- Profiles: Extended user data (Suppliers/Creators).
- Listings: Waste materials available for exchange.
- Categories: Material types with associated environmental impact factors.
- Recipes: Instructions for upcycling projects.
- Impact Reports: Records of diverted waste for sustainability auditing.
- Scans: History of AI-powered material classifications.
See backend/supabase/schema.sql for the full SQL definition.
| Endpoint | Method | Description |
|---|---|---|
/api/listings |
GET |
Fetch all active waste listings |
/api/listings |
POST |
Create a new listing |
/api/ai/analyze |
POST |
Classify waste material from image |
/api/recipes |
GET |
Browse upcycling instructions |
/api/impact/report |
POST |
Log a successful waste diversion |
Our engine calculates savings using category-specific factors:
- Methane Reduction: Targeted primarily at organic waste diversion.
- CO₂ Equivalent: Based on the lifecycle emissions avoided by using recycled materials instead of virgin ones.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.