# dmick92/create-zcrm-widget architecture

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

- Interactive diagram: https://gitdiagram.com/dmick92/create-zcrm-widget
- Repository: https://github.com/dmick92/create-zcrm-widget

## Overview

##### Main Components

a. CLI Interface Layer
- Entry point (src/cli/index.ts)
- User interaction components
- Command processing

b. Core Scaffolding Engine
- Project creation system
- Template management
- Configuration handlers

c. Template System
- React template structure
- Vue template structure
- Base configurations
- Extra configurations

d. Utility Services
- Package management
- Git operations
- Dependency installation
- Logger system

**┌─────────────────────┐**
- CLI Interface    │
- ┘
- ↓
**┌─────────────────────┐**
- Scaffolding Engine │
- ┘
- ↓
**┌─────────────────────┐**
- Template System   │
- ┘

##### Detailed Component Breakdown

For each major component, create a sub-section showing:

a. CLI Interface:
- Command parser
- User prompt system
- Version management
- Error handling

b. Scaffolding Engine:
- Project creator
- Dependency installer
- Configuration generator
- Import alias setter

c. Template System:
- Base templates (React/Vue)
- Extra configurations
- CI/CD templates
- Style configurations

##### Important Elements to Highlight

- Template selection process
- Package manager detection
- Git initialization
- Dependency installation flow
- Configuration customization

##### Technical Details

- Node.js runtime environment
- Package manager compatibility (npm, yarn)
- Framework options (React/Vue)
- Configuration systems (ESLint, Prettier, TypeScript)

##### Specific Implementation Notes

- getUserPkgManager
- createProject
- scaffoldProject
- installDependencies
- setImportAlias

- Blue: Core CLI components
- Green: Template system
- Orange: Utility functions
- Purple: External integrations

Keep the abstraction level high enough to understand the overall architecture but detailed enough to show the important interactions between components. Focus on showing how the system flows from user input through to final project generation.

Remember to include error handling paths and validation steps in the flow, as these are crucial parts of the CLI tool's operation.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph CLI["CLI Interface Layer"]
        CLI_ENTRY["Entry Point"]
        CLI_INPUT["User Input Processing"]
        CLI_VERSION["Version Management"]
        CLI_VALIDATE["Input Validation"]
        CLI_DISPLAY["CLI Display"]
    end

    subgraph CORE["Core Scaffolding Engine"]
        CREATOR["Project Creator"]
        SCAFFOLD["Project Scaffolder"]
        DEP_INSTALL["Dependency Installer"]
        ALIAS["Import Alias Setup"]
    end

    subgraph TEMPLATES["Template System"]
        REACT["React Template"]
        VUE["Vue Template"]
        EXTRA["Extra Configurations"]
        CICD["CI/CD Templates"]
        STYLES["Style Configurations"]
    end

    subgraph UTILS["Utility Services"]
        PKG_MGR["Package Manager Detection"]
        GIT_OPS["Git Operations"]
        LOGGER["Logger System"]
        DEP_MGR["Dependency Management"]
        PKG_INSTALL["Package Installation"]
    end

    subgraph INSTALLERS["Installer Modules"]
        MAIN_INSTALL["Main Installer"]
        ESLINT["ESLint Setup"]
        TAILWIND["Tailwind Setup"]
    end

    CLI --> CORE
    CORE --> TEMPLATES
    CORE --> UTILS
    CORE --> INSTALLERS

    %% Click events for component mapping
    click CLI_ENTRY "https://github.com/dmick92/create-zcrm-widget/blob/main/src/cli/index.ts"
    click CLI_INPUT "https://github.com/dmick92/create-zcrm-widget/blob/main/src/utils/parseNameAndPath.ts"
    click CLI_VERSION "https://github.com/dmick92/create-zcrm-widget/blob/main/src/utils/getVersion.ts"
    click CLI_VALIDATE "https://github.com/dmick92/create-zcrm-widget/blob/main/src/utils/validateAppName.ts"
    click CLI_DISPLAY "https://github.com/dmick92/create-zcrm-widget/blob/main/src/utils/renderTitle.ts"
    
    click CREATOR "https://github.com/dmick92/create-zcrm-widget/blob/main/src/helpers/createProject.ts"
    click SCAFFOLD "https://github.com/dmick92/create-zcrm-widget/blob/main/src/helpers/scaffoldProject.ts"
    click DEP_INSTALL "https://github.com/dmick92/create-zcrm-widget/blob/main/src/helpers/installDependencies.ts"
    click ALIAS "https://github.com/dmick92/create-zcrm-widget/blob/main/src/helpers/setImportAlias.ts"
    
    click REACT "https://github.com/dmick92/create-zcrm-widget/tree/main/template/base/react"
    click VUE "https://github.com/dmick92/create-zcrm-widget/tree/main/template/base/vue"
    click EXTRA "https://github.com/dmick92/create-zcrm-widget/tree/main/template/extras"
    click CICD "https://github.com/dmick92/create-zcrm-widget/tree/main/template/extras/ci"
    click STYLES "https://github.com/dmick92/create-zcrm-widget/tree/main/template/extras/src/styles"
    
    click PKG_MGR "https://github.com/dmick92/create-zcrm-widget/blob/main/src/utils/getUserPkgManager.ts"
    click GIT_OPS "https://github.com/dmick92/create-zcrm-widget/blob/main/src/helpers/git.ts"
    click LOGGER "https://github.com/dmick92/create-zcrm-widget/blob/main/src/utils/logger.ts"
    click DEP_MGR "https://github.com/dmick92/create-zcrm-widget/blob/main/src/installers/dependencyVersionMap.ts"
    click PKG_INSTALL "https://github.com/dmick92/create-zcrm-widget/blob/main/src/helpers/installPackages.ts"
    
    click MAIN_INSTALL "https://github.com/dmick92/create-zcrm-widget/blob/main/src/installers/index.ts"
    click ESLINT "https://github.com/dmick92/create-zcrm-widget/blob/main/src/installers/eslint.ts"
    click TAILWIND "https://github.com/dmick92/create-zcrm-widget/blob/main/src/installers/tailwind.ts"

    classDef cli fill:#3498db,stroke:#2980b9,color:white
    classDef core fill:#2ecc71,stroke:#27ae60,color:white
    classDef template fill:#e67e22,stroke:#d35400,color:white
    classDef util fill:#9b59b6,stroke:#8e44ad,color:white
    classDef installer fill:#e74c3c,stroke:#c0392b,color:white

    class CLI_ENTRY,CLI_INPUT,CLI_VERSION,CLI_VALIDATE,CLI_DISPLAY cli
    class CREATOR,SCAFFOLD,DEP_INSTALL,ALIAS core
    class REACT,VUE,EXTRA,CICD,STYLES template
    class PKG_MGR,GIT_OPS,LOGGER,DEP_MGR,PKG_INSTALL util
    class MAIN_INSTALL,ESLINT,TAILWIND installer
```
