Fetching latest headlinesโ€ฆ
EcoLens ๐ŸŒ โ€” Scan Any Object, Discover Its Carbon Impact (Built for Haiti & Resource-Limited Environments)
NORTH AMERICA
๐Ÿ‡บ๐Ÿ‡ธ United Statesโ€ขApril 20, 2026

EcoLens ๐ŸŒ โ€” Scan Any Object, Discover Its Carbon Impact (Built for Haiti & Resource-Limited Environments)

0 views0 likes0 comments
Originally published byDev.to

What I Built

EcoLens is a web app that lets you photograph any object โ€” a meal, a product, a vehicle, an electronic device โ€” and instantly discover its carbon footprint, with eco-friendly alternatives and advice adapted to your real local context.

What makes EcoLens unique: it's built specifically for resource-limited environments like Haiti, where most "green" apps suggest solutions that simply don't exist locally (electric cars, composting services, organic supermarkets...). EcoLens gives realistic, actionable advice for where you actually live.

Demo

The Problem I'm Solving

Most carbon footprint tools are built for Western contexts. They suggest:

  • "Buy an electric vehicle" โŒ not available in Haiti
  • "Use your composting service" โŒ doesn't exist
  • "Shop at the organic supermarket" โŒ not accessible

EcoLens gives advice that actually works where you live.

How It Works

  1. ๐Ÿ“ธ User uploads a photo of any object
  2. โš™๏ธ React frontend sends it to the ASP.NET Core backend
  3. ๐Ÿค– Backend calls Google AI models via OpenRouter API
  4. ๐Ÿ“Š AI identifies the object and calculates its environmental impact
  5. โœ… Results displayed with carbon score, CO2 estimate, eco alternatives, and local context tips

Special Feature: Haitian Dish Recognition

EcoLens recognizes Haitian dishes by name and gives culturally relevant advice:

  • ๐Ÿš Diri djon djon (black mushroom rice)
  • ๐Ÿฅฉ Griot (Haitian fried pork)
  • ๐ŸŽƒ Soup joumou (pumpkin soup)
  • ๐ŸŒ Bannann peze (twice-fried plantain)
  • ๐ŸŒฝ Maรฏs moulu ak legim (ground corn with vegetables)

Tech Stack

Layer Technology
Frontend React 19 + Vite + Axios
Backend ASP.NET Core 9 (C#)
AI Google Gemma via OpenRouter API
Dev Assistant GitHub Copilot

Why OpenRouter instead of Gemini API directly?

The Google Gemini API has geographic restrictions that block free tier access from Haiti and many Global South countries. I solved this by routing through OpenRouter, which provides access to Google's Gemma models without geographic restrictions โ€” keeping Google AI at the core while making it accessible from anywhere in the world.

The system uses automatic fallback across 5 models for maximum reliability:

  1. google/gemma-3-27b-it:free
  2. google/gemma-3-12b-it:free
  3. google/gemma-4-31b-it:free
  4. nvidia/nemotron-nano-12b-v2-vl:free
  5. google/gemma-3-4b-it:free

AI-Assisted Development with GitHub Copilot

GitHub Copilot was used throughout the development of EcoLens to:

  • Generate ASP.NET Core boilerplate and controller structure
  • Debug the OpenRouter API integrations
  • Suggest improvements to the JSON parsing logic
  • Speed up React component development

Challenges I Ran Into

1. Google Gemini API geographic restrictions
The biggest challenge was discovering that Gemini's free tier is blocked from Haiti. The solution was OpenRouter with Google Gemma models.

2. Free models deprecated without warning
Built an automatic fallback system that tries 5 different models in sequence so the app never goes down.

3. Getting consistent JSON from AI
Gemma sometimes returns text before or after the JSON. Fixed with a robust extraction that finds the first { and last } in the response.

What I Learned

  • How to integrate multimodal AI APIs (image + text) in ASP.NET Core
  • The reality of geographic API restrictions affecting developers in the Global South
  • How to build a reliable fallback system across multiple free AI models
  • The importance of building for your actual local context

What's Next

  • [ ] Mobile-optimized camera capture
  • [ ] History of past analyses per user
  • [ ] Offline mode for low-connectivity environments
  • [ ] Support for more Caribbean and African contexts

Source Code

๐Ÿ”— GitHub Repository

Built with โค๏ธ from Haiti for the DEV Weekend Challenge โ€” Earth Day 2026 ๐ŸŒฑ
Powered by OpenRouter + Google Gemma AI + GitHub Copilot

Comments (0)

Sign in to join the discussion

Be the first to comment!