Inspiration

Inspiration In an era where AI and computational demands are skyrocketing, the environmental cost of software development often goes unmonitored. We observed that developers lack immediate, actionable feedback on the energy footprint of their code. JouleTruth was born from the realization that we don't just need more efficient hardware—we need to enforce "Truth by Joule" principles directly within the software engineering lifecycle to identify and eliminate computational bloat at the source. What it does JouleTruth is an AI-powered "Green AI" auditor and code profiler. Developers paste their code into our Tech-Noir, terminal-inspired dashboard, and our engine instantly analyzes it for computational bloat, memory leaks, and energy waste. Instead of just giving theoretical advice, JouleTruth outputs a structured Optimization Pathway, an estimated Efficiency Gain metric, and features a Side-by-Side Diff Viewer that provides the developer with refactored, hardware-optimized code (such as utilizing pre-allocated Int32Array structures to reduce Garbage Collection pressure). How we built it We utilized a three-layer methodology to build JouleTruth for speed, reliability, and visual authority: Surface: A clean, high-contrast React dashboard powered by Tailwind CSS and Framer Motion. We avoided standard hackathon UI templates to create a deep, Tech-Noir aesthetic that feels like genuine hardware telemetry. Architecture: A robust Express.js backend acts as a secure proxy, isolating API keys and enforcing the "Green AI" auditing protocol. The Intelligence: We engineered a deterministic prompt structure for the Google Gemini API (Flash 1.5). The backend pipes user code through this auditor, forcing Gemini to parse the submission for algorithmic inefficiencies. Using strict schema definitions, Gemini returns a guaranteed JSON object containing the energy profile, efficiency score, and the newly refactored code. Challenges we ran into Deterministic Output: Getting an LLM to consistently return valid, parseable JSON without injecting Markdown formatting (like ```json) was a challenge. We had to build robust backend sanitization to ensure the React frontend never crashed. Rate Limiting: As we iteratively tested heavy, complex algorithmic bloat, we hit the 429 Resource Exhausted API limit. We had to implement graceful error handling and learn to optimize our own API calls while building the tool! Accomplishments that we're proud of We are incredibly proud of how we elevated the prompt engineering. Rather than Gemini just saying "this loop is slow," we successfully engineered the prompt to act as a strict hardware engineer. Seeing the Gemini API correctly identify nested object instantiations and rewrite them into memory-efficient, pre-allocated TypedArrays proved that our tool has real, immediate value for modern developers. What we learned We learned the immense power of combining structured UI telemetry (gauges, step-by-step pathways) with the raw analytical power of Google Gemini. We also deepened our understanding of how high-level code directly translates to low-level hardware energy consumption, and how AI can bridge that knowledge gap for everyday developers. What's next for JouleTruth We have a powerful foundation, but the vision for JouleTruth is to become a mandatory check in the software development pipeline: CI/CD Integration: Automatically trigger audits on every GitHub Pull Request to block inefficient code merges. Expanded Language Support: Deep-dive analysis for specialized low-level languages (C++, Rust) to provide hardware-specific optimization tips. Real-time Hardware Telemetry: Integrate with actual hardware monitoring APIs to correlate code audits with real-world energy consumption data

Built With

Share this project:

Updates

Submission history