# run-llama/create-llama architecture

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

- Interactive diagram: https://gitdiagram.com/run-llama/create-llama
- Repository: https://github.com/run-llama/create-llama

## Overview

##### Main Components

a. CLI Interface Layer
- Entry point (index.ts)
- Question handling system (questions directory)
- Project generation logic (create-app.ts)

b. Template System
- Multiple application templates (templates directory)
- Component templates
- Configuration templates

c. Helper Systems
- Provider integrations (helpers/providers)
- Environment setup (helpers/env-variables.ts)
- Package management (helpers/get-pkg-manager.ts)
- Installation utilities (helpers/install.ts)

d. Generated Application Architecture
- Frontend options (Next.js)
- Backend options (FastAPI/Express)
- Vector store integrations
- LLM integrations

**┌─ CLI Layer ─────────────────────┐**
- Command Processing            │
- Interactive Prompts           │
- Configuration Management      │
- ┬────────────────┘
- ↓
**┌─ Project Generation Engine ─────┐**
- ┌─ Template Manager ──────────┐ │
- Use Case Templates        │ │
- Framework Templates       │ │
- Component Templates       │ │

- ┌─ Helper System ────────────┐ │
- Provider Integration     │ │
- Environment Setup        │ │
- Dependency Management    │ │

- ┬────────────────┘
- ↓
**┌─ Generated Application ─────────┐**
- ┌─ Frontend (Next.js) ───────┐ │
- Chat Interface           │ │
- File Upload             │ │
- API Integration         │ │
- ┬────────────┘ │
- ┌─ Backend ────┴────────────┐ │
- FastAPI or Express      │ │
- LlamaIndex Integration  │ │
- Vector Store           │ │
- LLM Services           │ │
- ┘ │
- ┘

##### Important Relationships

- Bidirectional flow between CLI and Project Generation Engine
- Template selection flow
- Configuration inheritance
- Service integration paths
- Data flow in generated applications

##### Additional Elements

- Version compatibility information
- Supported integration points

##### Technical Details to Highlight

- Support for multiple LLM providers
- Vector store options
- Available tools and integrations
- Observability options
- Data source connections

##### Implementation Notes

- Use standard UML notation where appropriate
- Clear component boundaries
- Both synchronous and asynchronous connections
- Scalability points
- Security boundaries

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and classes
    classDef cli fill:#3498db,stroke:#2980b9,color:white
    classDef template fill:#2ecc71,stroke:#27ae60,color:white
    classDef helper fill:#f1c40f,stroke:#f39c12,color:black
    classDef generated fill:#9b59b6,stroke:#8e44ad,color:white
    classDef integration fill:#e74c3c,stroke:#c0392b,color:white

    %% CLI Layer
    subgraph CLI
        EntryPoint["Entry Point"]:::cli
        Questions["Question Handler"]:::cli
        ProjectGen["Project Generator"]:::cli
    end

    %% Template System
    subgraph Templates
        AppTemplates["Application Templates"]:::template
        CompTemplates["Component Templates"]:::template
        ConfigTemplates["Configuration Templates"]:::template
    end

    %% Helper System
    subgraph Helpers
        Providers["Provider Integrations"]:::helper
        EnvSetup["Environment Setup"]:::helper
        PkgManager["Package Manager"]:::helper
        InstallUtils["Installation Utilities"]:::helper
    end

    %% Generated Application
    subgraph Generated
        Frontend["Frontend (Next.js)"]:::generated
        Backend["Backend (FastAPI/Express)"]:::generated
        
        subgraph Integrations
            VectorStore["Vector Store"]:::integration
            LLMService["LLM Services"]:::integration
            DataLoaders["Data Loaders"]:::integration
            Observability["Observability"]:::integration
            MultiAgent["Multi-agent System"]:::integration
            UIComponents["UI Components"]:::integration
        end
    end

    %% Relationships
    EntryPoint --> Questions
    Questions --> ProjectGen
    ProjectGen --> Templates
    Templates --> Generated
    Helpers --> ProjectGen
    Helpers --> Generated

    %% Click events
    click EntryPoint "https://github.com/run-llama/create-llama/blob/main/index.ts"
    click Questions "https://github.com/run-llama/create-llama/tree/main/questions/"
    click ProjectGen "https://github.com/run-llama/create-llama/blob/main/create-app.ts"
    click AppTemplates "https://github.com/run-llama/create-llama/tree/main/templates/types/"
    click CompTemplates "https://github.com/run-llama/create-llama/tree/main/templates/components/"
    click ConfigTemplates "https://github.com/run-llama/create-llama/tree/main/templates/components/settings/"
    click Providers "https://github.com/run-llama/create-llama/tree/main/helpers/providers/"
    click EnvSetup "https://github.com/run-llama/create-llama/blob/main/helpers/env-variables.ts"
    click PkgManager "https://github.com/run-llama/create-llama/blob/main/helpers/get-pkg-manager.ts"
    click InstallUtils "https://github.com/run-llama/create-llama/blob/main/helpers/install.ts"
    click Frontend "https://github.com/run-llama/create-llama/tree/main/templates/types/streaming/nextjs/"
    click Backend "https://github.com/run-llama/create-llama/tree/main/templates/types/streaming/fastapi/"
    click VectorStore "https://github.com/run-llama/create-llama/tree/main/templates/components/vectordbs/"
    click Observability "https://github.com/run-llama/create-llama/tree/main/templates/components/observability/"
    click MultiAgent "https://github.com/run-llama/create-llama/tree/main/templates/components/multiagent/"
    click UIComponents "https://github.com/run-llama/create-llama/tree/main/templates/components/ui/"
    click DataLoaders "https://github.com/run-llama/create-llama/tree/main/templates/components/loaders/"

    %% Legend
    subgraph Legend
        CLI_L["CLI Components"]:::cli
        TEMP_L["Template Components"]:::template
        HELP_L["Helper Components"]:::helper
        GEN_L["Generated Components"]:::generated
        INT_L["Integrations"]:::integration
    end
```
