# ottomated/create-o7-app architecture

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

- Interactive diagram: https://gitdiagram.com/ottomated/create-o7-app
- Repository: https://github.com/ottomated/create-o7-app

## Overview

##### Main Components

a. CLI Core (Main Application)
- Input Handler System
- Project Creator System
- Telemetry System

b. Template System
- Base Template
- Feature Templates
- Template Builder

c. External Services Integration
- Git Integration
- Package Manager Integration
- Telemetry Server

##### User Interface Layer
- CLI Interface (src/main.rs)
- Arguments Parser (src/args.rs)
- Input Handlers (src/input/)

##### Core Processing Layer
- Project Creator (src/create/)
- Template Builder (template_builder/)
- Feature Management

##### Output Layer
- Scaffold Generator
- Package Manager Integration
- Git Repository Setup
- Telemetry Reporting

##### Detailed Component Breakdown

**[CLI Interface] → [Input Handler]**
- ↓
**[Project Creator] → [Template Builder]**
- ↓
**[Feature Integration] → [Scaffold Generator]**
- ↓
**[Output Generation]**

##### Key Relationships to Highlight

- How the template_builder interacts with both base and feature templates
- Relationship between user input and feature selection
- Demonstrate how telemetry data flows from CLI to server
- Integration points with external tools (git, package managers)

##### Important Subsystems

Template System:
**[Base Template] ← [Template Builder] → [Feature Templates]**
- ↓                    ↓                    ↓
**[Project Structure] [Configuration] [Optional Features]**

Feature Integration:
**[tRPC] [Prisma] [Kysely] [Lucia]**
- ↓      ↓       ↓        ↓
- [Feature Integration Layer]

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef cli fill:#2196F3,color:white
    classDef template fill:#4CAF50,color:white
    classDef external fill:#FF9800,color:white
    classDef telemetry fill:#9C27B0,color:white
    classDef core fill:#607D8B,color:white

    %% User Interface Layer
    subgraph UI
        CLI[CLI Interface]:::cli
        Args[Arguments Parser]:::cli
        Input[Input Handler]:::cli
        Features[Project Features]:::cli
    end

    %% Core Processing Layer
    subgraph Core
        Creator[Project Creator]:::core
        TBuilder[Template Builder]:::template
        Scaffold[Scaffold Generator]:::core
        PackageJSON[Package JSON Handler]:::core
        NextSteps[Next Steps Handler]:::core
    end

    %% Template System
    subgraph Templates
        BaseTemp[Base Template]:::template
        FeatureTemp[Feature Templates]:::template
    end

    %% External Services
    subgraph External
        Git[Git Integration]:::external
        PackageManager[Package Manager]:::external
    end

    %% Telemetry System
    subgraph Telemetry
        TelemetryClient[Telemetry Client]:::telemetry
        TelemetryServer[Telemetry Server]:::telemetry
    end

    %% Relationships
    CLI --> Args
    Args --> Input
    Input --> Features
    Features --> Creator
    Creator --> TBuilder
    TBuilder --> BaseTemp
    TBuilder --> FeatureTemp
    Creator --> Scaffold
    Scaffold --> PackageJSON
    PackageJSON --> NextSteps
    Creator --> Git
    Creator --> PackageManager
    CLI --> TelemetryClient
    TelemetryClient --> TelemetryServer

    %% Click Events
    click CLI "https://github.com/ottomated/create-o7-app/blob/main/src/main.rs"
    click Args "https://github.com/ottomated/create-o7-app/blob/main/src/args.rs"
    click Input "https://github.com/ottomated/create-o7-app/tree/main/src/input/"
    click Features "https://github.com/ottomated/create-o7-app/blob/main/src/input/project_features.rs"
    click Creator "https://github.com/ottomated/create-o7-app/tree/main/src/create/"
    click TBuilder "https://github.com/ottomated/create-o7-app/blob/main/template_builder/src/lib.rs"
    click BaseTemp "https://github.com/ottomated/create-o7-app/tree/main/template_builder/templates/base/"
    click FeatureTemp "https://github.com/ottomated/create-o7-app/tree/main/template_builder/templates/extras/"
    click Git "https://github.com/ottomated/create-o7-app/blob/main/src/create/git.rs"
    click PackageManager "https://github.com/ottomated/create-o7-app/blob/main/src/create/install_deps.rs"
    click TelemetryClient "https://github.com/ottomated/create-o7-app/blob/main/src/telemetry.rs"
    click TelemetryServer "https://github.com/ottomated/create-o7-app/tree/main/telemetry-server/"
    click Scaffold "https://github.com/ottomated/create-o7-app/blob/main/src/create/scaffold.rs"
    click PackageJSON "https://github.com/ottomated/create-o7-app/blob/main/src/create/package_json.rs"
    click NextSteps "https://github.com/ottomated/create-o7-app/blob/main/src/create/next_steps.rs"

    %% Legend
    subgraph Legend
        L1[CLI Components]:::cli
        L2[Template System]:::template
        L3[External Services]:::external
        L4[Telemetry System]:::telemetry
        L5[Core Components]:::core
    end
```
