codewiki

DeepDoc Architecture & System Overview

DeepDoc auto-generates deep, navigable engineering documentation from real codebases using a multi-phase, evidence-driven pipeline. This is the canonical starting point for understanding how DeepDoc works, how the pieces fit together, and how to get productive as a developer or contributor.

What This Does

DeepDoc is an AI-powered documentation generator that scans your repository, analyzes code and configuration, and produces a structured, cross-linked documentation site using Fumadocs and MDX. It supports Python, JavaScript, TypeScript, Go, PHP, and Vue projects, and is designed to create maintainable, developer-focused docs that reflect the true structure and logic of your codebase.

DeepDoc is used by engineering teams who want reliable, up-to-date, and deeply cross-referenced documentation for complex systems, APIs, integrations, and data models—without the manual toil.


Architecture Overview

At a high level, DeepDoc operates as a multi-phase pipeline that transforms source code into a rich, navigable documentation site. The core phases are: Scan → Plan → Generate → Build → Serve/Deploy.

Key Components (see sitemap for deep dives):


End-to-End Runtime Flow

The main lifecycle from source code to published docs is as follows:

Alternate flows:

  • deepdoc update only regenerates pages affected by code changes.
  • deepdoc serve launches a local preview with live reload.
  • deepdoc deploy exports a static site for hosting.

Major Subsystems

SubsystemDescriptionKey Files/ModulesDeep Dive
Repo ScanningParses code, detects endpoints, config, integrationsdeepdoc/planner_v2.py, deepdoc/parser/*Parsing & Source Analysis
PlanningClassifies, proposes, and assigns documentation bucketsdeepdoc/planner_v2.pyPipeline & Generation Engine
Evidence Assembly & GenerationGathers context, generates pages with LLM, validates outputdeepdoc/generator_v2.py, deepdoc/prompts_v2.pyPipeline & Generation Engine
Site BuilderBuilds Fumadocs site, navigation, assets, and frontenddeepdoc/site/fumadocs_builder_v2.pySite Generation & Frontend Integration Overview
IntegrationsHandles OpenAPI, webhooks, chatbot, external APIsdeepdoc/prompts_v2.py, deepdoc/planner_v2.py, deepdoc/site/fumadocs_builder_v2.pyIntegration Pages
Database & Data LayerDocuments models, schema, migrationsdeepdoc/scan_v2.pyDatabase Models & Schema

Key Files To Know First

File PathRoleSummary
deepdoc/planner_v2.pyPlanning engineScans repo, classifies files, plans documentation buckets (system, feature, endpoint, integration, db)
deepdoc/generator_v2.pyGeneration engineAssembles evidence, generates MDX pages with LLM, validates output
deepdoc/site/fumadocs_builder_v2.pySite builderBuilds Fumadocs site, navigation, assets, and frontend integration
deepdoc/prompts_v2.pyPrompt templatesDefines page templates, section outlines, and LLM prompt logic
README.mdProject docsHigh-level project description, install, and usage instructions
deepdoc/parser/*Source parsersLanguage-specific parsing for Python, JS/TS, Go, PHP, Vue
deepdoc/cli.pyCLI entrypointHandles all CLI commands (init, generate, update, serve, etc.)
deepdoc/config.pyConfigLoads and validates .deepdoc.yaml and runtime config
.github/workflows/*.ymlCI/CDDefines test, release, and deployment workflows
pyproject.tomlPython configProject metadata, dependencies, and build settings
tests/fixtures/frameworks/*Test appsExample projects for framework detection and parsing validation

Tech Stack

  • Languages: Python, JavaScript, TypeScript, Go, PHP, Vue
  • Frameworks Detected: Django, Echo, Express, Falcon, FastAPI, Fastify, Fiber, Flask, Gin, Laravel, NestJS, Next.js, Nuxt, Vue
  • Frontend: Fumadocs UI, Next.js, Tailwind CSS, MDX, Mermaid
  • Search: Orama (local, fast full-text search)
  • LLM Providers: Anthropic, OpenAI, Azure OpenAI, Ollama (via LiteLLM)
  • CI/CD: GitHub Actions (.github/workflows/)
  • Deployment: Static export via Next.js (site/out/), any static host
  • Integrations: OpenAPI/Swagger, webhooks, chatbot, external APIs (see Integration Pages)

Project Structure

DirectoryPurposeDocs Page
deepdoc/Core engine: scanning, planning, generation, site buildPipeline & Generation Engine
deepdoc/parser/Language-specific source code parsersParsing & Source Analysis
deepdoc/site/Fumadocs site builder, frontend assets, layoutsSite Generation & Frontend Integration Overview
deepdoc/chatbot/Chatbot, embedding, and search integrationsRuntime Services & Chatbot Engine
tests/Test suite, framework fixtures, CLI testsTesting & Continuous Integration
.github/CI/CD workflowsTesting & Continuous Integration
docs/Generated documentation output (by DeepDoc)(this site)

Data, State, And Integrations


Key Concepts And Gotchas


Getting Started

Install DeepDoc

pip install deepdoc
git clone https://github.com/tss-pranavkumar/deepdoc.git
cd deepdoc
pip install -e .

Initialize in your project Run:

deepdoc init

This creates a .deepdoc.yaml config file.

Set your LLM API key Export your API key (Anthropic, OpenAI, etc.):

export ANTHROPIC_API_KEY=sk-ant-...

Generate documentation

deepdoc generate

This scans your repo, plans docs, and generates MDX pages.

Preview locally

deepdoc serve

Open http://localhost:3000 to view the docs site.

Next steps


How To Read This Docs Set


Explore the Docs


For a full sitemap and cross-links, see the navigation panel or the Setup & Getting Started page.

Ask the codebase

Open a dedicated answer page with grounded citations.

Ask from any docs page and keep reading without losing context.