This is a submission for Weekend Challenge: Earth Day Edition
What I Built
What if every daily decision showed its carbon cost before you made it?
Built for the DEV Earth Day Challenge, EcoOS Intelligence is a real-time, AI-powered system that transforms sustainability from abstract awareness into clear, measurable action.
Instead of static calculators, EcoOS acts as a behavioral operating system for climate actionβhelping users understand, simulate, and improve their impact across everyday life.
β‘ What Makes This Different?
Most climate tools tell you what happened.
EcoOS shows you what will happen before you act.
- π§ AI reasoning engine β breaks down lifestyle into real COβ impact
- π― What-if simulator β test decisions before committing
- π¬ Personal AI coach β adapts to your behavior over time
- β»οΈ Image-based waste analysis β classify real-world waste instantly
- π Gamified system β turns sustainability into daily action
π This is not a tracker. It's a decision-making system.
π§© The Problem
People care about sustainabilityβbut don't act consistently.
Why?
- Data is complex and hard to interpret
- Tools are passive (no feedback loop)
- Advice is generic and not personalized
- Impact is invisible in daily decisions
π The gap isn't awarenessβit's actionability.
π‘ The Solution: EcoOS Intelligence
EcoOS is a modular ecosystem focused on turning intention into action across the most impactful areas of personal sustainability:
π± Carbon Mirror β The Intelligence Engine
Describe your lifestyle in plain English. Gemini performs multi-step reasoning:
- Decomposition β Parse activities into discrete categories
- Category Scoring β Estimate COβ using established emission factors
- Synthesis β Compute confidence-weighted totals
- Recommendations β Generate prioritized, quantified action plans
- JSON Schema Validation β 6 custom validators ensure structured, type-safe responses
- Multi-Platform Sharing β Share results to X/Twitter, Facebook, LinkedIn, or copy for Instagram & TikTok
π― What-If Simulator β The "Wow" Feature
Ask "What if I stop using Uber for a month?" and get:
- Timeline projections (1 month, 6 months, 1 year)
- Money saved alongside COβ saved
- Tangible equivalences (trees, flights, driving distance)
- Community scale β "If 10,000 people did this..."
π¬ Carbon Coach β Your AI Advisor
A conversational AI that remembers your history:
- Knows your eco-score, past analyses, completed quests
- Gives realistic, specific advice β not generic platitudes
- Persists conversations across sessions
- Adjusts your eco-score based on engagement
π Eco-Quest β The Behavior Engine
AI-generated daily challenges that adapt to what you've already done:
- Never repeats previously completed quests
- Every mission includes quantified impact metrics
- Points system feeds into your overall sustainability grade
β»οΈ WasteWise Vision (The "WOW" Multi-Modal Feature)
Image-based waste classification powered by Gemini 2.0 Flash's visual reasoning.
- Upload or drag-and-drop a photo of your waste.
- Gemini visually decomposes the materials, checks for contamination, and provides the exact disposal category.
π EcoRoute
Transport optimization comparing 9 modes (Car, EV, Motorcycle, Bus, Train, Bike, Walk, Plane, Boat) with annual projections and community scale impact.
Demo
- Live Demo: EcoOS.vercel.app
πΈ Visual Walkthrough
| Feature | Screenshot |
|---|---|
| π± Carbon Mirror β AI analyzes your lifestyle | ![]() |
| π― What-If Simulator β See impact before you act | ![]() |
| β»οΈ WasteWise β Image-based classification | ![]() |
| π EcoRoute β 9-mode transport comparison | ![]() |
| π¬ Carbon Coach β Personalized AI advisor | ![]() |
| π Dashboard β Your sustainability command center | ![]() |
π₯ Quick Demo Flow (2 minutes)
- Carbon Mirror β Describe your lifestyle β watch real-time breakdown
- What-If Simulator β "What if I stop using Uber for a month?" β see yearly impact
- Carbon Coach β Ask anything β get personalized advice
- WasteWise β Upload an image β get disposal guidance
- Dashboard β See your eco-score evolve
π Full flow takes under 2 minutes.
Code
How I Built It
π§ Best Use of Google Gemini: Built for Reliability
For a tool like EcoOS, speed and reliability are everything. We built a production-grade AI reasoning engine with multi-layered resilience β not just a chat wrapper.
1. Structured JSON Mode
Every response uses responseMimeType: "application/json" for 100% reliable UI rendering:
{
"estimate": 245,
"confidence": "medium",
"breakdown": [
{ "category": "Transport", "value": 120, "detail": "Daily 20km commute" },
{ "category": "Food", "value": 75, "detail": "Occasional meat consumption" }
],
"suggestions": [
"Switch to public transit 3 days/week β saves ~48kg CO2/month",
"Adopt plant-based meals on weekdays β saves ~35kg CO2/month"
]
}
2. Multi-Step Reasoning (Chain-of-Thought)
Every prompt follows a structured pipeline, not a simple "input β output":
STEP 1 β DECOMPOSITION: Parse input into categories
STEP 2 β SCORING: Estimate using emission factors
STEP 3 β SYNTHESIS: Confidence-weighted totals
STEP 4 β RECOMMENDATIONS: Prioritized by impact
3. Response Validation & Reliability
- 6 custom validators ensure every response has correct structure
- Numeric sanitization prevents NaN/undefined from reaching the UI
- Retry with exponential backoff before graceful mock fallback
- 12-second timeout prevents UI hangs on slow networks
4. Personalization Engine
The system adapts over time:
- Stores carbon history, waste scans, quest completions, coach topics
- Injects user context into every AI prompt
- Quest generator explicitly avoids repeating past challenges
- Coach references your previous analyses in conversation
5. Model Cascade with Automatic Failover
Production resilience through tiered fallback when quotas are hit:
Gemini 2.5-flash (primary) β Gemini 2.0-flash (fallback) β Intelligent Mock (offline)
6. Request Optimization
Performance optimizations for scale and cost-efficiency:
- In-memory caching: 5-minute TTL eliminates redundant API calls for identical inputs
- Token usage logging: Cost monitoring for every API call
7. Circuit Breaker Pattern
Quota protection prevents cascade failures:
- Automatic detection of rate limit (429) errors
- 5-minute cooldown after 2+ quota errors
- Graceful degradation to intelligent mock responses without user interruption
8. Mock Fallback System
Even without an API key, the entire app remains functional with intelligent mock data that matches the exact JSON schema β perfect for offline demos and development.
π§ͺ Built for Real-World Constraints
EcoOS is designed to work even under API limits:
- Works without an API key (intelligent fallback system)
- Handles rate limits gracefully (circuit breaker)
- Prevents UI failures with strict JSON validation
- Optimized for low-cost, high-efficiency AI usage
π This ensures reliability in real-world conditionsβnot just ideal demos.
π§ͺ Testing & Quality Assurance
- 10 test files with 51+ tests covering validators, sanitization, and UI components
- Response validation tests ensure Gemini JSON schema compliance
- Mock fallback tests verify 100% offline functionality
- Vitest + React Testing Library for fast, reliable test execution
π¨ Design Strategy: Premium Sustainability
We avoided the "clinical" look of traditional carbon tools. Instead, we built a high-end, dark-mode experience:
- Animated SVG Ring Score β real-time eco-grade with glow effects
- Glassmorphism β translucent cards with backdrop blur
- Framer Motion β spring animations, staggered reveals, page transitions
- Custom Slider β gradient thumb with glow shadow
- Micro-Interactions β points popup, toast notifications, pulsing badges
- Outfit + Inter fonts β modern, premium typography
π₯ Demo Flow
- Dashboard β See the animated ring score and live community feed
- Carbon Mirror β Describe your lifestyle β Watch the breakdown animate
- What-If β Try "What if I go vegetarian?" β See yearly projections
- Coach β Notice it says "I already know your history" β Get personalized advice
- Dashboard β Your eco-score has increased β¨
π Impact
| Metric | Per User | At Scale (10K users) |
|---|---|---|
| COβ Awareness | Instant footprint visibility | 245,000 kg COβ analyzed/month |
| Behavior Change | Personalized action plans | 10,000+ daily eco-quests |
| Decision Support | What-if before you commit | Collective behavior shift |
π Future Vision
- City-level integrations β aggregate neighborhood sustainability data
- Carbon credit marketplace β earn real credits from verified behavior changes
- Smart home integration β automated energy tracking via IoT
- Corporate partnerships β employee sustainability programs
Built with π for the planet.
Prize Categories
-
Best use of Google Gemini
- Why Gemini 2.5 Flash? It's fast, cost-effective, and perfect for real-time interactions. The AI Magic behind the scenes makes it feel alive and responsive.
#devchallenge #earthday #gemini #sustainability #nextjs #ai






Top comments (0)