Inspiration

The idea for Codeoscope sparked from my own struggles as a solo developer navigating complex codebases, particularly during hackathons or when exploring projects like ArduPilot’s UAVLogViewer. I was frustrated by the lack of tools that could simplify code understanding and visualization. This personal challenge inspired me to create a solution that blends AI-driven analysis with interactive diagrams, aiming to make code exploration intuitive and educational for developers working alone or in teams.

What it does

Codeoscope is a web-based tool I developed to help developers, including myself, analyze and visualize codebases with ease. It generates System Architecture, Block, and Data Flow Diagrams using Mermaid.js, offers detailed explanations for pasted code snippets or uploaded files through an advanced AI analyzer, and supports local folder uploads for context-rich insights. Users can tag snippets, customize the UI, and explore code, all within a responsive interface built with React and Tailwind CSS.

How I built it

I constructed Codeoscope using a modern web development stack, utilizing Bolt.new’s WebContainer environment for efficient prototyping. The core code analysis is powered by a custom-built module, ArchitectureAnalyzer.ts located in /src/services/, which leverages LokiJS, a lightweight in-memory JavaScript database, to track and store component nodes, relationships, and analysis progress. This module parses project structures and builds relationships locally, integrating data from GitHub’s REST API without relying on LLM-based APIs like OpenAI or Gemini. The frontend is built with React for dynamic components and styled with Tailwind CSS, while diagrams are rendered using Mermaid.js via CDN. I incorporated the FileSystem API for local file handling and iteratively refined the UI, deploying the application via Netlify for seamless access.

Challenges I ran into

One significant challenge I faced was ensuring Mermaid.js diagrams rendered correctly, as I encountered parse errors due to syntax issues (e.g., misplaced classDef statements). Debugging this required me to study Mermaid documentation and adjust my generator logic. Optimizing the AI analyzer for diverse snippets while balancing performance was another hurdle, and time limits constrained initial support for multiple file uploads. Aligning Tree-sitter parsing with real-time UI updates also tested my integration skills.

Accomplishments that I am proud of

I’m proud to have built a fully functional prototype in under 48 hours as a solo developer, featuring interactive diagrams and detailed code explanations. Overcoming the Mermaid rendering error to produce accurate C4 models for UAVLogViewer was a personal triumph, showcasing my problem-solving ability. Integrating AI insights with a user-friendly interface, along with adding customizable settings, exceeded my initial goals and earned positive feedback from early testers.

What I learned

Through this project, I gained practical experience with Tree-sitter for code parsing and Mermaid.js for diagramming, deepening my knowledge of static analysis tools. I learned to fine-tune AI outputs for better summary detail and mastered reactive UI design with React. The hackathon taught me the value of iterative testing and the power of tools like Bolt.new, inspiring me to focus on user-centric design in my future work.

What's next for Codeoscope

Moving forward, I plan to enhance Codeoscope with multi-file analysis for entire directories and add collaborative features like shared diagrams. I’ll refine the AI analyzer with language-specific optimizations and integrate real-time collaboration tools. User feedback will shape new additions, such as exportable diagram formats (e.g., SVG) and advanced snippet search. Ultimately, I aim to release it as an open-source project, inviting the community to help it grow.

Share this project:

Updates