Skip to content

Latest commit

 

History

History
138 lines (106 loc) · 6.15 KB

README.md

File metadata and controls

138 lines (106 loc) · 6.15 KB

CodeWiki

CodeWiki is an AI-assisted documentation generator for software repositories. It analyzes source code across supported languages, builds dependency relationships, clusters components into logical modules, and uses LLM-backed agents to produce hierarchical Markdown documentation. It provides both a terminal workflow and a web application workflow for generating, viewing, caching, and optionally publishing documentation.

Repository: flamingo-stack/CodeWiki

End-to-End Architecture

flowchart TD
    User["Developer or Documentation User"] --> Entry["CLI or Web Application"]

    Entry --> CliCore["CLI Core"]
    Entry --> FrontendCore["Frontend Core"]

    CliCore --> ConfigCore["Config Core"]
    FrontendCore --> ConfigCore

    CliCore --> BackendCore["Backend Core"]
    FrontendCore --> BackendCore

    ConfigCore --> BackendCore

    BackendCore --> Analysis["Dependency Analysis"]
    Analysis --> Graph["Repository Components and Dependency Graph"]
    Graph --> Clustering["Module Clustering"]
    Clustering --> Agents["Agent Orchestration and Editing Tools"]
    Agents --> Markdown["Hierarchical Markdown Documentation"]

    CliCore --> Html["Static HTML Viewer"]
    CliCore --> GitOps["Git Branch and Commit Operations"]

    Markdown --> Html
    FrontendCore --> Cache["Job Status and Documentation Cache"]
    Markdown --> Cache
Loading

Generation Lifecycle

sequenceDiagram
    participant User as "User"
    participant Entry as "CLI or Web Entry Point"
    participant Config as "Config Core"
    participant Backend as "DocumentationGenerator"
    participant Analysis as "Dependency Analysis"
    participant Agent as "Documentation Agent"
    participant Output as "Documentation Output"

    User->>Entry: Submit repository and generation settings
    Entry->>Config: Build runtime configuration
    Entry->>Backend: Start documentation generation
    Backend->>Analysis: Build dependency graph
    Analysis-->>Backend: Components and relationships
    Backend->>Backend: Cluster components into modules
    Backend->>Agent: Generate leaf module documentation
    Agent->>Output: Write validated Markdown
    Backend->>Output: Create parent overviews and metadata
    Output-->>Entry: Generated documentation tree
    Entry-->>User: Serve, render, or publish documentation
Loading

Repository Structure

CodeWiki/
├── codewiki/
│   ├── cli/                 CLI configuration, generation, HTML, and Git workflows
│   └── src/
│       ├── be/              Backend analysis, orchestration, and documentation engine
│       ├── fe/              FastAPI web application and background job processing
│       └── config.py        Shared runtime configuration
├── test-multi-path/         Multi-source-path dependency analysis fixtures and tests
└── test_clustering/         Module clustering diagnostic and validation tests

Core Modules

Module Location Responsibility Documentation
CLI Core codewiki/cli Provides the terminal-facing workflow, persistent configuration, generation-job tracking, progress reporting, HTML generation, and Git operations. CLI Core
Backend Core codewiki/src/be Implements repository analysis, dependency graph construction, module clustering, agent orchestration, and Markdown generation. Backend Core
Frontend Core codewiki/src/fe Provides the web-facing application for repository submission, asynchronous processing, status tracking, caching, and documentation delivery. Frontend Core
Config Core codewiki/src/config.py Defines the shared Config runtime object for paths, LLM providers, generation limits, source roots, and agent instructions. Config Core
Test Multi Path Core test-multi-path Validates analysis across a primary repository and additional source directories. Test Multi Path Core
Test Clustering Core test_clustering Validates live and offline module-clustering behavior, ID normalization, and response validation. Test Clustering Core

Module Relationships

flowchart LR
    Cli["CLI Core"] --> Config["Config Core"]
    Web["Frontend Core"] --> Config
    Config --> Backend["Backend Core"]

    Backend --> Analysis["Dependency Analysis"]
    Backend --> Agents["Agent Orchestration"]
    Backend --> Docs["Documentation Generation"]

    MultiPathTests["Test Multi Path Core"] --> Config
    MultiPathTests --> Analysis

    ClusteringTests["Test Clustering Core"] --> Config
    ClusteringTests --> Backend
Loading

Documentation References

CLI Core

Backend Core

Frontend Core

Test Modules