Skip to content

Durgaprasad-Developer/EcoPilot-AI

Repository files navigation

EcoPilot AI — Personal Carbon Footprint Coach

🏆 Official Google PromptWars Submission

Challenge Statement

Design a solution that helps individuals understand, track, and reduce their carbon footprint through simple actions and personalized insights.


📋 Challenge Mapping

PromptWars Requirement EcoPilot Solution
Understand Dynamic Source Breakdown of emissions, real-time natural language activity parser
Track Chronological 7-day trend analysis, category share indicators, cumulative tracking
Reduce One-click daily eco action offsets, net footprint calculations updating instantly
Personalized Insights Context-aware AI recommendations generated by Google Gemini using historical activities

🏗 Architecture & Data Flow

User Input (Natural Language)
   │
   ▼
Google Gemini API (gemini-2.5-flash with gemini-2.5-pro fallback)
   │
   ▼
Strict JSON Schema Parser (Zod validation)
   │
   ▼
Carbon Calculation Engine (Deterministic mathematical model)
   │
   ▼
Local Storage Service (Mock DB/Auth Layer for isolated judges testing)
   │
   ▼
Custom Hooks Layer (useDashboardStats, useActivityLogger, useOnboarding)
   │
   ▼
Accessible Presenter Components (WCAG 2.2 AA Compliance)
   │
   ▼
[ Understand ] ───► [ Track ] ───► [ Reduce ]

🧠 Why EcoPilot? (Why Existing Calculators Fall Short)

  • Static Scoring vs. Continuous Coaching: Traditional calculators compute carbon once and provide generic advice. EcoPilot acts as an ongoing mentor that tracks emissions continuously.
  • Manual Form Entry vs. Natural Language: Standard calculators require tedious manual input. EcoPilot extracts complex actions from simple phrases ("drove 15 miles, ate chicken salad").
  • No Loop Closure vs. Actionable Reduction: Standard apps don't connect advice to action. EcoPilot offers one-click offsets that directly decrement the daily carbon total in real time.

✨ How EcoPilot Solves the Challenge

1. Understand Your Footprint

  • Interactive Input Parser: Evaluates everyday tasks from natural language descriptions.
  • Dynamic Source Breakdown: Instantly shows the percentage breakdown of emission contributors directly inside the daily stats panel.

2. Track Your Progress

  • 7-Day Trend Charts: Uses Recharts to visualize day-over-day footprints.
  • Category Share Pie Chart: Highlights category distribution.
  • Tabular Screen Reader Summaries: Provides accessible tables representing chart data.

3. Reduce Your Emissions

  • One-Click Eco Actions: Offers quick offset options aligned with user sustainability goals.
  • Net Carbon Reductions: Measurable savings that instantly decrease the daily footprint.

4. Personalized AI Insights

  • Contextual Advice: Tailors suggestions to the user's specific logged behavior.

🛠 Engineering & Quality Excellence

♿ Accessibility (WCAG 2.2 AA Compliance)

  • Skip Navigation Link: High-contrast, keyboard-focusable link to bypass menus.
  • Landmarks: Explicit header, nav, main, and section structural landmarks.
  • Tabular Chart Summaries: Hidden HTML tables summarizing complex graphs.
  • Reduced Motion: Global CSS overrides respecting browser media preferences.
  • High Contrast: AAA-rated dynamic badges and high-contrast text ratios.

🔒 Security & Safety

  • Prompt Injection Protection: Sanitizes tags and brackets, wrapping input in isolated XML boundaries.
  • Structured JSON Parsing: Rigorous validation using Zod.
  • Secure API Handling: Uses Next.js server actions to prevent Client API key leakage.

🧪 Test Coverage

  • 25 Pass Specifications: Unit, validation, and integration tests verifying all services.

🚀 Installation & Setup

  1. Clone the repository:
    git clone <repository_url>
    cd EcoPilot-AI
  2. Install dependencies:
    npm install
  3. Configure Environment Variables: Rename .env.example to .env or create a .env file in the root directory:
    NEXT_PUBLIC_GEMINI_API_KEY=your_gemini_api_key_here
  4. Run the development server:
    npm run dev

🏷 Repository Details for GitHub

  • Description: AI-powered personal carbon footprint coach built with Next.js and Gemini AI for Google PromptWars.
  • Topics: promptwars, gemini, google-ai, nextjs, typescript, sustainability, carbon-footprint, ai-assistant, tailwindcss, hackathon

About

AI-powered personal carbon footprint coach built with Next.js and Gemini AI for Google PromptWars.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors