DEV Community

Cover image for EcoChat — AI Sustainability Advisor for Earth Day 🌿
Sarvesh
Sarvesh

Posted on

EcoChat — AI Sustainability Advisor for Earth Day 🌿

DEV Weekend Challenge: Earth Day

This is a submission for Weekend Challenge: Earth Day Edition

What I Built

EcoChat is an AI-powered sustainability chatbot that gives practical,
actionable eco-friendly advice tailored to students and residents of
Coimbatore, Tamil Nadu, India.

Most sustainability apps are built for Western audiences — tips like
"drive an electric car" don't apply here. EcoChat knows about local
Coimbatore markets, Tamil Nadu government schemes, and campus life at KPRIET.

🌍 Live Demo: https://ecochat-rho.vercel.app

💻 GitHub: https://github.com/sarveshm555/EcoChat


Demo

Try it live at https://ecochat-rho.vercel.app

  1. Get a free Gemini API key at aistudio.google.com
  2. Paste it in the bar at the top
  3. Ask "How do I reduce plastic at home?"
  4. Upload a photo of any trash item or product label 📷
  5. Click "I'll commit to this!" and watch the counter go up ✅

Code

GitHub: https://github.com/sarveshm555/EcoChat

Tech Stack:

  • React + Vite — frontend
  • Google Gemini 2.5 Flash — AI responses + image analysis
  • Vercel — deployment

How I Built It

Google Gemini 2.5 Flash — used in 3 ways

1. Text chat with hyper-local context

The secret sauce is the system prompt:

"You are EcoChat, a sustainability advisor for students in Coimbatore,
Tamil Nadu. When relevant, mention local initiatives, Tamil Nadu
government schemes, and campus-specific suggestions."

This makes every response feel genuinely useful rather than generic.

2. Multimodal image analysis

Users can upload a photo of trash or a product label. Gemini identifies
whether it's recyclable, how to dispose of it properly, and mentions
local Coimbatore recycling options.

3. Dynamic Earth Day tip generator

On every page load, a separate Gemini API call generates a fresh,
surprising eco fact relevant to India — so the app always feels alive.

Key Features

  • 💬 Multi-turn AI chat with Coimbatore-specific knowledge
  • 📷 Image recognition for trash and product labels
  • ✅ Commitment tracker — "I'll commit to this!" button with live counter
  • 💡 Gemini-generated Earth Day fact on every page load
  • 📱 Fully mobile responsive

Why hyper-local?

Generic sustainability advice ignores local context. By telling Gemini
about Coimbatore specifically, the app gives tips like:

  • "Many Coimbatore markets accept cloth bags"
  • "Collect AC condensate water for plants"
  • "Use city buses for regular commutes"

This makes EcoChat genuinely useful for our community.


Prize Categories

Best Use of Google Gemini

I used Gemini 2.5 Flash for three distinct features:

  • Multi-turn text chat with a custom hyper-local system prompt
  • Multimodal image analysis of trash and product labels
  • Dynamic Earth Day tip generation on page load

What I Learned

  • Gemini's multimodal API is surprisingly easy — image analysis took less than 20 lines of code
  • Hyper-local system prompts dramatically improve response quality
  • Small UX details like the commit button transform a passive chatbot into an active accountability tool

Top comments (0)