DEV Community

Sree Praveen Challa
Sree Praveen Challa

Posted on

EcoScanAI 🌍♻️: Scaling Sustainability with AI Vision

DEV Weekend Challenge: Earth Day

This is a submission for Weekend Challenge: Earth Day Edition

What I Built

EcoScanAI is an intelligent waste-management companion that turns a single photo into an actionable "Impact Report." By identifying materials and providing instant disposal guidance (Recycle, Compost, Landfill), it helps users build better daily habits to reduce their carbon footprint.

The goal was to bridge the "Analysis Gap" in sustainability—where people want to recycle but are confused by complex packaging—by providing structured intelligence in under a second.

Demo

Live App Link
App UI: Main scanning interface.

Health Check: https://ecoscan-ai-sha-c2ba78b.onrender.com/health

Code

I have open-sourced the entire engine here. Check out the architecture and the Gemini integration:

GitHub logo praveenarjun / EcoScanAI

This is a submission for Weekend Challenge: Earth Day Edition

EcoScanAI

EcoScanAI is an AI-powered image scanning app that analyzes an uploaded image and returns a structured JSON response (e.g., classification/insights) using a Vision-capable AI provider.
It includes rate limiting, security headers, hash-based caching, and strict JSON validation to keep results consistent and production-friendly.

Built for a competition / hackathon project — add your competition name and details in the section below.


Highlights

  • Upload an image and get back normalized JSON results
  • Go (Gin) API with a clean request flow
  • SHA-256 image hashing for cache keys
  • In-memory TTL cache to reduce cost and latency
  • Provider selector (Gemini Vision + optional Azure OpenAI Vision)
  • Strict schema validation for reliable output
  • Basic production middleware: rate limiter + security headers

Tech Stack

  • Backend: Go + Gin
  • AI Providers: Gemini Vision (primary), Azure OpenAI Vision (optional)
  • Caching: In-memory TTL cache (keyed by image hash)
  • Security: Security headers middleware
  • Reliability: Strict JSON…

How I Built It

I approached EcoScanAI using the same "High-Performance" principles I use for my backend microservices

2. The "Smart Post Office" Architecture
To keep the system reliable and cost-effective, I implemented three key features:

Resilient AI Fallback (Azure AI Factory): The system is "AI-agnostic." While it defaults to Google Gemini 2.0 Flash for speed, I integrated Azure OpenAI as a heavy-duty fallback. If Gemini is unavailable, the system automatically routes the request to the GPT-4o model via Azure, ensuring the "Professor" is always available to analyze complex waste materials without downtime.

Deduplication & Caching: I used an in-memory cache with TTL to store results by image hash. If ten people scan the same plastic bottle, the AI only works once, saving 90% on API costs.

Rate Limiting & Security: To protect against "alert storms" or spam, I integrated custom middleware for rate-limiting and security headers.

Modern DevOpsI maintained a professional ship-speed by implementing GitHub Actions for CI/CD. Every push triggers automated formatting checks (gofmt), unit tests, and builds a Docker image published to GHCR for seamless deployment

Prize Categories

Best Use of Google Gemini: Utilized Gemini 2.0 Flash as the primary vision engine to extract structured JSON (material, disposal, carbon_save) from raw images.

Best Use of Azure AI Factory (GPT-4o): Leveraged Azure OpenAI Service to deploy GPT-4o, providing a high-intelligence fallback layer that maintains 99.9% availability for the EcoScanAI engine.

Best Use of GitHub Copilot: Used Copilot to accelerate the development of the Go-Gin boilerplate and the vanilla JS "Impact Score" rendering.

Let’s Build a Greener Future!
EcoScanAI is more than just a scanner; it’s a tool to turn a "graveyard of waste" into a live conversation about our planet. If you're interested in contributing to the AI prompts or expanding the "Impact Stories," check out the repo!

Author: Sree Praveen Challa
Teammates: (Solo submission)

Top comments (0)