# cartographai/quickwiki architecture

> Architecture diagram of the GitHub repository cartographai/quickwiki, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cartographai/quickwiki
- Repository: https://github.com/cartographai/quickwiki

## Overview

##### Project type and purpose
- This is an open-source CLI tool (“npx quickwiki-ai”) written in TypeScript/Node.js.

##### File structure
- Top-level files: package.json, tsconfig.json, jest.config.js, verify-installation script.
- Key directories:
- src/ – all application code
– index.ts: CLI entry point
– services/: core modules (orchestrator, repositoryScanner, documentationGenerator, geminiService)
– models/: shared type definitions
– utils/: cross-cutting concerns (error handling)
– tests/: unit tests for services
- docs/: design documents and specs
- wiki/: generated documentation output

##### README for additional insights
- Three-step pipeline:
1) explore codebase (repositoryScanner)
2) generate documentation structure (orchestrator)
- External dependency: Google Gemini API

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Core Pipeline
    CLI["CLI Interface\n(src/index.ts)"]:::internal
    ORC["Orchestrator Service\n(src/services/orchestrator.ts)"]:::internal
    SCAN["Repository Scanner\n(src/services/repositoryScanner.ts)"]:::internal
    DOC["Documentation Generator\n(src/services/documentationGenerator.ts)"]:::internal
    GEMINI_SVC["Gemini Service\n(src/services/geminiService.ts)"]:::internal
    API["Google Gemini API"]:::external
    FS["File System\n(wiki/)"]:::infra

    %% Utilities and Config
    subgraph "Supporting Modules"
        ERR["Error Handling / Logging\n(src/utils/errorHandling.ts)"]:::util
        CFG["Configuration\n(tsconfig.json / package.json)"]:::util
        MODELS["Shared Types\n(src/models/types.ts)"]:::util
    end

    %% Documentation and Tests
    subgraph "Docs & Tests"
        SPECS["Design Docs\n(docs/technical-spec.md)"]:::docs
        TEST1["DocGen Tests\n(src/tests/documentationGenerator.test.ts)"]:::tests
        TEST2["Scanner Tests\n(src/tests/repositoryScanner.test.ts)"]:::tests
    end

    %% Flow
    CLI -->|"invoke"| ORC
    ORC -->|"scan repo"| SCAN
    SCAN -->|"metadata"| ORC
    ORC -->|"build structure"| DOC
    DOC -->|"request docs"| GEMINI_SVC
    GEMINI_SVC -->|"call API"| API
    API -->|"response markdown & diagrams"| GEMINI_SVC
    GEMINI_SVC -->|"deliver content"| DOC
    DOC -->|"write files"| FS

    %% Error handling flow
    CLI -->|errors| ERR
    ORC -->|errors| ERR
    SCAN -->|errors| ERR
    DOC -->|errors| ERR
    GEMINI_SVC -->|errors| ERR

    %% Config & Models usage
    CLI --> CFG
    ORC --> CFG
    SCAN --> MODELS
    DOC --> MODELS
    GEMINI_SVC --> MODELS

    %% Tests and Specs references
    SCAN --> TEST2
    DOC --> TEST1
    CLI --> SPECS

    %% Click events
    click CLI "https://github.com/cartographai/quickwiki/blob/master/src/index.ts"
    click ORC "https://github.com/cartographai/quickwiki/blob/master/src/services/orchestrator.ts"
    click SCAN "https://github.com/cartographai/quickwiki/blob/master/src/services/repositoryScanner.ts"
    click DOC "https://github.com/cartographai/quickwiki/blob/master/src/services/documentationGenerator.ts"
    click GEMINI_SVC "https://github.com/cartographai/quickwiki/blob/master/src/services/geminiService.ts"
    click ERR "https://github.com/cartographai/quickwiki/blob/master/src/utils/errorHandling.ts"
    click MODELS "https://github.com/cartographai/quickwiki/blob/master/src/models/types.ts"
    click TEST1 "https://github.com/cartographai/quickwiki/blob/master/src/tests/documentationGenerator.test.ts"
    click TEST2 "https://github.com/cartographai/quickwiki/blob/master/src/tests/repositoryScanner.test.ts"
    click FS "https://github.com/cartographai/quickwiki/tree/master/wiki/"
    click SPECS "https://github.com/cartographai/quickwiki/blob/master/docs/technical-spec.md"
    click CFG "https://github.com/cartographai/quickwiki/blob/master/tsconfig.json"
    click CFG "https://github.com/cartographai/quickwiki/blob/master/package.json"

    %% Styles
    classDef internal fill:#cce5ff,stroke:#339,stroke-width:1px
    classDef external fill:#ffddcc,stroke:#993300,stroke-width:1px
    classDef infra fill:#ccffcc,stroke:#366633,stroke-width:1px
    classDef util fill:#e5ccff,stroke:#663399,stroke-width:1px
    classDef docs fill:#f2f2f2,stroke:#999999,stroke-width:1px
    classDef tests fill:#f9e5ff,stroke:#993366,stroke-width:1px
```
