Inspiration

Conceptualized specifically for Gemini Day, CodeSensei was born out of the everyday engineering grind in the AIML labs. Constantly wrestling with foundational programming concepts and debugging front-end web projects, it became clear that standard compilers only throw frustrating, raw error codes—they don't actually teach. The goal was to harness the raw reasoning power of the Gemini 2.5 Flash API to build a true digital mentor. We wanted to create a "Sensei" that doesn't just spoon-feed fixed code, but interactively explains the why behind broken logic, turning debugging into a learning experience.

What it does

CodeSensei is an enterprise-grade, AI-powered coding environment. Users write or paste their code into a sleek, fully functional code editor. With a single click, the tool auto-detects the programming language, scans for syntax and logical errors, and highlights the exact breaking points. By double-clicking any error line, developers summon the interactive "Sensei Chatbot" for a conversational breakdown of the issue. Even if the submitted code is flawless, the tool automatically provides a modernized, refactored version of the script, complete with algorithm complexity metrics (Time/Space) and a clean Git commit message.

How we built it

The front-end was engineered using semantic HTML5, custom CSS3, and vanilla JavaScript, entirely encapsulated in a seamless Glassmorphism UI to provide a premium developer experience. We integrated the CodeMirror library to handle real-time syntax highlighting, bracket matching, and auto-indentation. The core intelligence relies on a direct integration with the Google Gemini 2.5 Flash API. We utilized advanced prompt engineering to ensure the AI acts as an enterprise analyzer, returning strict, parseable JSON payloads that seamlessly and dynamically update the DOM.

Challenges we ran into

One of the biggest hurdles was strict prompt engineering. Forcing the AI to consistently return pure JSON data—without wrapping it in Markdown—and preventing it from hallucinating errors on perfectly correct code required relentless testing and refinement. Additionally, overriding CodeMirror's default styling to smoothly blend into our custom transparent Glassmorphism design without breaking the underlying CSS took hours of precise, line-by-line debugging.

Accomplishments that we're proud of

We are incredibly proud of achieving a truly distraction-free, seamless workflow where the text editor and the AI exist in a single, cohesive interface. Bridging a robust third-party text editor with a live generative AI model to create an interactive, educational chatbot experience—all without relying on heavy frontend frameworks like React—is a massive technical win for the project.

What we learned

This project drastically leveled up our grasp of asynchronous JavaScript, handling complex API promises, and managing dynamic UI updates. We also refined our understanding of algorithmic efficiency. Prompting the AI to evaluate whether an algorithm is optimal forced a deeper dive into strict time and space complexity analysis, perfectly aligning practical web development with core engineering principles

What's next for CodeSensei

The vision for Phase 2 includes adding a "Competitive Programming Mode" that checks for potential Time Limit Exceeded (TLE) constraints before a user submits code to global platforms. We also plan to introduce a "Dojo Leaderboard" to gamify the learning process, tracking how much users optimize their code complexities over time, and a feature for generating Mock API Responses to serve as a complete sandbox environment for front-end web development.

Share this project:

Updates

Submission history