Inspiration

I am passionate about coding and also care deeply about environmental sustainability. While learning software development, I realized that developers rarely think about the energy or carbon impact of their code. This project was inspired by the idea of making software efficiency visible not just in terms of performance, but also in terms of environmental impact.

What it does

GreenCode-AI analyzes source code to estimate its energy consumption and carbon footprint. It assigns a carbon efficiency score, identifies energy-intensive code patterns, and suggests optimized alternatives that reduce carbon emissions while maintaining functionality.

How we built it

We used the Gemini API to analyze code structure, computational complexity, and inefficiencies. The backend processes the code and estimates energy usage using static analysis and heuristics, while Gemini generates explanations and optimization suggestions. A simple frontend displays scores, insights, and comparisons.

Challenges we ran into

Estimating carbon impact without executing the code was challenging. We addressed this by combining algorithmic analysis with practical assumptions. Another challenge was providing optimization suggestions that were both efficient and easy to understand.

Accomplishments that we're proud of

We built a tool that connects coding practices with sustainability in a practical way. GreenCode-AI helps developers understand the environmental cost of their software and encourages greener coding decisions.

What we learned

We learned how software design choices directly affect energy usage and carbon emissions. This project also helped us gain experience in AI-driven code analysis and explainable AI systems.

What's next for GreenCode-AI

We plan to improve accuracy by adding runtime analysis and integrate the tool into IDEs and CI/CD pipelines, making carbon-aware coding part of everyday development.

Built With

  • and
  • cloud
  • firebase/firestore-for-storage
  • for
  • gemini-1.5-pro-api-via-google-ai-studio
  • google
  • javascript-(react)
  • python-(fastapi)
  • run
  • tree-sitter-for-code-analysis
Share this project:

Updates