DEV Community

Cover image for EcoShift: Your AI-Powered Roadmap to a Zero-Waste Life
Nupoor Shetye
Nupoor Shetye

Posted on

EcoShift: Your AI-Powered Roadmap to a Zero-Waste Life

DEV Weekend Challenge: Earth Day

What I Built

EcoShift is a high-performance sustainability companion designed to solve the "intention-action gap"—the phenomenon where individuals want to live sustainably but lack the clear, personalized data and framework to do so. While most carbon calculators provide a static, often discouraging number, EcoShift creates a dynamic, continuous feedback loop that turns climate anxiety into climate action.

By combining real-time data tracking with the reasoning power of Google Gemini, the app helps users identify their highest-impact lifestyle areas and provides a gamified framework to commit to and sustain eco-friendly habits.

The Core Impact Pillars:

  • The Diagnostic Engine: Moving beyond basic estimates, EcoShift analyzes four critical life pillars—Diet, Transport, Energy, and Shopping+Waste—to build a comprehensive environmental profile.
  • Actionable Intelligence: Through Google Gemini, the app translates raw data into a personalized "Environmental Roadmap." Instead of generic advice, the AI analyzes user inputs to suggest bespoke habit swaps that offer the highest carbon reduction for their specific lifestyle.
  • The Food Miles Transparency Tool: This feature exposes the hidden environmental cost of global supply chains. By visualizing the journey of ingredients in a dish, users gain a visceral understanding of the "carbon cost" of their plate and are empowered with local, seasonal alternatives.
  • A Gamified Ecosystem: To ensure long-term retention, EcoShift treats sustainability as a journey. By checking in daily, users earn tangible rewards (vouchers from green brands) and see their cumulative impact grow through real-time visualizations.

Demo

Live Site

Video Walkthrough

Video Walkthrough

Code

Note

This project uses the free tier of the Gemini API which has a limit of 20 requests/day for specific models. In case the rate limit is reached, the application is supplemented with static data, however some features, specifically personalized tips and food miles may not work as expected(the video walkthrough shows how it utilizes AI). To check the working of Food Miles page, select any one of the 'suggested' recipes as they are displayed using hardcoded data.

How I Built It

The EcoShift architecture was designed for speed, scalability, and intelligence using a modern full-stack approach.

The Tech Stack

  • Frontend: Built with React + Vite. Vite was chosen for its lightning-fast development cycle and optimized production builds, ensuring a smooth, responsive UI for interactive dashboards.
  • Backend & Auth: Powered by Supabase. I leveraged Supabase Auth for secure user onboarding and the PostgreSQL database to manage real-time tracking of habits, points, and user commitment logs.
  • AI Engine: Integrated Google Gemini via API to handle complex natural language tasks and personalized data analysis.

Technical Implementation

  1. The Carbon Intelligence Layer: When a user completes the footprint diagnostic, the data is processed via Google Gemini. The AI analyzes the specific lifestyle patterns and generates a prioritized list of "Habit Swaps." This context-aware strategy ensures recommendations are relevant to the user's actual behavior.
  2. Gamified Habit Tracking: Using Supabase, I implemented a "Commitment" system. When a user commits to a fix, it is stored in their profile. The daily check-in page updates their progress in real-time, calculating the total carbon reduced and awarding XP/badges through custom logic.
  3. The Food Miles Feature: This feature utilizes Gemini's reasoning capabilities to parse user-entered dishes. Gemini breaks down the recipe into ingredients, predicts likely global origins, and suggests local alternatives, which are then rendered on a map visualization.

Prize Categories

Best Use of Google Gemini

EcoShift demonstrates the power of Gemini as a reasoning engine rather than just a chatbot:

  • Dynamic Data Analysis: Gemini analyzes the specific JSON output of a user's footprint to create a human-centric "action plan".
  • Supply Chain Inference: In the Food Miles feature, Gemini bridges the gap between a recipe name and global logistics data, identifying ingredient origins effectively.

Top comments (0)