Inspiration If you open up a legacy corporate codebase, it looks like a physical CPU with a hundred tangled, undocumented wires. We call it "Spaghetti Code." Right now, companies burn thousands of hours paying senior engineers just to manually trace data flows before they can even begin to fix a bug or onboard a new hire.

The inspiration for DocSpaghetti came from realizing that existing AI tools do not solve this macro-level problem. GitHub Copilot writes the next line of code, and ChatGPT returns a wall of unstructured conversational text. We realized the industry needed an automated Static Application Security Testing (SAST) pipeline that acts as a forensic architect, instantly turning tangled legacy files into a clean, actionable blueprint.

What it does DocSpaghetti is an AI-driven DevSecOps architectural mapping tool. It allows developers to drag and drop undocumented, messy legacy code files directly into a browser-based ingestion zone. In seconds, it processes the files and generates a fully interactive dashboard that maps the cross-file data flow, isolates structural modules, and runs a forensic security audit to catch logic bombs and hardcoded secrets. Finally, it allows developers to export the entire audit into a GitHub-ready Markdown blueprint with a single click.

How we built it DocSpaghetti was engineered to be a serverless, highly responsive DevSecOps tool.

Frontend: We built the interactive dashboard using React and Tailwind CSS. We utilized the HTML5 File API to create a local ingestion zone that reads files directly in the browser's memory, ensuring zero backend latency and maintaining strict code privacy.

Intelligence Engine: We integrated the Google Gemini 2.5 Flash model. We chose this specific model for its massive 1-million token context window, which is critical for ingesting entire multi-file workspaces simultaneously.

Deployment: The entire application is deployed serverless via Netlify, with API keys secured through server-side environment variables.

Challenges we ran into Our biggest technical hurdle was bridging the gap between unpredictable Large Language Model (LLM) outputs and a strict React rendering state.

Initially, passing raw code to the AI resulted in conversational text that instantly crashed our frontend state and broke our mapping functions. We could not just build a chatbot; we needed structured data. To solve this, we engineered a strict deterministic API gateway. We injected a hardcoded JSON schema directly into the Gemini generation config. If the model did not return perfectly formatted, parseable JSON containing the exact metadata, security flaws, and data flow sequences we requested, the gateway rejected it. Forcing an AI into a strict data pipeline without structural hallucinations took serious architectural debugging.

Accomplishments that we're proud of The Deterministic Pipeline: Successfully forcing a generative AI model into a strict JSON-only schema to dynamically power a complex React dashboard without crashing.

Zero-Backend Architecture: Utilizing browser memory for file ingestion, ensuring that proprietary code never has to touch a third-party database.

Enterprise UI/UX: Designing a premium, highly tactile interface with interactive physics and state management that feels like a paid developer tool rather than a weekend hackathon project.

What we learned Building DocSpaghetti forced us to level up from writing basic scripts to designing enterprise-grade architecture.

Constraining AI: We learned how to manipulate LLM generation configs to output strict data schemas, transforming models from simple chatbots into reliable data engines.

Complex State Management: We mastered handling asynchronous React states that dynamically update an entire UI layout across multiple tabs without page reloads.

Shifting Security Left: We learned the true value of DevSecOps. By automatically flagging vulnerabilities at the point of ingestion, we understood how modern engineering teams actively manage and mitigate technical debt.

What's next for DocSpaghetti RAG Vector Database Integration: To scale for massive enterprise repositories with thousands of files, we plan to implement a Retrieval-Augmented Generation (RAG) architecture using Gemini Embeddings to dynamically fetch only relevant files rather than concatenating the entire workspace.

GitHub Webhook Automation: We plan to integrate DocSpaghetti directly into CI/CD pipelines. Instead of manual uploads, the tool will automatically scan new Pull Requests and leave architectural reviews as comments before code is allowed to merge.

Share this project:

Updates

Submission history