Inspiration
When a backend crashes in production, a developer's first task is always the same: read the stack trace, find the faulty file, trace the variable, and figure out why it broke. It’s tedious, repetitive, and wastes valuable engineering hours.
We asked ourselves: "Why are we using AI just to chat about our code, when we could build an AI agent that automatically detects the root cause and writes the patch for us?" That thought led to CodeHeal X—an autonomous backend repair engineer designed to eliminate the manual bug-hunting process entirely.
What it does
CodeHeal X is an API-first web application that acts as an automated pipeline for backend repair.
Instead of a generic chatbot wrapper, CodeHeal X provides a specialized, closed-loop workflow:
Input: The developer uploads a broken backend file and the corresponding error log (e.g., a stack trace from a failed test or a runtime crash).
Analysis: The system securely passes this context to an LLM via the official API, utilizing a strict system prompt that forces the AI into a "Senior Debugger" persona.
Execution: The AI diagnoses the exact root cause and generates a surgical code patch.
Output: CodeHeal X returns a strictly formatted JSON response and visually renders a clean "Before/After" diff, simulating the verification process of a CI/CD pipeline.
How we built it
We prioritized a lightweight, fast, and dependency-free MVP to ensure demo reliability.
Frontend: Built completely with Vanilla HTML, CSS, and JavaScript. We engineered a premium, Vercel-inspired UI with a simulated terminal animation to visually communicate the autonomous agent's thought process.
Backend: A Node.js and Express server that acts as a secure intermediary.
AI Engine: We integrated the Google Gemini API (Gemini 2.5 Flash) via the @google/genai SDK. We enforced strict JSON schemas to ensure the AI's output is machine-readable and free from hallucinated markdown fences.
Security: Implemented a "Bring Your Own Key" (BYOK) architecture where the user's API key is held only in memory for the session lifecycle, never stored on a server.
Challenges we ran into
Getting an LLM to reliably output clean code without extra conversational text (like "Here is the fixed code!") was our biggest hurdle. The LLM would often wrap its JSON output in markdown fences, which broke our frontend parser. We overcame this by heavily optimizing the system prompt and implementing robust server-side regex cleaning before passing the JSON to the UI.
Additionally, handling API rate limits and token length constraints required us to dynamically calculate payload sizes before routing requests to the AI engine.
Accomplishments that we're proud of
We successfully moved beyond the basic "chat with your code" paradigm. We built an application that feels like a real developer tool. The UI is highly polished, the backend is resilient against bad AI outputs, and the entire workflow executes seamlessly. We are incredibly proud of the simulated terminal experience, which perfectly bridges the gap between raw API calls and a compelling user experience.
What we learned
We learned the massive difference between using AI as an assistant versus using it as an agent. Enforcing strict JSON structures is significantly harder than standard text generation, but it is the only way to build automated systems that don't crash when the AI decides to change its formatting.
What's next for CodeHeal X
This hackathon MVP is just phase one. The true vision for CodeHeal X is CI/CD integration. In the future, we plan to:
Connect CodeHeal directly to GitHub webhooks.
Create a secure Docker sandbox environment where the generated patch is actually compiled, and unit tests are automatically re-run.
Have the AI automatically open a Pull Request with the verified fix the moment a production alert is triggered.
Built With
- css3
- express.js
- google-gemini
- html5
- javascript
- node.js
Log in or sign up for Devpost to join the conversation.