Skip to content

devoidco/ecolens

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

🌱 EcoLens: Intelligent Carbon Scanner

Flutter Dart Gemini AI Firebase

Reveal the hidden carbon cost of your shopping. > Turn messy receipts into actionable climate data instantly using AI.


📖 Table of Contents


💡 About the Project

EcoLens bridges the gap between economic activity and environmental impact. While most carbon calculators focus on transport (flights/cars), they often ignore a massive chunk of daily emissions: Retail Consumption (FMCG).

Manually inputting grocery items into a calculator is tedious. EcoLens solves this by using Google Gemini 1.5 Flash to visually scan receipts, decipher abbreviations, classify products into scientific economic sectors, and calculate their carbon footprint in seconds.


✨ Key Features

  • 📸 AI Receipt Scanner: Snap a photo of any receipt (thermal, crumpled, or faded).
  • 🧠 Multimodal Intelligence: Uses Gemini Vision to read text and understand context (e.g., mapping "Indomilk" to "Dairy Products").
  • 📊 Scientific Accuracy: Maps consumer goods to specific EEIO (Environmentally Extended Input-Output) industrial sectors.
  • 🌲 Impact Visualization: Translates abstract CO2kg numbers into tangible metrics:
    • Trees required to offset.
    • Deforestation area (m²) caused.
  • ⚡ Real-time Calculation: Optimized for speed using the google_generative_ai Dart SDK.
  • 👤 Guest Mode: Frictionless entry with Firebase Anonymous Auth.

🔬 How It Works (The Science)

EcoLens operates on a 3-step AI-Scientific pipeline:

1. Vision & Extraction (Gemini 1.5 Flash)

The app sends the raw image to Gemini with a system instruction to act as an Environmental Economist. It performs OCR and cleans noisy data from thermal paper.

2. Semantic Classification

Instead of simple keyword matching, the AI classifies items based on semantic meaning into a fixed list of industrial sectors defined in our database.

  • Input: "POCARI SWT 500"
  • AI Inference: "Manufacture of beverages"

3. The Math (Spend-Based Method)

We calculate the Product Carbon Footprint (PCF) using the standard Spend-Based emission factor formula, adjusted for currency (IDR to EUR) and inflation (2019 baseline to Present Day).

$$ TotalEmission = \sum (Price_{IDR} \times CurrencyRate \times InflationFactor \times EmissionFactor_{sector}) $$


🛠 Tech Stack

  • Frontend: Flutter (Dart)
  • AI Model: Google Gemini 1.5 Flash
  • Backend/Auth: Firebase Authentication
  • State Management: Provider / Riverpod (Adjust based on your actual code)
  • Networking: HTTP & Dio
  • Data: JSON-based Emission Factors (EEIO Standards)

🚀 Getting Started

Follow these steps to run EcoLens locally.

Prerequisites

  • Flutter SDK installed.
  • A Google Cloud Project with Gemini API enabled.
  • A Firebase Project setup for Authentication.

Installation

  1. Clone the repository

    git clone [https://github.com/devoidco/ecolens.git](https://github.com/devoidco/ecolens.git)
    cd ecolens
  2. Install Dependencies

    flutter pub get
  3. Configure API Keys

    • Create a file named api_constants.dart in lib/core/constants/.
    • Add your API keys (Do not commit this file to Git!):
    // lib/core/constants/api_constants.dart
    
    class ApiConstants {
      static const String geminiApiKey = "YOUR_GEMINI_API_KEY_HERE";
      // Add other keys if necessary
    }
  4. Run the App

    flutter run

📱 Screenshots

Home Screen Scanning Analysis Result Impact View

(Note: Please upload screenshots to an assets/screenshots folder in your repo to make these visible)


🗺 Roadmap

  • Receipt OCR & Parsing
  • AI Classification Logic
  • Basic Carbon Calculation
  • User History & Monthly Tracking
  • Gamification (Green Score)
  • Product Alternatives Suggestion
  • Export Report to PDF

📄 License

Distributed under the MIT License. See LICENSE for more information.


Built with ❤️ for the Planet using Flutter & Gemini.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages