EcoLens 🌍 — Scan Any Object, Discover Its Carbon Impact (Built for Haiti & Resource-Limited Environments)

Published: (April 19, 2026 at 10:52 PM EDT)
4 min read
Source: Dev.to

Source: Dev.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

(Demo link or embed can be added here if available.)

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 the OpenRouter API.
  4. 📊 AI identifies the object and calculates its environmental impact.
  5. ✅ Results displayed with carbon score, CO₂ 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

LayerTechnology
FrontendReact 19 + Vite + Axios
BackendASP.NET Core 9 (C#)
AIGoogle Gemma via OpenRouter API
Dev AssistantGitHub Copilot

Why OpenRouter Instead of the Gemini API Directly?

The Google Gemini API has geographic restrictions that block free‑tier access from Haiti and many Global South countries. Routing through OpenRouter provides access to Google’s Gemma models without those restrictions, keeping Google AI at the core while making it accessible worldwide.

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

  • google/gemma-3-27b-it:free
  • google/gemma-3-12b-it:free
  • google/gemma-4-31b-it:free
  • nvidia/nemotron-nano-12b-v2-vl:free
  • 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 five 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 the 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

0 views
Back to Blog

Related posts

Read more »