# nojhan/liquidprompt architecture

> Architecture diagram of the GitHub repository nojhan/liquidprompt, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nojhan/liquidprompt
- Repository: https://github.com/nojhan/liquidprompt

## Overview

##### Main Components

a) Core Components:
- Prompt Engine (liquidprompt main script)
- Theme System
- Configuration System
- Shell Integration Layer (Bash/Zsh)

b) Supporting Components:
- Data Collectors (VCS, system stats, environment info)
- Utility Functions
- Testing Framework
- Documentation System

##### Component Relationships

**User Shell Environment**
- ↑
- Shell Integration
- ↑
- Prompt Engine
- ↗     ↑    ↖
**Themes Config Data**
- ↑
- System Sources

##### Specific Implementation Details

a) Core Processing Flow:
- How the prompt engine (liquidprompt) processes configuration
- Theme application
- Demonstrate data collection from various system sources

b) Integration Points:
- Shell hooks (bash/zsh integration)
- VCS integration
- System monitoring interfaces

##### Key Elements to Emphasize

- The modular theme system (themes directory)
- Configuration management (contrib/presets)
- Testing infrastructure (tests directory)
- Documentation system (docs directory)

##### Architectural Patterns to Highlight

- Plugin architecture (themes and presets)
- Event-driven design (shell integration)
- Modular data collection
- Configuration inheritance

##### Implementation Notes

- Clear separation between core functionality and themes
- Configuration override paths
- Data collection modularity
- Test coverage paths

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Shell["User Shell Environment"]
        Bash["Bash Shell"]
        Zsh["Zsh Shell"]
    end

    subgraph Integration["Shell Integration Layer"]
        BashInt["Bash Integration"]:::integration
        ZshInt["Zsh Integration"]:::integration
    end

    subgraph Core["Core Processing"]
        PE["Prompt Engine"]:::core
        TS["Theme System"]:::core
        CS["Configuration System"]:::config
    end

    subgraph DataCollection["Data Collection Layer"]
        VCS["Version Control"]:::data
        SysStat["System Statistics"]:::data
        EnvInfo["Environment Info"]:::data
    end

    subgraph Testing["Testing & Tools"]
        TestFW["Test Framework"]:::test
        Tools["Utility Tools"]:::tools
    end

    subgraph Documentation["Documentation"]
        Docs["Documentation System"]:::docs
        ConfigDocs["Configuration Docs"]:::docs
        ThemeDocs["Theme Docs"]:::docs
    end

    Bash --> BashInt
    Zsh --> ZshInt
    BashInt --> PE
    ZshInt --> PE
    PE --> TS
    PE --> CS
    TS --> PE
    CS --> PE
    VCS --> PE
    SysStat --> PE
    EnvInfo --> PE
    TestFW --> PE
    Tools --> PE

    classDef core fill:#3498db
    classDef integration fill:#9b59b6
    classDef config fill:#e67e22
    classDef data fill:#2ecc71
    classDef test fill:#95a5a6
    classDef tools fill:#34495e
    classDef docs fill:#7f8c8d

    click PE "https://github.com/nojhan/liquidprompt/tree/master/liquidprompt"
    click TS "https://github.com/nojhan/liquidprompt/tree/master/themes/"
    click CS "https://github.com/nojhan/liquidprompt/tree/master/contrib/presets/"
    click BashInt "https://github.com/nojhan/liquidprompt/tree/master/liquidprompt"
    click ZshInt "https://github.com/nojhan/liquidprompt/blob/master/liquidprompt.plugin.zsh"
    click VCS "https://github.com/nojhan/liquidprompt/blob/master/docs/functions/data/vcs.rst"
    click TestFW "https://github.com/nojhan/liquidprompt/blob/master/tests.sh"
    click Tools "https://github.com/nojhan/liquidprompt/tree/master/tools/"
    click Docs "https://github.com/nojhan/liquidprompt/tree/master/docs/"
    click ConfigDocs "https://github.com/nojhan/liquidprompt/blob/master/docs/config.rst"
    click ThemeDocs "https://github.com/nojhan/liquidprompt/blob/master/docs/theme.rst"
```
