Won "π± Best AI for Environmental Impact" in AGI Ventures Canada's Hackathon 3.0
EcoCart is an innovative browser extension that helps users make environmentally conscious shopping decisions by analyzing products and suggesting sustainable alternatives. Built with AI-powered environmental impact assessment, EcoCart transforms your shopping experience into a force for positive environmental change.
- EcoScore Rating: AI-powered environmental impact scoring from 1.0 (worst) to 5.0 (best)
- Real-time Product Assessment: Instant analysis of products on Amazon and other supported sites
- AI-Powered Search: Find environmentally friendlier alternatives using advanced web search
- Amazon Integration: Seamless integration with Amazon's global marketplaces
- Price Comparison: Compare prices alongside environmental impact
- Image Preview: Visual product previews with automatic image extraction
- Python 3.8+
- Node.js (for frontend development)
- OpenAI API key
-
Clone the repository
git clone https://github.com/VanBaNguyen/EcoCart.git cd EcoCart/backend -
Install dependencies
pip install -r requirements.txt
-
Environment Configuration Create a
.envfile in the backend directory:OPENAI_API_KEY=your_openai_api_key_here OPENAI_MODEL=gpt-4o-mini PORT=5057
-
Start the backend server
python app.py
The API will be available at
http://localhost:5057
-
Navigate to frontend directory
cd ../frontend -
Load the extension
- Firefox: Open
about:debugging, click "This Firefox", then "Load Temporary Add-on" and selectmanifest.json
- Firefox: Open
-
Configure permissions The extension will request permissions for:
- Active tab access (to read current page)
- Local storage (for cart persistence)
- Backend API access (for environmental analysis)
- Navigate to Amazon: Visit any Amazon product page
- Open EcoCart: Click the EcoCart extension icon
- View EcoScore: See the environmental impact rating (1.0-5.0)
- Find Alternatives: If score < 3.0, click "Find Eco Alternatives"
- Browse Options: Swipe through sustainable alternatives
- Build Cart: Add preferred items to your eco-friendly cart
- Shop Responsibly: Make informed environmental choices
- π’ 4.0-5.0: Highly sustainable (durable materials, long lifespan, minimal waste)
- π‘ 3.0-3.9: Mixed/unknown materials, partial recyclability, average footprint
- π΄ 1.0-2.9: Predominantly single-use plastic, limited recyclability, short lifespan
Health check endpoint for backend connectivity.
Find environmentally friendly alternatives for products or topics.
{
"query": "sustainable water bottles",
"product": {
"name": "Product Name",
"link": "https://amazon.com/product-url"
},
"limit": 5,
"model": "gpt-4o-mini"
}Assess environmental impact of a specific product.
{
"product": {
"name": "Product Name",
"link": "https://amazon.com/product-url"
},
"model": "gpt-4o-mini"
}Proxy service for product images to avoid CORS issues.
GET /image-proxy?url=https://example.com/image.jpg
cd backend
python test_judge_paper_straw_low.py
python test_search.py- Test on various Amazon product pages
- Verify cart persistence across browser sessions
- Check image loading and proxy functionality
EcoCart promotes sustainable shopping by:
- Reducing Plastic Waste: Encouraging reusable and biodegradable alternatives
- Supporting Sustainable Brands: Highlighting companies with environmental certifications
- Educating Consumers: Providing transparent environmental impact information
- Promoting Circular Economy: Favoring products with longer lifespans and recyclability
EcoCart/
βββ backend/
β βββ app.py # Flask API server
β βββ requirements.txt # Python dependencies
β βββ test_*.py # Backend tests
βββ frontend/
β βββ manifest.json # Browser extension manifest
β βββ popup.html # Extension popup interface
β βββ popup.css # Styling and animations
β βββ popup.js # Extension logic and API integration
β βββ scraping/ # Web scraping utilities
βββ README.md # This file
- Backend: Flask, OpenAI API, BeautifulSoup, Requests
- Frontend: Vanilla JavaScript, HTML5, CSS3
- AI Models: GPT-5 for environmental analysis
- Storage: Browser extension local storage API
Target Achievement: "π± Best AI for Environmental Impact"
EcoCart demonstrates how AI can be harnessed to create meaningful environmental change by:
- Making sustainability accessible to everyday consumers
- Leveraging AI for real-time environmental impact assessment
- Creating an engaging, educational shopping experience
- Promoting conscious consumption and waste reduction
Built with β€οΈ for a sustainable future
EcoCart - Where every purchase is a vote for the planet π