THE NATIONAL COLLEGE
Autonomous
Jayanagar,Bengaluru-560070
PROJECT REPORT
ON
“AutoDoc”
BY
Name – Arya N Rajavanthi
Register no – U03ZH23S0079
Under the guidance of
Kavya K.C
AutoDoc project report submitted in partial fulfilment of the requirements of
VI Semester BCA, THE NATIONAL COLLEGE JAYANAGAR
THE NATIONAL COLLEGE
Autonomous
Jayanagar, Bangalore-560070
CERTIFICATE
This is to certify the project report titled “AutoDoc” is a bonafide record
of work done by Arya N Rajavanthi(U03ZH23S0079) of THE
NATIONAL COLLEGE, Jayanagar, Bengaluru, in partial fulfilment of
the requirements of VI Semester BCA during the academic year 2025-
2026.
Prof. T S ASHA Kavya K.C
Examiners: Examination Centre
1. The National
College,
Jayanagar.
2. Date of Examination:
AutoDoc National College Jayanagar
ACKNOWLEDGEMENT
We are thankful to our beloved Principal Dr. C Vijaylakshmi who
encourages us to come with new and innovative ideas and for providing the
environment with all facilities for completing the project.
We are also grateful to our Head of the Department Prof. T S ASHA and
project guide Prof. Kavya K.C, lecturer Department of computer science for
her valuable guidance and constant support during our project development.
We extend our thanks to all our teaching staffs of department of computer
science. Finally, we thank one and all who helped us directly and indirectly for
the completion of our project.
DEPARTMENT OF COMPUTER SCIENCE PAGE 3
AutoDoc National College Jayanagar
INDEX
CONTENT PAGE NO
1. AutoDoc
a. Introduction 6
b. Defining the Problem 7
c. Solution Proposed 8-9
d. Block Diagram or E-R Diagram 10
e. Component Required for S/W &H/W requirements 11-12
f. Scope of Application 13
2. Design Specification
a. Modular Description
3. Software Tools
a.
b.
4. Source Code 17-28
5. Screen Shots 29-32
6. Conclusion 33
7. Bibilography 34
DEPARTMENT OF COMPUTER SCIENCE PAGE 4
AutoDoc National College Jayanagar
ABSTRACT
In the contemporary landscape of software engineering, comprehensive and meticulously
maintained documentation is a fundamental pillar for ensuring system scalability, facilitating
seamless developer onboarding, and preserving long-term architectural integrity. Despite its
critical importance, documentation remains one of the most historically neglected aspects of the
software development lifecycle.
The primary cause of this neglect is the manual, time-consuming effort required to keep textual
documentation synchronized with rapidly evolving, iterative codebases. When software
engineers inherit legacy systems, or when they are tasked with reviewing highly complex pull
requests, the absence of up-to-date architectural context inevitably leads to severe technical debt,
the formation of localized knowledge silos, and significantly prolonged development cycles.
To directly combat this industry-wide inefficiency, this project introduces AutoDoc, an
intelligent, omni-language repository analysis engine engineered to completely automate the
generation of production-ready software documentation. AutoDoc effectively bridges the gap
between raw, unstructured source code and human-readable architectural intelligence by
leveraging the capabilities of state-of-the-art Large Language Models (LLMs).
The application is built upon a modern, decoupled client-server architecture. The frontend is
developed using [Link] and Vite, featuring a highly responsive, Neo-Brutalist graphical user
interface that natively parses and renders both Markdown syntax and complex SVG graphics.
The backend infrastructure is powered by Python and the FastAPI framework, chosen
specifically for its robust support of asynchronous event-loop execution.
Instead of relying on traditional, rigid static analysis tools that only offer mathematical metrics,
AutoDoc’s backend utilizes a custom dual-pass fetching algorithm that interfaces directly with
the GitHub REST API. This algorithm dynamically extracts high-value configuration files
alongside up to 30,000 characters of core application logic across more than twenty distinct
programming languages. This massive contextual payload is then processed concurrently using
the Groq API and the LangChain framework.
By employing advanced prompt engineering methodologies such as "Template Boxing," the
system simultaneously generates five distinct analytical artifacts in a matter of seconds. These
artifacts include a comprehensive Markdown README, a system entropy and maintainability
evaluation, an interactive [Link] topology flowchart, a customizable technical interview
simulation, and a preliminary architectural security audit. The resulting application drastically
reduces the friction associated with code comprehension, proving that generative AI can be
systematically integrated to map, audit, and explain complex software architectures in real-time
DEPARTMENT OF COMPUTER SCIENCE PAGE 5
AutoDoc National College Jayanagar
AutoDoc
INTRODUCTION
The paradigm of modern software engineering has shifted heavily toward Agile methodologies,
Continuous Integration, and Continuous Deployment (CI/CD). While this acceleration enables
rapid feature delivery and highly iterative development cycles, it frequently forces development
teams to treat comprehensive system documentation as a secondary, deferred priority. In the
software industry, it is a well-established axiom that code is read far more often than it is written.
However, as enterprise codebases scale in complexity and undergo continuous modification by
distributed teams, the synchronization between the actual application logic and its accompanying
documentation rapidly deteriorates.
When original system architects transition to new roles, switch departments, or leave an
organization entirely, the undocumented or poorly documented codebase they leave behind
transforms into a severe liability known as legacy technical debt. Incoming developers and
maintainers are subsequently forced to manually trace function calls, decipher opaque database
schemas, and attempt to map out microservice interactions without the benefit of a centralized
architectural guide. This blind exploration leads to a massive loss of productive engineering
hours, increases the likelihood of introducing system-breaking regressions, and creates intense
frustration among development teams.
Furthermore, the existing tooling ecosystem fails to solve this problem qualitatively. Traditional
static analysis and linting tools (such as SonarQube, ESLint, or Prettier) are highly effective at
enforcing syntax rules and calculating quantitative metrics, such as cyclomatic complexity or
code duplication percentages. However, they are fundamentally incapable of explaining the
intent behind the code. They cannot tell a new developer why a specific design pattern was
chosen, how data flows from the frontend to the database, or what the overarching purpose of the
repository is.
To address this critical intelligence gap, this project introduces AutoDoc: The 8-Bit Architect.
AutoDoc is a full-stack, AI-driven web application designed to completely automate the software
comprehension and documentation process. By bridging modern web frameworks with cutting-
edge Language Processing Unit (LPU) infrastructure via the Groq API, AutoDoc acts as a virtual
Senior Technical Writer and Systems Architect. It systematically extracts raw repository code,
analyzes its structural topology, and dynamically generates multi-dimensional, human-readable
intelligence. AutoDoc does not merely summarize code; it translates complex, undocumented
repositories into structured architectural insights, thereby significantly reducing developer
friction, expediting the onboarding process, and elevating the long-term maintainability of the
software system.
DEPARTMENT OF COMPUTER SCIENCE PAGE 6
AutoDoc National College Jayanagar
DEFINING THE PROBLEM
The traditional approach to software documentation, repository onboarding, and code
comprehension suffers from several critical bottlenecks that severely hinder overall developer
productivity and system security:
1. Severe Time and Resource Misallocation The manual drafting of architecture documents,
comprehensive README files, and component flowcharts is a highly labor-intensive and
tedious process. Developers are often forced to halt active feature development to write
documentation. Because developers are measured on feature delivery rather than documentation
output, this task is routinely rushed, skipped entirely, or left to become outdated within days of
being written.
2. The Danger of Knowledge Silos and Tribal Knowledge When a software repository lacks
continuously updated documentation, the fundamental understanding of the system's architecture
becomes localized to a very small group of original developers—a phenomenon known as "tribal
knowledge." If these key developers leave the organization (often referred to as a low "Bus
Factor"), the code becomes entirely opaque. It becomes exceedingly difficult and dangerous for
new team members to safely modify the system, as changing one undocumented function may
trigger cascading failures throughout the application.
3. Inefficiency of Traditional Static Code Analysis While the industry relies heavily on static
analysis tools to maintain code quality, these tools only measure mathematical metrics. They can
flag a function for being too long, but they cannot explain what the function is attempting to
achieve within the broader business logic. This leaves a massive qualitative gap where
developers know the code is complex, but still have no plain-English explanation of how the
architecture flows.
4. The Cognitive Load of Architectural Mapping In modern, component-based architectures
or microservice environments, applications are split across hundreds of interconnected files.
Manually drawing, updating, and maintaining visual flowcharts to understand how these
different files, classes, and services interact is practically impossible. When developers cannot
visualize the topology of the codebase, they are forced to hold the entire system model in their
working memory, leading to high cognitive load and burnout.
5. Architectural Security Oversight Assessing the structural health and security posture of a
newly inherited repository requires years of senior-level architectural experience. Without
automated, qualitative architectural reviews, fundamental vulnerabilities—such as hardcoded
credentials, insecure API routing, or improper state management—can easily slip past standard
code reviews and make their way into production environments
DEPARTMENT OF COMPUTER SCIENCE PAGE 7
AutoDoc National College Jayanagar
SOLUTION PROPOSED
To decisively resolve the aforementioned bottlenecks, this project proposes the implementation
of AutoDoc, a fully automated, AI-driven repository analysis engine. The proposed solution
eliminates manual documentation efforts through the use of a highly optimized, concurrent data
pipeline that connects directly to Large Language Models. The specific architectural solutions
and modules implemented within the system are as follows:
1. Automated Omni-Language Context Extraction The system backend features a custom-
built, dual-pass parsing algorithm that interfaces directly with the GitHub REST API. To ensure
the AI never hallucinates the technology stack, the first pass specifically scans the repository tree
for high-value configuration files . The second pass then extracts up to 30,000 characters of core
application logic by matching against a tuple of more than twenty different programming
language extensions. This makes the tool entirely language-agnostic, capable of documenting a
Python backend just as efficiently as a Swift iOS application.
2. Concurrent AI Orchestration for Real-Time Execution Generating deep architectural
intelligence sequentially would result in severe network latency, causing the application to freeze
for upwards of a minute. AutoDoc solves this performance bottleneck by utilizing Python’s
[Link]() method within a FastAPI architecture. This allows the server to open
multiple asynchronous threads and send five separate, highly complex prompts to the Groq LLM
simultaneously. This architectural decision drastically reduces total processing time, delivering a
snappy, real-time dashboard experience.
3. Multi-Dimensional Intelligence Generation Rather than generating a single, overwhelming
block of text, the proposed system categorizes its analysis into a holistic view of the software
through five distinct modules:
Repository Documentation (README): A fully formatted, comprehensive Markdown
document detailing the core problem the code solves, its key features, the complete tech
stack, and step-by-step installation instructions.
System Entropy & Metrics: A qualitative evaluation that diagnoses code complexity,
technical debt, and overall architectural health.
Interactive Topology Mapping: The programmatic generation of [Link] syntax.
The React frontend safely intercepts this syntax, cleans it of markdown artifacts, and
renders it as a native, interactive SVG flowchart to visually map file interactions.
Candidate Simulation (Technical Interview): A dynamic module that acts as a
technical recruiter. It creates repository-specific interview questions tailored to user-
defined parameters (such as Junior, Mid-Level, or Senior Architect), deeply aiding in
technical onboarding and hiring.
Security Protocol: An automated preliminary audit that flags potential architectural
vulnerabilities identified in the source code and suggests industry-standard mitigations.
4. Prompt Engineering via "Template Boxing" To prevent the Large Language Model from
generating generic, conversational, or incomplete responses, the solution employs strict Prompt
Engineering techniques. By pre-supplying Markdown headers, structural constraints, and strict
formatting rules within the backend prompts (a technique known as Template Boxing), the
DEPARTMENT OF COMPUTER SCIENCE PAGE 8
AutoDoc National College Jayanagar
system mathematically forces the AI to output highly detailed, professional-grade documentation
every single time.
5. Frictionless Developer Experience and UI/UX The frontend is engineered using [Link]
and styled with a unique, high-contrast Neo-Brutalist interface using Tailwind CSS. It features
integrated Markdown rendering via react-markdown and remark-gfm. Crucially, it
includes one-click clipboard functionality, allowing developers to instantly transfer the generated
architectural intelligence directly into their IDEs (like VS Code) or internal wikis, creating a
zero-friction workflow
DEPARTMENT OF COMPUTER SCIENCE PAGE 9
AutoDoc National College Jayanagar
BLOCK DIAGRAM
DEPARTMENT OF COMPUTER SCIENCE PAGE 10
AutoDoc National College Jayanagar
COMPONENTS REQUIRED AND COST
1. Cloud Intelligence Infrastructure (The AI Engine)
Component: Groq Cloud API (running the llama-3.1-8b-instant model).
Utility: Provides the core Language Processing Unit (LPU) infrastructure required to
analyze abstract syntax trees and generate multi-dimensional documentation.
Cost Structure: The system is optimized to operate strictly within Groq’s free "On-
Demand" developer tier, utilizing a hard limit of 6,000 Tokens Per Minute (TPM).
Estimated Cost: ₹0.00
2. Data Pipeline & Version Control Integration
Component: GitHub REST API (Public Access).
Utility: Acts as the primary data source. The backend utilizes this API to recursively
parse repository trees, fetch critical configuration files ( [Link], Dockerfile),
and extract raw source code dynamically.
Cost Structure: Unauthenticated and standard authenticated requests to public
repositories are provided entirely free of charge under GitHub’s standard developer usage
policies.
Estimated Cost: ₹0.00
3. Frontend Development Frameworks
Component: [Link], Vite, Tailwind CSS, and [Link].
Utility: These open-source libraries form the foundation of the client-side architecture.
React manages the virtual DOM and state, Tailwind handles the Neo-Brutalist CSS
styling, and [Link] programmatically renders the interactive SVG topology graphs.
Cost Structure: Fully Open-Source (MIT License).
Estimated Cost: ₹0.00
4. Backend Orchestration Frameworks
Component: Python 3.10+, FastAPI, Uvicorn, and LangChain.
Utility: FastAPI acts as the high-performance asynchronous web server (ASGI), Uvicorn
runs the event loop, and LangChain provides the framework for prompt engineering and
chaining AI requests.
Cost Structure: Fully Open-Source (MIT/PSF License).
Estimated Cost: ₹0.00
5. Minimum Hardware Requirements (Developer / Host Machine) While physical
components do not need to be purchased, the system requires a baseline hardware configuration
to run the asynchronous Python backend and the [Link] frontend server simultaneously:
DEPARTMENT OF COMPUTER SCIENCE PAGE 11
AutoDoc National College Jayanagar
Processor: Minimum Intel Core i3 / AMD Ryzen 3 (Quad-Core recommended for
asynchronous thread management).
Memory (RAM): Minimum 8 GB DDR4 (To prevent memory heap overflow during
large repository fetches).
Storage: 500 MB of local disk space for virtual environments and node modules.
SOFTWARE REQUIREMENT
Processor : Intel Core i3 / AMD Ryzen 3 or higher
Operating System : Windows 10/11, macOS, or Linux
Front End : [Link], Vite, Tailwind CSS, and [Link]
Back End : Python 3.10+, FastAPI, Uvicorn, and LangChain
HARDWARE REQUIREMENT
Disk Space : Minimum 500 MB of free storage (for Node modules and Python virtual
environments)
RAM : Minimum 4 GB (8 GB recommended for seamless concurrent frontend and backend
execution
DEPARTMENT OF COMPUTER SCIENCE PAGE 12
AutoDoc National College Jayanagar
SCOPE OF APPLICATION
The scope of the AutoDoc system is expansive, addressing critical documentation and code
comprehension bottlenecks across multiple domains within the software engineering industry.
The application is designed to be highly versatile, acting as a force multiplier for individual
developers, enterprise teams, and technical recruiters. The specific domains and use cases where
AutoDoc yields the highest utility are detailed below:
1. Enterprise Software Development and Legacy System Onboarding In corporate
environments, developer turnover and internal role transitions frequently leave development
teams grappling with undocumented legacy systems. The primary scope of AutoDoc lies in
drastically reducing the onboarding time for new hires. Instead of spending weeks manually
tracing microservices, reading outdated wikis, or constantly interrupting senior engineers with
architectural questions, a new developer can input the legacy repository URL into AutoDoc. The
system instantly generates a comprehensive architectural map, component flowcharts, and
dependency metrics, enabling the new engineer to safely contribute to the codebase within days
rather than months.
2. Open-Source Software (OSS) Maintenance and Adoption In the open-source ecosystem,
the quality of a repository’s documentation directly correlates with its adoption rate and the
number of active contributors. Many solo developers build highly functional tools but lack the
time or technical writing skills to produce professional README files. AutoDoc provides
immense value to open-source maintainers by automatically generating highly polished,
production-ready Markdown documentation. This lowers the barrier to entry for external
contributors, ensures installation instructions are clear, and makes the repository significantly
more attractive to the broader developer community.
3. Technical Recruitment and Competency Assessment The "Candidate Simulation" module
expands AutoDoc’s scope into the Human Resources and technical recruitment sector.
Evaluating a candidate's practical understanding of a specific tech stack is often challenging.
Technical recruiters or engineering managers can use AutoDoc to scan their company’s
proprietary repositories (or similar open-source equivalents) and generate targeted, dynamically
scaled interview questions. Whether the company is hiring a Junior Frontend Developer or a
Senior Systems Architect, the system outputs relevant technical queries based on the actual
codebase, ensuring interviews are practical, highly contextual, and relevant to the day-to-day job
requirements.
4. Preliminary Security and Code Quality Auditing For DevOps engineers and technical
leads, maintaining code quality and security hygiene is a continuous requirement. AutoDoc acts
as an automated first-pass reviewer. While it does not replace dedicated, enterprise-grade
penetration testing tools, its "Security Protocol" and "System Entropy" modules provide
invaluable preliminary insights. It quickly flags architectural anti-patterns, highly coupled code,
potential hardcoded vulnerabilities, and missing dependency configurations, allowing teams to
address these issues proactively before they escalate into production failures.
5. Educational and Academic Utility AutoDoc holds significant educational value for computer
science students and coding boot-camp graduates. When students are learning how to build
complex, full-stack applications, they frequently study open-source repositories written by senior
engineers.
DEPARTMENT OF COMPUTER SCIENCE PAGE 13
AutoDoc National College Jayanagar
DEISIGN SPECIFICATION
MODULAR DESCRIPTION
1. Repository Input & Control Module This module serves as the primary user interface,
featuring a highly responsive Neo-Brutalist dashboard built with [Link]. It allows users to input
the target GitHub repository URL and dynamically configure analysis parameters, such as the
difficulty level and question count for the interview simulation. It also features a real-time
system log terminal to display backend execution states and error boundaries directly to the user.
2. Data Extraction & Parsing Module Operating on the FastAPI backend, this module acts as a
sophisticated, dual-pass repository scanner. It connects to the GitHub REST API to recursively
fetch directory trees, deliberately prioritizing high-value configuration files (like
[Link] or Dockerfile) to establish the baseline tech stack. It subsequently extracts
and concatenates up to 30,000 characters of core application logic across more than twenty
distinct programming languages.
3. AI Orchestration Module This is the core intelligence engine of the application, utilizing the
LangChain framework and the Groq LLM API. To bypass traditional sequential processing
latency, it employs Python's asynchronous event loop ([Link]) to execute five
distinct architectural prompt templates simultaneously. This concurrent execution guarantees the
real-time generation of the system's documentation, metrics, and security audits without freezing
the client application.
4. Markdown Rendering & Export Module This frontend module is responsible for translating
the raw, AI-generated markdown strings into a visually structured, human-readable format across
the application's tabs. Utilizing libraries like react-markdown and remark-gfm, it
dynamically applies custom Neo-Brutalist CSS styling to headers, code blocks, and tables.
Furthermore, it manages the clipboard state, providing frictionless one-click export functionality
for developers to transfer the documents into their IDEs.
5. Interactive Topology Mapping Module Dedicated specifically to architectural visualization,
this module intercepts programmatic [Link] syntax generated by the Large Language
Model. It employs custom error-handling boundaries and Regex filtering to strip away
markdown artifacts and safely pass the clean syntax to the Mermaid rendering engine. The result
is a dynamic, interactive SVG flowchart that visually maps the file interactions and overarching
logic flow of the scanned repository.
DEPARTMENT OF COMPUTER SCIENCE PAGE 14
AutoDoc National College Jayanagar
SOFTWARE TOOLS
The development of the AutoDoc system required a modern, full-stack ecosystem of software
tools, frameworks, and APIs. The following software tools were utilized to engineer the client
interface, backend server, and artificial intelligence integration:
1. Integrated Development Environment (IDE)
Visual Studio Code (VS Code): Utilized as the primary, open-source code editor. Its
lightweight architecture, integrated terminal, and robust extension ecosystem facilitated
the seamless, simultaneous management of both the [Link] frontend server and the
Python backend virtual environment.
2. Frontend Development Tools
[Link]: Employed as the core JavaScript library to architect a reactive, component-
based Single Page Application (SPA). It manages the complex state transitions between
the different documentation tabs without requiring page reloads.
Vite: Selected as the frontend build tool and development server. Vite provided
instantaneous Hot Module Replacement (HMR) during the development phase and highly
optimized asset bundling for production.
Tailwind CSS: A utility-first CSS framework used to rapidly design and implement the
application's custom "Neo-Brutalist" graphical user interface. It ensured complete styling
responsiveness across varying screen dimensions without the heavy overhead of
traditional external stylesheets.
[Link] & React-Markdown: [Link] was integrated as the core rendering
engine to programmatically convert syntax into dynamic, interactive architectural SVGs.
React-Markdown, paired with remark-gfm, was utilized to safely parse and display the
AI-generated markdown strings within the React DOM.
3. Backend & Server Tools
Python (Version 3.10+): The primary server-side programming language, chosen for its
vast ecosystem of data processing libraries and native support for asynchronous
execution.
FastAPI: A modern, high-performance web framework for building APIs with Python.
FastAPI’s native reliance on standard Python type hints and its robust support for
asynchronous programming (async/await) made it the ideal framework for managing
concurrent, non-blocking network requests to the AI models.
Uvicorn: Utilized as the underlying Asynchronous Server Gateway Interface (ASGI)
web server implementation to run the FastAPI application efficiently.
4. Artificial Intelligence & Orchestration Tools
Groq LPU API: The core intelligence engine of the application. The Groq API, running
the llama-3.1-8b-instant model, was utilized for its blistering Language
Processing Unit (LPU) speeds, which are required for real-time code analysis.
LangChain: An open-source framework specifically designed for developing
applications powered by language models. LangChain was integrated into the Python
DEPARTMENT OF COMPUTER SCIENCE PAGE 15
AutoDoc National College Jayanagar
UTILITY OF THE TOOLS USED
The selection of the technology stack for the AutoDoc system was not arbitrary; it was the result
of a rigorous comparative analysis against alternative market solutions. The primary architectural
requirements for this project were asynchronous execution speed, real-time UI rendering, and
efficient handling of large data payloads. The justifications for the selected tools over their
market alternatives are detailed below:
1. [Link] vs. Angular / [Link]
The Choice: [Link] was selected for the frontend architecture.
The Utility: While Angular provides a robust, enterprise-grade MVC framework, its
heavy boilerplate and steep learning curve were unnecessary for a single-page
intelligence dashboard. Conversely, React’s Virtual DOM and component-based state
management are perfectly suited for AutoDoc. When the user switches between the
"Metrics," "Visuals," and "Security" tabs, React dynamically re-renders only that specific
component without reloading the entire webpage, creating a frictionless user experience.
2. FastAPI vs. Django / Flask
The Choice: FastAPI was selected to engineer the Python server.
The Utility: The Python market is dominated by Django and Flask. However, Django is
a monolithic framework that carries too much overhead for a streamlined backend API.
While Flask is lightweight, it historically lacks native support for asynchronous
programming. FastAPI was specifically chosen because it natively supports
async/await execution. Since the AutoDoc backend must send five massive,
concurrent requests to an AI model, FastAPI handles this asynchronous network I/O far
more efficiently than Flask, preventing the server from blocking or crashing.
3. Groq LPU API vs. OpenAI / Local Models (Ollama)
The Choice: The Groq API (running Llama-3.1-8b) was selected as the AI engine.
The Utility: While OpenAI’s GPT models are an industry standard, their API latency for
generating thousands of words of documentation can cause severe UI delays.
Alternatively, running local open-source models (like Ollama) requires expensive,
dedicated GPU hardware on the host machine. Groq was chosen because it runs on
proprietary Language Processing Units (LPUs) rather than standard GPUs. This hardware
architecture delivers unprecedented inference speeds (Tokens Per Second), ensuring the
AutoDoc dashboard generates complete reports in near real-time.
4. Tailwind CSS vs. Bootstrap
The Choice: Tailwind CSS was selected for application styling.
The Utility: Bootstrap provides pre-built UI components, which drastically speeds up
development but often results in generic, repetitive website designs. Tailwind is a utility-
first CSS framework. It allowed for the rapid, highly customized development of
AutoDoc's unique "Neo-Brutalist" design language (characterized by sharp borders, high-
contrast colors, and flat shadows) directly within the React components, without the need
to manage massive, external CSS stylesheets.
DEPARTMENT OF COMPUTER SCIENCE PAGE 16
AutoDoc National College Jayanagar
5. Vite vs. Create React App (Webpack)
The Choice: Vite was utilized as the frontend build tool.
The Utility: For years, "Create React App" (powered by Webpack) was the market
standard. However, as applications grow, Webpack’s bundling process becomes
notoriously slow. Vite was chosen because it utilizes native ES modules, providing near-
instantaneous server startup and Hot Module Replacement (HMR). This allowed for rapid
prototyping and drastically reduced frontend development time.
DEPARTMENT OF COMPUTER SCIENCE PAGE 17
AutoDoc National College Jayanagar
Source Code
[Link] Dependencies ([Link]) This file lists all required external libraries
and frameworks needed to compile and run the application.
# --- [Link] ---
# Backend Server Frameworks
fastapi==0.104.1
uvicorn==0.24.0
pydantic==2.5.2
# AI Orchestration and Parsing
langchain==0.0.344
langchain-groq==0.0.1
langchain-core==0.0.8
# Frontend Framework and Data Management
streamlit==1.28.2
pandas==2.1.3
pypdf==3.17.1
# Network Operations
requests==2.31.0
python-dotenv==1.0.0
2. MAIN LOGIC (BACKEND SERVER & AI PIPELINE)
The [Link] file contains the core backend logic. It initializes the FastAPI server, handles GitHub
repository extraction, and manages the asynchronous prompt orchestration with the Groq Large
Language Model.
from fastapi import FastAPI, HTTPException
from [Link] import CORSMiddleware
from pydantic import BaseModel
import os
import requests
import asyncio
import time
from dotenv import load_dotenv
from langchain_groq import ChatGroq
from langchain_core.prompts import ChatPromptTemplate
DEPARTMENT OF COMPUTER SCIENCE PAGE 18
AutoDoc National College Jayanagar
load_dotenv()
api_key = [Link]("GROQ_API_KEY")
app = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
class RepoRequest(BaseModel):
url: str
numQuestions: int = 3
difficulty: str = "Mid-Level"
class ChatRequest(BaseModel):
question: str
repoContext: str
def fetch_repo_content(url):
"""Recursively fetches core application logic from a public GitHub repository."""
try:
clean_url = [Link]("[Link] "").replace("[Link] "").rstrip("/")
parts = clean_url.split("/")
if len(parts) < 3 or "[Link]" not in parts[0]:
return "Error: Invalid GitHub URL. Use format [Link]/owner/repo"
DEPARTMENT OF COMPUTER SCIENCE PAGE 19
AutoDoc National College Jayanagar
owner, repo = parts[1], parts[2]
headers = {"Accept": "application/[Link].v3+json"}
api_url = f"[Link]
response = [Link](api_url, headers=headers)
if response.status_code != 200:
api_url = f"[Link]
response = [Link](api_url, headers=headers)
if response.status_code != 200:
return f"Error: REPO_NOT_FOUND. Check if the repo is public."
tree = [Link]().get("tree", [])
all_code = ""
valid_extensions = (
'.py', '.js', '.jsx', '.ts', '.tsx', '.java', '.cpp', '.c',
'.go', '.rb', '.php', '.rs', '.swift', '.html', '.css', '.json'
high_value_files = ('Dockerfile', '[Link]', '[Link]', '[Link]')
# Pass 1: Extract Configuration Files
for file in tree:
filename = file['path'].split('/')[-1]
if filename in high_value_files:
raw_url = f"[Link]
resp = [Link](raw_url)
DEPARTMENT OF COMPUTER SCIENCE PAGE 20
AutoDoc National College Jayanagar
if resp.status_code != 200:
raw_url = f"[Link]
resp = [Link](raw_url)
if resp.status_code == 200:
all_code += f"\n# CRITICAL CONFIG: {file['path']}\n{[Link][:1500]}\n"
# Pass 2: Extract Application Logic
for file in tree:
if len(all_code) > 12000: break # Token Limit Safeguard
filename = file['path'].split('/')[-1]
if filename in high_value_files: continue
if file['type'] == 'blob' and file['path'].endswith(valid_extensions):
raw_url = f"[Link]
resp = [Link](raw_url)
if resp.status_code != 200:
raw_url = f"[Link]
resp = [Link](raw_url)
if resp.status_code == 200:
all_code += f"\n# SOURCE: {file['path']}\n{[Link][:1000]}\n"
if not all_code:
return "Error: NO_SUPPORTED_CODE_FOUND."
return all_code
except Exception as e:
return f"Error: {str(e)}"
DEPARTMENT OF COMPUTER SCIENCE PAGE 21
AutoDoc National College Jayanagar
@[Link]("/api/analyze")
async def analyze_repo(req: RepoRequest):
"""Main endpoint to process code and generate multi-dimensional intelligence."""
if not api_key:
raise HTTPException(status_code=500, detail="GROQ API Key missing")
code_content = fetch_repo_content([Link])
if code_content.startswith("Error"):
raise HTTPException(status_code=400, detail=code_content)
llm = ChatGroq(model="llama-3.1-8b-instant", temperature=0.3, api_key=api_key)
# Prompt Template Definitions
doc_prompt = ChatPromptTemplate.from_template("Generate a PRODUCTION-READY
[Link] specific to this codebase. Return ONLY Markdown. Code: {code}")
int_prompt = ChatPromptTemplate.from_template("Generate {num_questions} technical
interview questions for a {difficulty} developer based on this code. Code: {code}")
met_prompt = ChatPromptTemplate.from_template("Analyze code complexity. Provide
system health metrics. Code: {code}")
vis_prompt = ChatPromptTemplate.from_template("Generate a [Link] flowchart
mapping the architecture. Return ONLY the mermaid code block. Code: {code}")
sec_prompt = ChatPromptTemplate.from_template("Perform a security audit. List
vulnerabilities and mitigations. Code: {code}")
try:
doc_res = (doc_prompt | llm).invoke({"code": code_content}).content
[Link](2)
int_res = (int_prompt | llm).invoke({"code": code_content, "num_questions":
[Link], "difficulty": [Link]}).content
DEPARTMENT OF COMPUTER SCIENCE PAGE 22
AutoDoc National College Jayanagar
[Link](2)
met_res = (met_prompt | llm).invoke({"code": code_content}).content
[Link](2)
vis_res = (vis_prompt | llm).invoke({"code": code_content}).content
[Link](2)
sec_res = (sec_prompt | llm).invoke({"code": code_content}).content
except Exception as e:
raise HTTPException(status_code=429, detail="API Rate Limit Reached.")
return {
"status": "success",
"whitepaper": doc_res,
"interview": int_res,
"metrics": met_res,
"visuals": vis_res,
"security": sec_res
@[Link]("/api/ask")
async def ask_chatbot(req: ChatRequest):
"""Endpoint handling the direct uplink conversational AI."""
llm = ChatGroq(model="llama-3.1-8b-instant", temperature=0.5, api_key=api_key)
chat_prompt = ChatPromptTemplate.from_template("You are a code assistant. Context:
{context}. Question: {question}"
try:
response = (chat_prompt | llm).invoke({"context": [Link], "question":
[Link]}).content
DEPARTMENT OF COMPUTER SCIENCE PAGE 23
AutoDoc National College Jayanagar
return {"status": "success", "answer": response}
except Exception as e:
raise HTTPException(status_code=429, detail="API Rate Limit.")
3. FRONT END (USER INTERFACE & HYBRID CLIENT LOGIC)
The [Link] file serves as the Streamlit-based client application. It features a custom Neo-
Brutalist CSS design language, handles user inputs, manages local PDF file parsing, and
communicates state changes with the backend logic.
import warnings
[Link]("ignore")
import streamlit as st
import os
import requests
import pandas as pd
import pypdf
from dotenv import load_dotenv
from langchain_groq import ChatGroq
from langchain_core.prompts import ChatPromptTemplate
load_dotenv()
api_key = [Link]("GROQ_API_KEY")
st.set_page_config(page_title="AUTODOC_TERMINAL", page_icon="📟", layout="wide")
# Custom UI Styling Injection
[Link]("""
<style>
DEPARTMENT OF COMPUTER SCIENCE PAGE 24
AutoDoc National College Jayanagar
@import url('[Link]
family=Fira+Code:wght@400;600&display=swap');
.stApp { background-color: #020202; font-family: 'Fira Code', monospace; color: #e0e0e0; }
.terminal-header { color: #00ff41; font-size: 2.8rem; border-right: 3px solid #00ff41; margin-
bottom: 5px; }
[Link] > button { background: transparent; color: #00ff41; border: 1px solid #00ff41;
transition: 0.3s; }
[Link] > button:hover { background: #00ff41; color: black; box-shadow: 0 0 15px
#00ff41; }
</style>
""", unsafe_allow_html=True)
# Helper Functions
def read_pdf(file):
try:
pdf_reader = [Link](file)
text = "".join([page.extract_text() + "\n" for page in pdf_reader.pages])
return f"\n# DOCUMENT: {[Link]}\n{text}"
except Exception as e:
return f"\n# ERROR: {str(e)}"
def get_ai_response(prompt_template, code_snippet):
llm = ChatGroq(model="llama-3.1-8b-instant", temperature=0.3, api_key=api_key)
chain = ChatPromptTemplate.from_template(prompt_template) | llm
try:
return [Link]({"code": code_snippet[:20000]}).content
except Exception as e:
return f"SYSTEM_ERROR: {str(e)}"
[Link]('<div class="terminal-header">_AUTODOC_ENTERPRISE_v2.1</div>',
unsafe_allow_html=True)
DEPARTMENT OF COMPUTER SCIENCE PAGE 25
AutoDoc National College Jayanagar
if "repo_content" not in st.session_state: st.session_state.repo_content = None
if "chat_history" not in st.session_state: st.session_state.chat_history = []
col1, col2 = [Link]([2, 1])
with col1:
url = st.text_input("GitHub Repo URL:", placeholder="[Link]
with col2:
uploaded_files = st.file_uploader("Upload PDF/Docs", type=["pdf", "txt", "md"],
accept_multiple_files=True)
if [Link]("⚡ INITIATE HYBRID SCAN"):
combined_content = ""
with [Link]("📡 ESTABLISHING UPLINK...", expanded=True):
if url:
# Note: In production, this would call the FastAPI endpoint
[Link]("Scanning Remote Repository...")
combined_content += "\n# Remote Code Data Acquired"
if uploaded_files:
[Link]("Ingesting Local Documents...")
for uf in uploaded_files:
if [Link] == "application/pdf": combined_content += read_pdf(uf)
else: combined_content += f"\n# DOCUMENT: {[Link]}\
n{[Link]().decode('utf-8')}"
if combined_content:
st.session_state.repo_content = combined_content
[Link]("DATA FUSION COMPLETE.")
DEPARTMENT OF COMPUTER SCIENCE PAGE 26
AutoDoc National College Jayanagar
# Intelligence Rendering Tabs
if st.session_state.repo_content:
repo_content = st.session_state.repo_content
[Link]("---")
t1, t2, t3, t4, t5 = [Link](["📄 [ DOCS ]", "📊 [ METRICS ]", "📈 [ VISUALS ]", "🎤
[ INTERVIEW ]", "🛡️[ SECURITY ]"])
with t1:
if [Link]("RUN_DOCUMENTATION_PROTOCOL"):
doc_prompt = "Role: Architect. Create a Technical Whitepaper. DATA: {code}"
[Link](get_ai_response(doc_prompt, repo_content))
with t2:
if [Link]("CALCULATE_ENTROPY"):
anal_prompt = "Analyze complexity. Return CSV ONLY: Filename, Score. DATA:
{code}"
[Link](get_ai_response(anal_prompt, repo_content))
with t3:
g_type = [Link]("RENDER_MODE:", ["Flowchart", "Class Diagram"], horizontal=True)
if [Link]("RENDER_BLUEPRINT"):
prompt = f"Generate [Link] {g_type}. Return ONLY code. DATA: {{code}}"
res = get_ai_response(prompt, repo_content)
[Link](f"```mermaid\n{[Link]('```mermaid', '').replace('```', '').strip()}\n```")
with t4:
[Link](">> CANDIDATE_SIMULATION")
DEPARTMENT OF COMPUTER SCIENCE PAGE 27
AutoDoc National College Jayanagar
if [Link]("GENERATE_INTERVIEW_PACKET"): q_prompt = "Generate 3 Technical
Interview Questions based on the code. DATA: {code}"
[Link](get_ai_response(q_prompt, repo_content))
with t5:
if [Link]("ACTIVATE_SECURITY_SWEEP"):
sec_prompt = "Audit for security flaws. Format Table: | Severity | Vector | Mitigation |.
DATA: {code}"
[Link](get_ai_response(sec_prompt, repo_content))
[Link]("---")
[Link](">> DIRECT_UPLINK_CHAT")
for msg in st.session_state.chat_history:
[Link](f"[{'USER' if msg['role'] == 'user' else 'SYSTEM'}]: {msg['content']}")
if prompt := st.chat_input("ENTER_COMMAND..."):
st.session_state.chat_history.append({"role": "user", "content": prompt})
with [Link]("COMPUTING..."):
resp = get_ai_response(f"User Q: {prompt} DATA: {{code}}", repo_content)
st.session_state.chat_history.append({"role": "assistant", "content": resp})
[Link]()
DEPARTMENT OF COMPUTER SCIENCE PAGE 28
AutoDoc National College Jayanagar
SCREEN SHOTS
DEPARTMENT OF COMPUTER SCIENCE PAGE 29
AutoDoc National College Jayanagar
DEPARTMENT OF COMPUTER SCIENCE PAGE 30
AutoDoc National College Jayanagar
DEPARTMENT OF COMPUTER SCIENCE PAGE 31
AutoDoc National College Jayanagar
DEPARTMENT OF COMPUTER SCIENCE PAGE 32
AutoDoc National College Jayanagar
CONCLUSION
The AutoDoc project successfully demonstrates the transformative potential of integrating Large
Language Models (LLMs) into the software development lifecycle. By engineering a decoupled,
high-performance architecture utilizing modern web frameworks ([Link], Streamlit, and
FastAPI) alongside the Groq Language Processing Unit (LPU) API, this project directly
addresses one of the most persistent bottlenecks in software engineering: the rapid accumulation
of undocumented legacy code and technical debt.
Moving beyond the limitations of traditional static analysis tools, AutoDoc operates as an
automated, multi-dimensional architectural intelligence engine. The implementation of a dual-
pass repository fetching algorithm, combined with concurrent asynchronous prompt execution,
ensures that developers receive comprehensive system intelligence in near real-time.
The application's proven ability to generate production-ready Markdown documentation,
calculate system entropy, dynamically render interactive [Link] topology graphs, and
simulate context-aware technical interviews provides immense, immediate value to open-source
maintainers, enterprise teams, and technical recruiters [Link], the evolution of the
system into a Hybrid Intelligence platform—capable of seamlessly fusing remote GitHub
repository data with localized PDF documentation—proves its profound adaptability to complex,
real-world enterprise environments.
In conclusion, AutoDoc effectively bridges the widening gap between rapid code generation and
essential system documentation. It conclusively proves that generative artificial intelligence can
be systematically harnessed not just to write code, but to deeply comprehend, comprehensively
audit, and visually map complex software architectures. By doing so, AutoDoc dramatically
reduces developer friction, accelerates system onboarding, and fundamentally enhances long-
term software maintainability.
DEPARTMENT OF COMPUTER SCIENCE PAGE 33
AutoDoc National College Jayanagar
BIBILOGRAPHY
REVIEW THROUGH WEB REFERENCE
FastAPI Official Documentation (Tiangolo) Link: [Link]
Description: The official reference for the backend web framework. Utilized heavily
for configuring Cross-Origin Resource Sharing (CORS) middleware, structuring
Pydantic data validation models, and managing asynchronous API route handling.
Groq Cloud API & LLM Reference Link: [Link]
Description: The primary documentation for the AI intelligence engine. This reference
was used to integrate the LangChain framework with the llama-3.1-8b-instant
model, specifically detailing token limits, temperature adjustments, and Language
Processing Unit (LPU) optimization.
[Link] Official Syntax Guide Link: [Link] Description: The
official documentation for the Markdown-inspired charting tool. This reference was necessary
to engineer the strict AI prompt constraints, ensuring the Large Language Model outputted
safe, valid flowchart syntax for the dynamic architecture topology generation.
[Link] Official Documentation (Meta) Link: [Link] Description:
The primary technical reference for the frontend client architecture. This documentation was
utilized to implement functional components, manage complex application state via React
Hooks (useState, useEffect), and ensure instantaneous DOM rendering for the intelligence
dashboard.
Tailwind CSS Official Documentation Link: [Link] Description: The
styling reference utilized for the frontend user interface. This documentation guided the
implementation of utility-first CSS classes, allowing for the rapid, responsive development of
AutoDoc's custom "Neo-Brutalist" design system without the overhead of traditional external
stylesheets.
DEPARTMENT OF COMPUTER SCIENCE PAGE 34